-#include "image.h"
+#include "imager.h"
#include "draw.h"
#include "log.h"
static
p_line *
-line_set_new(double *x, double *y, int l) {
+line_set_new(const double *x, const double *y, int l) {
int i;
p_line *lset = mymalloc(sizeof(p_line) * l);
static
p_point *
-point_set_new(double *x, double *y, int l) {
+point_set_new(const double *x, const double *y, int l) {
int i;
p_point *pset = mymalloc(sizeof(p_point) * l);
return 0;
}
-typedef void (*scanline_flusher)(i_img *im, ss_scanline *ss, int y, void *ctx);
+typedef void (*scanline_flusher)(i_img *im, ss_scanline *ss, int y, const void *ctx);
/* This function must be modified later to do proper blending */
static void
-scanline_flush(i_img *im, ss_scanline *ss, int y, void *ctx) {
+scanline_flush(i_img *im, ss_scanline *ss, int y, const void *ctx) {
int x, ch, tv;
i_color t;
i_color *val = (i_color *)ctx;
static void
-i_poly_aa_low(i_img *im, int l, double *x, double *y, void *ctx, scanline_flusher flusher) {
+i_poly_aa_low(i_img *im, int l, const double *x, const double *y, void const *ctx, scanline_flusher flusher) {
int i ,k; /* Index variables */
int clc; /* Lines inside current interval */
pcord tempy;
} /* Function */
void
-i_poly_aa(i_img *im, int l, double *x, double *y, i_color *val) {
+i_poly_aa(i_img *im, int l, const double *x, const double *y, const i_color *val) {
i_poly_aa_low(im, l, x, y, val, scanline_flush);
}
};
static void
-scanline_flush_cfill(i_img *im, ss_scanline *ss, int y, void *ctx) {
+scanline_flush_cfill(i_img *im, ss_scanline *ss, int y, const void *ctx) {
int x, ch, tv;
int pos;
int left, right;
- struct poly_cfill_state *state = (struct poly_cfill_state *)ctx;
+ struct poly_cfill_state const *state = (struct poly_cfill_state const *)ctx;
i_color *fillbuf = state->fillbuf;
i_color *line = state->linebuf;
};
static void
-scanline_flush_cfill_f(i_img *im, ss_scanline *ss, int y, void *ctx) {
+scanline_flush_cfill_f(i_img *im, ss_scanline *ss, int y, const void *ctx) {
int x, ch, tv;
int pos;
int left, right;
- struct poly_cfill_state_f *state = (struct poly_cfill_state_f *)ctx;
+ struct poly_cfill_state_f const *state = (struct poly_cfill_state_f const *)ctx;
i_fcolor *fillbuf = state->fillbuf;
i_fcolor *line = state->linebuf;
}
void
-i_poly_aa_cfill(i_img *im, int l, double *x, double *y, i_fill_t *fill) {
+i_poly_aa_cfill(i_img *im, int l, const double *x, const double *y, i_fill_t *fill) {
if (im->bits == i_8_bits && fill->fill_with_color) {
struct poly_cfill_state ctx;
ctx.fillbuf = mymalloc(sizeof(i_color) * im->xsize * 2);