Skip to content

Commit

Permalink
(giza-render) compiler warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Dec 2, 2024
1 parent b3f1ea5 commit a36ebc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
1 change: 0 additions & 1 deletion src/giza-render-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

static void _giza_colour_pixel (unsigned char *array, int pixNum, double pos);
static void _giza_colour_pixel_transparent (unsigned char *array, int pixNum, double pos);
static void _giza_colour_pixel_alpha (unsigned char *array, int pixNum, double pos, double alpha);
static void _giza_colour_pixel_index_alpha (unsigned char *array, int pixNum, int ci, double alpha);
void _giza_render (int sizex, int sizey, const double* data, int i1, int i2,
Expand Down
32 changes: 2 additions & 30 deletions src/giza-render.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ _giza_render (int sizex, int sizey, const double* data, int i1, int i2,
cairo_matrix_t mat;
int stride, pixnum, width = i2 - i1 + 1, height = j2 - j1 + 1;
int cimin, cimax;
double pos, alpha;

cairo_extend_t cairoextendtype;
_giza_get_extend(extend,&cairoextendtype);
Expand Down Expand Up @@ -162,12 +161,12 @@ _giza_render (int sizex, int sizey, const double* data, int i1, int i2,
}
} else if (transparent==1) {
/* render each pixel, using transparent routine */
int idx;
int idx;
for (j = j1; j <= j2; j++)
{
for (i = i1; i <= i2; i++)
{
idx = itf_idx(data[j*sizex + i], valMin, valMax, cimin, cimax);
idx = itf_idx(data[j*sizex + i], valMin, valMax, cimin, cimax);
_giza_colour_pixel_index_alpha (pixdata, pixnum, idx, idx==cimin ? 0. : 1.);
pixnum = pixnum + 1;
}
Expand Down Expand Up @@ -276,13 +275,6 @@ _giza_render_float (int sizex, int sizey, const float* data, int i1,
cairo_matrix_t mat;
int stride, pixnum, width = i2 - i1 + 1, height = j2 - j1 + 1;
int cimin, cimax;
double pos,alpha,ddval;
double dvalMin = (double) valMin;
if (valMax - valMin > 0.) {
ddval = 1./((double) valMax - dvalMin);
} else {
ddval = 0.;
}

cairo_extend_t cairoextendtype;
_giza_get_extend(extend,&cairoextendtype);
Expand Down Expand Up @@ -414,26 +406,6 @@ _giza_colour_pixel (unsigned char *array, int pixNum, double pos)
array[pixNum * 4 + 0] = (unsigned char) (b * 255.);
}

/**
* As in _giza_colour_pixel, but sets the pixels to be transparent if pos <= 0
*/
static void
_giza_colour_pixel_transparent (unsigned char *array, int pixNum, double pos)
{
double r, g, b;
giza_rgb_from_table (pos, &r, &g, &b);
/* set the alpha */
if (pos <= 0.) {
array[pixNum * 4 + 3] = 0.;
} else {
array[pixNum * 4 + 3] = 255.;
}
/* set the red, green, and blue */
array[pixNum * 4 + 2] = (unsigned char) (r * 255.);
array[pixNum * 4 + 1] = (unsigned char) (g * 255.);
array[pixNum * 4 + 0] = (unsigned char) (b * 255.);
}

/**
* As in _giza_colour_pixel, but takes an additional alpha parameter
*/
Expand Down

0 comments on commit a36ebc4

Please sign in to comment.