mirror of https://github.com/GNOME/gimp.git
Rename the convenient channel offset defines from FOO_PIX to FOO as this
* app/base/base-types.h: Rename the convenient channel offset defines from FOO_PIX to FOO as this increases readability. * app/base/color-balance.c * app/base/colorize.c * app/base/desaturate.c * app/base/hue-saturation.c * app/base/siox.c * app/base/threshold.c * app/core/gimp-edit.c * app/core/gimp-transform-region.c * app/core/gimpchannel.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-convert.c * app/core/gimpdrawable-stroke.c * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage.c * app/core/gimppalette-import.c * app/core/gimppickable.c * app/gegl/gimpoperation*mode.c * app/gegl/gimpoperationcolorbalance.c * app/gegl/gimpoperationcolorize.c * app/gegl/gimpoperationhuesaturation.c * app/gegl/gimpoperationlevels.c * app/gegl/gimpoperationposterize.c * app/gegl/gimpoperationthreshold.c * app/paint-funcs/subsample-region.c * app/paint/gimpclone.c * app/paint/gimppaintbrush.c * app/widgets/gimpviewrenderer.c: Adapt. svn path=/trunk/; revision=27324
This commit is contained in:
parent
6204aa3222
commit
e38ca5490a
39
ChangeLog
39
ChangeLog
|
@ -1,3 +1,42 @@
|
|||
2008-10-19 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* app/base/base-types.h: Rename the convenient channel offset
|
||||
defines from FOO_PIX to FOO as this increases readability.
|
||||
|
||||
* app/base/color-balance.c
|
||||
* app/base/colorize.c
|
||||
* app/base/desaturate.c
|
||||
* app/base/hue-saturation.c
|
||||
* app/base/siox.c
|
||||
* app/base/threshold.c
|
||||
|
||||
* app/core/gimp-edit.c
|
||||
* app/core/gimp-transform-region.c
|
||||
* app/core/gimpchannel.c
|
||||
* app/core/gimpdrawable-bucket-fill.c
|
||||
* app/core/gimpdrawable-convert.c
|
||||
* app/core/gimpdrawable-stroke.c
|
||||
* app/core/gimpdrawable.c
|
||||
* app/core/gimpimage-convert.c
|
||||
* app/core/gimpimage.c
|
||||
* app/core/gimppalette-import.c
|
||||
* app/core/gimppickable.c
|
||||
|
||||
* app/gegl/gimpoperation*mode.c
|
||||
* app/gegl/gimpoperationcolorbalance.c
|
||||
* app/gegl/gimpoperationcolorize.c
|
||||
* app/gegl/gimpoperationhuesaturation.c
|
||||
* app/gegl/gimpoperationlevels.c
|
||||
* app/gegl/gimpoperationposterize.c
|
||||
* app/gegl/gimpoperationthreshold.c
|
||||
|
||||
* app/paint-funcs/subsample-region.c
|
||||
|
||||
* app/paint/gimpclone.c
|
||||
* app/paint/gimppaintbrush.c
|
||||
|
||||
* app/widgets/gimpviewrenderer.c: Adapt.
|
||||
|
||||
2008-10-19 Sven Neumann <sven@gimp.org>
|
||||
|
||||
Bug 493778 – metadata plug-in crashes on some images
|
||||
|
|
|
@ -32,16 +32,18 @@
|
|||
|
||||
|
||||
/* convenient defines */
|
||||
#define MAX_CHANNELS 4
|
||||
#define MAX_CHANNELS 4
|
||||
|
||||
#define GRAY_PIX 0
|
||||
#define ALPHA_G_PIX 1
|
||||
#define RED_PIX 0
|
||||
#define GREEN_PIX 1
|
||||
#define BLUE_PIX 2
|
||||
#define ALPHA_PIX 3
|
||||
#define INDEXED_PIX 0
|
||||
#define ALPHA_I_PIX 1
|
||||
#define RED 0
|
||||
#define GREEN 1
|
||||
#define BLUE 2
|
||||
#define ALPHA 3
|
||||
|
||||
#define GRAY 0
|
||||
#define ALPHA_G 1
|
||||
|
||||
#define INDEXED 0
|
||||
#define ALPHA_I 1
|
||||
|
||||
|
||||
/* types */
|
||||
|
|
|
@ -190,9 +190,9 @@ color_balance (ColorBalance *cb,
|
|||
|
||||
while (w--)
|
||||
{
|
||||
r = s[RED_PIX];
|
||||
g = s[GREEN_PIX];
|
||||
b = s[BLUE_PIX];
|
||||
r = s[RED];
|
||||
g = s[GREEN];
|
||||
b = s[BLUE];
|
||||
|
||||
r_n = cb->r_lookup[r];
|
||||
g_n = cb->g_lookup[g];
|
||||
|
@ -205,12 +205,12 @@ color_balance (ColorBalance *cb,
|
|||
gimp_hsl_to_rgb_int (&r_n, &g_n, &b_n);
|
||||
}
|
||||
|
||||
d[RED_PIX] = r_n;
|
||||
d[GREEN_PIX] = g_n;
|
||||
d[BLUE_PIX] = b_n;
|
||||
d[RED] = r_n;
|
||||
d[GREEN] = g_n;
|
||||
d[BLUE] = b_n;
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
d[ALPHA] = s[ALPHA];
|
||||
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
|
|
|
@ -102,9 +102,9 @@ colorize (Colorize *colorize,
|
|||
|
||||
while (w--)
|
||||
{
|
||||
lum = (colorize->lum_red_lookup[s[RED_PIX]] +
|
||||
colorize->lum_green_lookup[s[GREEN_PIX]] +
|
||||
colorize->lum_blue_lookup[s[BLUE_PIX]]); /* luminosity */
|
||||
lum = (colorize->lum_red_lookup[s[RED]] +
|
||||
colorize->lum_green_lookup[s[GREEN]] +
|
||||
colorize->lum_blue_lookup[s[BLUE]]); /* luminosity */
|
||||
|
||||
if (colorize->lightness > 0)
|
||||
{
|
||||
|
@ -117,12 +117,12 @@ colorize (Colorize *colorize,
|
|||
lum = (gdouble) lum * (colorize->lightness + 100.0) / 100.0;
|
||||
}
|
||||
|
||||
d[RED_PIX] = colorize->final_red_lookup[lum];
|
||||
d[GREEN_PIX] = colorize->final_green_lookup[lum];
|
||||
d[BLUE_PIX] = colorize->final_blue_lookup[lum];
|
||||
d[RED] = colorize->final_red_lookup[lum];
|
||||
d[GREEN] = colorize->final_green_lookup[lum];
|
||||
d[BLUE] = colorize->final_blue_lookup[lum];
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
d[ALPHA] = s[ALPHA];
|
||||
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
|
|
|
@ -84,19 +84,19 @@ desaturate_region_lightness (PixelRegion *srcPR,
|
|||
gint min, max;
|
||||
gint lightness;
|
||||
|
||||
max = MAX (s[RED_PIX], s[GREEN_PIX]);
|
||||
max = MAX (max, s[BLUE_PIX]);
|
||||
min = MIN (s[RED_PIX], s[GREEN_PIX]);
|
||||
min = MIN (min, s[BLUE_PIX]);
|
||||
max = MAX (s[RED], s[GREEN]);
|
||||
max = MAX (max, s[BLUE]);
|
||||
min = MIN (s[RED], s[GREEN]);
|
||||
min = MIN (min, s[BLUE]);
|
||||
|
||||
lightness = (max + min) / 2;
|
||||
|
||||
d[RED_PIX] = lightness;
|
||||
d[GREEN_PIX] = lightness;
|
||||
d[BLUE_PIX] = lightness;
|
||||
d[RED] = lightness;
|
||||
d[GREEN] = lightness;
|
||||
d[BLUE] = lightness;
|
||||
|
||||
if (has_alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
d[ALPHA] = s[ALPHA];
|
||||
|
||||
d += destPR->bytes;
|
||||
s += srcPR->bytes;
|
||||
|
@ -124,16 +124,16 @@ desaturate_region_luminosity (PixelRegion *srcPR,
|
|||
|
||||
for (j = 0; j < srcPR->w; j++)
|
||||
{
|
||||
gint luminosity = GIMP_RGB_LUMINANCE (s[RED_PIX],
|
||||
s[GREEN_PIX],
|
||||
s[BLUE_PIX]) + 0.5;
|
||||
gint luminosity = GIMP_RGB_LUMINANCE (s[RED],
|
||||
s[GREEN],
|
||||
s[BLUE]) + 0.5;
|
||||
|
||||
d[RED_PIX] = luminosity;
|
||||
d[GREEN_PIX] = luminosity;
|
||||
d[BLUE_PIX] = luminosity;
|
||||
d[RED] = luminosity;
|
||||
d[GREEN] = luminosity;
|
||||
d[BLUE] = luminosity;
|
||||
|
||||
if (has_alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
d[ALPHA] = s[ALPHA];
|
||||
|
||||
d += destPR->bytes;
|
||||
s += srcPR->bytes;
|
||||
|
@ -161,14 +161,14 @@ desaturate_region_average (PixelRegion *srcPR,
|
|||
|
||||
for (j = 0; j < srcPR->w; j++)
|
||||
{
|
||||
gint average = (s[RED_PIX] + s[GREEN_PIX] + s[BLUE_PIX] + 1) / 3;
|
||||
gint average = (s[RED] + s[GREEN] + s[BLUE] + 1) / 3;
|
||||
|
||||
d[RED_PIX] = average;
|
||||
d[GREEN_PIX] = average;
|
||||
d[BLUE_PIX] = average;
|
||||
d[RED] = average;
|
||||
d[GREEN] = average;
|
||||
d[BLUE] = average;
|
||||
|
||||
if (has_alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
d[ALPHA] = s[ALPHA];
|
||||
|
||||
d += destPR->bytes;
|
||||
s += srcPR->bytes;
|
||||
|
|
|
@ -126,9 +126,9 @@ hue_saturation (HueSaturation *hs,
|
|||
|
||||
while (w--)
|
||||
{
|
||||
r = s[RED_PIX];
|
||||
g = s[GREEN_PIX];
|
||||
b = s[BLUE_PIX];
|
||||
r = s[RED];
|
||||
g = s[GREEN];
|
||||
b = s[BLUE];
|
||||
|
||||
gimp_rgb_to_hsl_int (&r, &g, &b);
|
||||
|
||||
|
@ -194,12 +194,12 @@ hue_saturation (HueSaturation *hs,
|
|||
|
||||
gimp_hsl_to_rgb_int (&r, &g, &b);
|
||||
|
||||
d[RED_PIX] = r;
|
||||
d[GREEN_PIX] = g;
|
||||
d[BLUE_PIX] = b;
|
||||
d[RED] = r;
|
||||
d[GREEN] = g;
|
||||
d[BLUE] = b;
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
d[ALPHA] = s[ALPHA];
|
||||
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
|
|
|
@ -143,9 +143,9 @@ calc_lab (const guchar *src,
|
|||
{
|
||||
case 3: /* RGB */
|
||||
case 4: /* RGBA */
|
||||
cpercep_rgb_to_space (src[RED_PIX],
|
||||
src[GREEN_PIX],
|
||||
src[BLUE_PIX], &l, &a, &b);
|
||||
cpercep_rgb_to_space (src[RED],
|
||||
src[GREEN],
|
||||
src[BLUE], &l, &a, &b);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -154,9 +154,9 @@ calc_lab (const guchar *src,
|
|||
{
|
||||
gint i = *src * 3;
|
||||
|
||||
cpercep_rgb_to_space (colormap[i + RED_PIX],
|
||||
colormap[i + GREEN_PIX],
|
||||
colormap[i + BLUE_PIX], &l, &a, &b);
|
||||
cpercep_rgb_to_space (colormap[i + RED],
|
||||
colormap[i + GREEN],
|
||||
colormap[i + BLUE], &l, &a, &b);
|
||||
}
|
||||
else /* GRAY(A) */
|
||||
{
|
||||
|
@ -691,16 +691,16 @@ create_key (const guchar *src,
|
|||
{
|
||||
case 3: /* RGB */
|
||||
case 4: /* RGBA */
|
||||
return (src[RED_PIX] << 16 | src[GREEN_PIX] << 8 | src[BLUE_PIX]);
|
||||
return (src[RED] << 16 | src[GREEN] << 8 | src[BLUE]);
|
||||
case 2:
|
||||
case 1:
|
||||
if (colormap) /* INDEXED(A) */
|
||||
{
|
||||
gint i = *src * 3;
|
||||
|
||||
return (colormap[i + RED_PIX] << 16 |
|
||||
colormap[i + GREEN_PIX] << 8 |
|
||||
colormap[i + BLUE_PIX]);
|
||||
return (colormap[i + RED] << 16 |
|
||||
colormap[i + GREEN] << 8 |
|
||||
colormap[i + BLUE]);
|
||||
}
|
||||
else /* GRAY(A) */
|
||||
{
|
||||
|
|
|
@ -54,16 +54,16 @@ threshold (Threshold *tr,
|
|||
{
|
||||
if (tr->color)
|
||||
{
|
||||
value = MAX (s[RED_PIX], s[GREEN_PIX]);
|
||||
value = MAX (value, s[BLUE_PIX]);
|
||||
value = MAX (s[RED], s[GREEN]);
|
||||
value = MAX (value, s[BLUE]);
|
||||
|
||||
value = (value >= tr->low_threshold &&
|
||||
value <= tr->high_threshold ) ? 255 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = (s[GRAY_PIX] >= tr->low_threshold &&
|
||||
s[GRAY_PIX] <= tr->high_threshold) ? 255 : 0;
|
||||
value = (s[GRAY] >= tr->low_threshold &&
|
||||
s[GRAY] <= tr->high_threshold) ? 255 : 0;
|
||||
}
|
||||
|
||||
for (b = 0; b < alpha; b++)
|
||||
|
|
|
@ -612,9 +612,9 @@ gimp_edit_fill_internal (GimpImage *image,
|
|||
{
|
||||
guchar tmp_col[MAX_CHANNELS];
|
||||
|
||||
tmp_col[RED_PIX] = 255;
|
||||
tmp_col[GREEN_PIX] = 255;
|
||||
tmp_col[BLUE_PIX] = 255;
|
||||
tmp_col[RED] = 255;
|
||||
tmp_col[GREEN] = 255;
|
||||
tmp_col[BLUE] = 255;
|
||||
gimp_image_transform_color (image, drawable_type, col,
|
||||
GIMP_RGB, tmp_col);
|
||||
}
|
||||
|
|
|
@ -210,18 +210,18 @@ gimp_transform_region (GimpPickable *pickable,
|
|||
switch (GIMP_IMAGE_TYPE_BASE_TYPE (pickable_type))
|
||||
{
|
||||
case GIMP_RGB:
|
||||
bg_color[ALPHA_PIX] = TRANSPARENT_OPACITY;
|
||||
alpha = ALPHA_PIX;
|
||||
bg_color[ALPHA] = TRANSPARENT_OPACITY;
|
||||
alpha = ALPHA;
|
||||
break;
|
||||
|
||||
case GIMP_GRAY:
|
||||
bg_color[ALPHA_G_PIX] = TRANSPARENT_OPACITY;
|
||||
alpha = ALPHA_G_PIX;
|
||||
bg_color[ALPHA_G] = TRANSPARENT_OPACITY;
|
||||
alpha = ALPHA_G;
|
||||
break;
|
||||
|
||||
case GIMP_INDEXED:
|
||||
bg_color[ALPHA_I_PIX] = TRANSPARENT_OPACITY;
|
||||
alpha = ALPHA_I_PIX;
|
||||
bg_color[ALPHA_I] = TRANSPARENT_OPACITY;
|
||||
alpha = ALPHA_I;
|
||||
/* If the image is indexed color, ignore interpolation value */
|
||||
interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
break;
|
||||
|
|
|
@ -767,8 +767,8 @@ gimp_channel_get_active_components (const GimpDrawable *drawable,
|
|||
gboolean *active)
|
||||
{
|
||||
/* Make sure that the alpha channel is not valid. */
|
||||
active[GRAY_PIX] = TRUE;
|
||||
active[ALPHA_G_PIX] = FALSE;
|
||||
active[GRAY] = TRUE;
|
||||
active[ALPHA_G] = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -157,9 +157,9 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable,
|
|||
guchar tmp_col[MAX_CHANNELS];
|
||||
|
||||
gimp_rgb_get_uchar (color,
|
||||
&tmp_col[RED_PIX],
|
||||
&tmp_col[GREEN_PIX],
|
||||
&tmp_col[BLUE_PIX]);
|
||||
&tmp_col[RED],
|
||||
&tmp_col[GREEN],
|
||||
&tmp_col[BLUE]);
|
||||
|
||||
gimp_image_transform_color (image, gimp_drawable_type (drawable), col,
|
||||
GIMP_RGB, tmp_col);
|
||||
|
|
|
@ -84,9 +84,9 @@ gimp_drawable_convert_rgb (GimpDrawable *drawable,
|
|||
|
||||
for (col = 0; col < srcPR.w; col++)
|
||||
{
|
||||
d[RED_PIX] = *s;
|
||||
d[GREEN_PIX] = *s;
|
||||
d[BLUE_PIX] = *s;
|
||||
d[RED] = *s;
|
||||
d[GREEN] = *s;
|
||||
d[BLUE] = *s;
|
||||
|
||||
d += 3;
|
||||
s++;
|
||||
|
@ -116,9 +116,9 @@ gimp_drawable_convert_rgb (GimpDrawable *drawable,
|
|||
for (col = 0; col < srcPR.w; col++)
|
||||
{
|
||||
offset = *s++ * 3;
|
||||
d[RED_PIX] = cmap[offset + 0];
|
||||
d[GREEN_PIX] = cmap[offset + 1];
|
||||
d[BLUE_PIX] = cmap[offset + 2];
|
||||
d[RED] = cmap[offset + 0];
|
||||
d[GREEN] = cmap[offset + 1];
|
||||
d[BLUE] = cmap[offset + 2];
|
||||
|
||||
d += 3;
|
||||
if (has_alpha)
|
||||
|
@ -186,9 +186,9 @@ gimp_drawable_convert_grayscale (GimpDrawable *drawable,
|
|||
d = dest;
|
||||
for (col = 0; col < srcPR.w; col++)
|
||||
{
|
||||
val = GIMP_RGB_LUMINANCE (s[RED_PIX],
|
||||
s[GREEN_PIX],
|
||||
s[BLUE_PIX]) + 0.5;
|
||||
val = GIMP_RGB_LUMINANCE (s[RED],
|
||||
s[GREEN],
|
||||
s[BLUE]) + 0.5;
|
||||
*d++ = (guchar) val;
|
||||
s += 3;
|
||||
if (has_alpha)
|
||||
|
|
|
@ -287,9 +287,9 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
|
|||
guchar col[MAX_CHANNELS] = { 0, };
|
||||
|
||||
gimp_rgb_get_uchar (&context->foreground,
|
||||
&tmp_col[RED_PIX],
|
||||
&tmp_col[GREEN_PIX],
|
||||
&tmp_col[BLUE_PIX]);
|
||||
&tmp_col[RED],
|
||||
&tmp_col[GREEN],
|
||||
&tmp_col[BLUE]);
|
||||
|
||||
gimp_image_transform_color (image, gimp_drawable_type (drawable), col,
|
||||
GIMP_RGB, tmp_col);
|
||||
|
|
|
@ -1253,15 +1253,15 @@ gimp_drawable_fill (GimpDrawable *drawable,
|
|||
guchar c[MAX_CHANNELS];
|
||||
|
||||
gimp_rgba_get_uchar (color,
|
||||
&tmp[RED_PIX],
|
||||
&tmp[GREEN_PIX],
|
||||
&tmp[BLUE_PIX],
|
||||
&tmp[ALPHA_PIX]);
|
||||
&tmp[RED],
|
||||
&tmp[GREEN],
|
||||
&tmp[BLUE],
|
||||
&tmp[ALPHA]);
|
||||
|
||||
gimp_image_transform_color (image, drawable_type, c, GIMP_RGB, tmp);
|
||||
|
||||
if (GIMP_IMAGE_TYPE_HAS_ALPHA (drawable_type))
|
||||
c[GIMP_IMAGE_TYPE_BYTES (drawable_type) - 1] = tmp[ALPHA_PIX];
|
||||
c[GIMP_IMAGE_TYPE_BYTES (drawable_type) - 1] = tmp[ALPHA];
|
||||
else
|
||||
c[GIMP_IMAGE_TYPE_BYTES (drawable_type)] = OPAQUE_OPACITY;
|
||||
|
||||
|
|
|
@ -713,8 +713,8 @@ remap_indexed_layer (GimpLayer *layer,
|
|||
{
|
||||
while (pixels--)
|
||||
{
|
||||
if (src[ALPHA_I_PIX])
|
||||
dest[INDEXED_PIX] = remap_table[src[INDEXED_PIX]];
|
||||
if (src[ALPHA_I])
|
||||
dest[INDEXED] = remap_table[src[INDEXED]];
|
||||
|
||||
src += srcPR.bytes;
|
||||
dest += destPR.bytes;
|
||||
|
@ -724,7 +724,7 @@ remap_indexed_layer (GimpLayer *layer,
|
|||
{
|
||||
while (pixels--)
|
||||
{
|
||||
dest[INDEXED_PIX] = remap_table[src[INDEXED_PIX]];
|
||||
dest[INDEXED] = remap_table[src[INDEXED]];
|
||||
|
||||
src += srcPR.bytes;
|
||||
dest += destPR.bytes;
|
||||
|
@ -1135,7 +1135,7 @@ generate_histogram_gray (CFHistogram histogram,
|
|||
{
|
||||
while (size--)
|
||||
{
|
||||
if (data[ALPHA_G_PIX] > 127)
|
||||
if (data[ALPHA_G] > 127)
|
||||
histogram[*data]++;
|
||||
|
||||
data += srcPR.bytes;
|
||||
|
@ -1216,16 +1216,16 @@ generate_histogram_rgb (CFHistogram histogram,
|
|||
gboolean transparent = FALSE;
|
||||
|
||||
if (has_alpha &&
|
||||
data[ALPHA_PIX] <
|
||||
data[ALPHA] <
|
||||
DM[col & DM_WIDTHMASK][row & DM_HEIGHTMASK])
|
||||
transparent = TRUE;
|
||||
|
||||
if (! transparent)
|
||||
{
|
||||
colfreq = HIST_RGB (histogram,
|
||||
data[RED_PIX],
|
||||
data[GREEN_PIX],
|
||||
data[BLUE_PIX]);
|
||||
data[RED],
|
||||
data[GREEN],
|
||||
data[BLUE]);
|
||||
(*colfreq)++;
|
||||
}
|
||||
|
||||
|
@ -1243,13 +1243,13 @@ generate_histogram_rgb (CFHistogram histogram,
|
|||
{
|
||||
while (size--)
|
||||
{
|
||||
if ((has_alpha && ((data[ALPHA_PIX] > 127)))
|
||||
if ((has_alpha && ((data[ALPHA] > 127)))
|
||||
|| (!has_alpha))
|
||||
{
|
||||
colfreq = HIST_RGB (histogram,
|
||||
data[RED_PIX],
|
||||
data[GREEN_PIX],
|
||||
data[BLUE_PIX]);
|
||||
data[RED],
|
||||
data[GREEN],
|
||||
data[BLUE]);
|
||||
(*colfreq)++;
|
||||
}
|
||||
data += srcPR.bytes;
|
||||
|
@ -1270,22 +1270,22 @@ generate_histogram_rgb (CFHistogram histogram,
|
|||
{
|
||||
if (alpha_dither)
|
||||
{
|
||||
if (data[ALPHA_PIX] <
|
||||
if (data[ALPHA] <
|
||||
DM[col & DM_WIDTHMASK][row & DM_HEIGHTMASK])
|
||||
transparent = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data[ALPHA_PIX] <= 127)
|
||||
if (data[ALPHA] <= 127)
|
||||
transparent = TRUE;
|
||||
}
|
||||
}
|
||||
if (! transparent)
|
||||
{
|
||||
colfreq = HIST_RGB (histogram,
|
||||
data[RED_PIX],
|
||||
data[GREEN_PIX],
|
||||
data[BLUE_PIX]);
|
||||
data[RED],
|
||||
data[GREEN],
|
||||
data[BLUE]);
|
||||
(*colfreq)++;
|
||||
|
||||
if (!needs_quantize)
|
||||
|
@ -1295,11 +1295,11 @@ generate_histogram_rgb (CFHistogram histogram,
|
|||
nfc_iter++)
|
||||
{
|
||||
if (
|
||||
(data[RED_PIX] == found_cols[nfc_iter][0])
|
||||
(data[RED] == found_cols[nfc_iter][0])
|
||||
&&
|
||||
(data[GREEN_PIX] == found_cols[nfc_iter][1])
|
||||
(data[GREEN] == found_cols[nfc_iter][1])
|
||||
&&
|
||||
(data[BLUE_PIX] == found_cols[nfc_iter][2])
|
||||
(data[BLUE] == found_cols[nfc_iter][2])
|
||||
)
|
||||
goto already_found;
|
||||
}
|
||||
|
@ -1325,9 +1325,9 @@ generate_histogram_rgb (CFHistogram histogram,
|
|||
{
|
||||
/* Remember the new colour we just found.
|
||||
*/
|
||||
found_cols[num_found_cols-1][0] = data[RED_PIX];
|
||||
found_cols[num_found_cols-1][1] = data[GREEN_PIX];
|
||||
found_cols[num_found_cols-1][2] = data[BLUE_PIX];
|
||||
found_cols[num_found_cols-1][0] = data[RED];
|
||||
found_cols[num_found_cols-1][1] = data[GREEN];
|
||||
found_cols[num_found_cols-1][2] = data[BLUE];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2797,7 +2797,7 @@ median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
|
|||
for (col = 0; col < srcPR.w; col++)
|
||||
{
|
||||
/* get pixel value and index into the cache */
|
||||
pixel = src[GRAY_PIX];
|
||||
pixel = src[GRAY];
|
||||
cachep = &histogram[pixel];
|
||||
/* If we have not seen this color before, find nearest colormap entry */
|
||||
/* and update the cache */
|
||||
|
@ -2813,29 +2813,29 @@ median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
|
|||
gint dither_x = (col+offsetx+srcPR.x) & DM_WIDTHMASK;
|
||||
gint dither_y = (row+offsety+srcPR.y) & DM_HEIGHTMASK;
|
||||
|
||||
if ((src[ALPHA_G_PIX]) < DM[dither_x][dither_y])
|
||||
if ((src[ALPHA_G]) < DM[dither_x][dither_y])
|
||||
transparent = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (src[ALPHA_G_PIX] <= 127)
|
||||
if (src[ALPHA_G] <= 127)
|
||||
transparent = TRUE;
|
||||
}
|
||||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
index_used_count[dest[INDEXED_PIX] = *cachep - 1]++;
|
||||
dest[ALPHA_I] = 255;
|
||||
index_used_count[dest[INDEXED] = *cachep - 1]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now emit the colormap index for this cell */
|
||||
index_used_count[dest[INDEXED_PIX] = *cachep - 1]++;
|
||||
index_used_count[dest[INDEXED] = *cachep - 1]++;
|
||||
}
|
||||
|
||||
src += srcPR.bytes;
|
||||
|
@ -2898,7 +2898,7 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
|
|||
[(row+offsety+srcPR.y) & DM_HEIGHTMASK];
|
||||
|
||||
/* get pixel value and index into the cache */
|
||||
pixel = src[GRAY_PIX];
|
||||
pixel = src[GRAY];
|
||||
cachep = &histogram[pixel];
|
||||
/* If we have not seen this color before, find nearest colormap entry */
|
||||
/* and update the cache */
|
||||
|
@ -2909,8 +2909,8 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
|
|||
color1 = &quantobj->cmap[pixval1];
|
||||
|
||||
if (quantobj->actual_number_of_colors > 2) {
|
||||
const int re = src[GRAY_PIX] - (int)color1->red;
|
||||
int RV = src[GRAY_PIX] + re;
|
||||
const int re = src[GRAY] - (int)color1->red;
|
||||
int RV = src[GRAY] + re;
|
||||
do {
|
||||
const gint R = CLAMP0255(RV);
|
||||
cachep = &histogram[R];
|
||||
|
@ -2944,8 +2944,8 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
|
|||
|
||||
color2 = &quantobj->cmap[pixval2];
|
||||
|
||||
err1 = ABS(color1->red - src[GRAY_PIX]);
|
||||
err2 = ABS(color2->red - src[GRAY_PIX]);
|
||||
err1 = ABS(color1->red - src[GRAY]);
|
||||
err2 = ABS(color2->red - src[GRAY]);
|
||||
if (err1 || err2) {
|
||||
const int proportion2 = (256 * 255 * err2) / (err1 + err2);
|
||||
if ((dmval * 256) > proportion2) {
|
||||
|
@ -2959,29 +2959,29 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
|
|||
|
||||
if (alpha_dither)
|
||||
{
|
||||
if ((src[ALPHA_G_PIX] << 6) < (255 * dmval))
|
||||
if ((src[ALPHA_G] << 6) < (255 * dmval))
|
||||
transparent = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (src[ALPHA_G_PIX] <= 127)
|
||||
if (src[ALPHA_G] <= 127)
|
||||
transparent = TRUE;
|
||||
}
|
||||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
index_used_count[dest[INDEXED_PIX] = pixval1]++;
|
||||
dest[ALPHA_I] = 255;
|
||||
index_used_count[dest[INDEXED] = pixval1]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now emit the colormap index for this cell, barfbarf */
|
||||
index_used_count[dest[INDEXED_PIX] = pixval1]++;
|
||||
index_used_count[dest[INDEXED] = pixval1]++;
|
||||
}
|
||||
|
||||
src += srcPR.bytes;
|
||||
|
@ -3005,10 +3005,10 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
|
|||
gint row, col;
|
||||
gboolean has_alpha;
|
||||
gpointer pr;
|
||||
gint red_pix = RED_PIX;
|
||||
gint green_pix = GREEN_PIX;
|
||||
gint blue_pix = BLUE_PIX;
|
||||
gint alpha_pix = ALPHA_PIX;
|
||||
gint red_pix = RED;
|
||||
gint green_pix = GREEN;
|
||||
gint blue_pix = BLUE;
|
||||
gint alpha_pix = ALPHA;
|
||||
gboolean alpha_dither = quantobj->want_alpha_dither;
|
||||
gint offsetx, offsety;
|
||||
gulong *index_used_count = quantobj->index_used_count;
|
||||
|
@ -3025,8 +3025,8 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
|
|||
*/
|
||||
if (gimp_drawable_is_gray (GIMP_DRAWABLE (layer)))
|
||||
{
|
||||
red_pix = green_pix = blue_pix = GRAY_PIX;
|
||||
alpha_pix = ALPHA_G_PIX;
|
||||
red_pix = green_pix = blue_pix = GRAY;
|
||||
alpha_pix = ALPHA_G;
|
||||
}
|
||||
|
||||
has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
|
||||
|
@ -3077,12 +3077,12 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
|
|||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
goto next_pixel;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3096,7 +3096,7 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
|
|||
fill_inverse_cmap_rgb (quantobj, histogram, R, G, B);
|
||||
|
||||
/* Now emit the colormap index for this cell, barfbarf */
|
||||
index_used_count[dest[INDEXED_PIX] = *cachep - 1]++;
|
||||
index_used_count[dest[INDEXED] = *cachep - 1]++;
|
||||
|
||||
next_pixel:
|
||||
|
||||
|
@ -3130,10 +3130,10 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
|
|||
gint row, col;
|
||||
gboolean has_alpha;
|
||||
gpointer pr;
|
||||
gint red_pix = RED_PIX;
|
||||
gint green_pix = GREEN_PIX;
|
||||
gint blue_pix = BLUE_PIX;
|
||||
gint alpha_pix = ALPHA_PIX;
|
||||
gint red_pix = RED;
|
||||
gint green_pix = GREEN;
|
||||
gint blue_pix = BLUE;
|
||||
gint alpha_pix = ALPHA;
|
||||
gboolean alpha_dither = quantobj->want_alpha_dither;
|
||||
gint offsetx, offsety;
|
||||
gulong *index_used_count = quantobj->index_used_count;
|
||||
|
@ -3150,8 +3150,8 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
|
|||
*/
|
||||
if (gimp_drawable_is_gray (GIMP_DRAWABLE (layer)))
|
||||
{
|
||||
red_pix = green_pix = blue_pix = GRAY_PIX;
|
||||
alpha_pix = ALPHA_G_PIX;
|
||||
red_pix = green_pix = blue_pix = GRAY;
|
||||
alpha_pix = ALPHA_G;
|
||||
}
|
||||
|
||||
has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
|
||||
|
@ -3204,12 +3204,12 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
|
|||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
goto next_pixel;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3307,7 +3307,7 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
|
|||
}
|
||||
|
||||
/* Now emit the colormap index for this cell, barfbarf */
|
||||
index_used_count[dest[INDEXED_PIX] = pixval1]++;
|
||||
index_used_count[dest[INDEXED] = pixval1]++;
|
||||
|
||||
next_pixel:
|
||||
|
||||
|
@ -3335,10 +3335,10 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
|
|||
gboolean has_alpha;
|
||||
gboolean alpha_dither = quantobj->want_alpha_dither;
|
||||
gpointer pr;
|
||||
gint red_pix = RED_PIX;
|
||||
gint green_pix = GREEN_PIX;
|
||||
gint blue_pix = BLUE_PIX;
|
||||
gint alpha_pix = ALPHA_PIX;
|
||||
gint red_pix = RED;
|
||||
gint green_pix = GREEN;
|
||||
gint blue_pix = BLUE;
|
||||
gint alpha_pix = ALPHA;
|
||||
gint i;
|
||||
gint lastindex = 0;
|
||||
gint lastred = -1;
|
||||
|
@ -3397,9 +3397,9 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
|
|||
(lastblue == src[blue_pix]))
|
||||
{
|
||||
/* same pixel colour as last time */
|
||||
dest[INDEXED_PIX] = lastindex;
|
||||
dest[INDEXED] = lastindex;
|
||||
if (has_alpha)
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3423,14 +3423,14 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
|
|||
g_error ("Non-existant colour was expected to "
|
||||
"be in non-destructive colourmap.");
|
||||
got_colour:
|
||||
dest[INDEXED_PIX] = lastindex;
|
||||
dest[INDEXED] = lastindex;
|
||||
if (has_alpha)
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* have alpha, and transparent */
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
}
|
||||
|
||||
src += srcPR.bytes;
|
||||
|
@ -3630,7 +3630,7 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
|
|||
|
||||
for (col = 0; col < width; col++)
|
||||
{
|
||||
pixel = range_limiter[src[GRAY_PIX] + error_limiter[*pr]];
|
||||
pixel = range_limiter[src[GRAY] + error_limiter[*pr]];
|
||||
|
||||
cachep = &histogram[pixel];
|
||||
/* If we have not seen this color before, find nearest colormap entry */
|
||||
|
@ -3649,18 +3649,18 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
|
|||
gint dither_x = ((width-col)+offsetx-1) & DM_WIDTHMASK;
|
||||
gint dither_y = (row+offsety) & DM_HEIGHTMASK;
|
||||
|
||||
if ((src[ALPHA_G_PIX]) < DM[dither_x][dither_y])
|
||||
if ((src[ALPHA_G]) < DM[dither_x][dither_y])
|
||||
transparent = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (src[ALPHA_G_PIX] <= 127)
|
||||
if (src[ALPHA_G] <= 127)
|
||||
transparent = TRUE;
|
||||
}
|
||||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
pr--;
|
||||
nr--;
|
||||
*(nr - 1) = 0;
|
||||
|
@ -3668,7 +3668,7 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
|
|||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3678,18 +3678,18 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
|
|||
gint dither_x = (col+offsetx) & DM_WIDTHMASK;
|
||||
gint dither_y = (row+offsety) & DM_HEIGHTMASK;
|
||||
|
||||
if ((src[ALPHA_G_PIX]) < DM[dither_x][dither_y])
|
||||
if ((src[ALPHA_G]) < DM[dither_x][dither_y])
|
||||
transparent = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (src[ALPHA_G_PIX] <= 127)
|
||||
if (src[ALPHA_G] <= 127)
|
||||
transparent = TRUE;
|
||||
}
|
||||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
pr++;
|
||||
nr++;
|
||||
*(nr + 1) = 0;
|
||||
|
@ -3697,13 +3697,13 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
|
|||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
index = *cachep - 1;
|
||||
index_used_count[dest[INDEXED_PIX] = index]++;
|
||||
index_used_count[dest[INDEXED] = index]++;
|
||||
|
||||
color = &quantobj->cmap[index];
|
||||
pixele = pixel - color->red;
|
||||
|
@ -3807,10 +3807,10 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
gint odd_row;
|
||||
gboolean has_alpha;
|
||||
gint width, height;
|
||||
gint red_pix = RED_PIX;
|
||||
gint green_pix = GREEN_PIX;
|
||||
gint blue_pix = BLUE_PIX;
|
||||
gint alpha_pix = ALPHA_PIX;
|
||||
gint red_pix = RED;
|
||||
gint green_pix = GREEN;
|
||||
gint blue_pix = BLUE;
|
||||
gint alpha_pix = ALPHA;
|
||||
gint offsetx, offsety;
|
||||
gboolean alpha_dither = quantobj->want_alpha_dither;
|
||||
gulong *index_used_count = quantobj->index_used_count;
|
||||
|
@ -3826,7 +3826,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
* grayscale drawables through the rgb pass2 functions
|
||||
*/
|
||||
if (gimp_drawable_is_gray (GIMP_DRAWABLE (layer)))
|
||||
red_pix = green_pix = blue_pix = GRAY_PIX;
|
||||
red_pix = green_pix = blue_pix = GRAY;
|
||||
|
||||
has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
|
||||
|
||||
|
@ -3944,7 +3944,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
rpr--; gpr--; bpr--;
|
||||
rnr--; gnr--; bnr--;
|
||||
*(rnr - 1) = *(gnr - 1) = *(bnr - 1) = 0;
|
||||
|
@ -3952,7 +3952,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3973,7 +3973,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
|
||||
if (transparent)
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 0;
|
||||
dest[ALPHA_I] = 0;
|
||||
rpr++; gpr++; bpr++;
|
||||
rnr++; gnr++; bnr++;
|
||||
*(rnr + 1) = *(gnr + 1) = *(bnr + 1) = 0;
|
||||
|
@ -3981,7 +3981,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
}
|
||||
else
|
||||
{
|
||||
dest[ALPHA_I_PIX] = 255;
|
||||
dest[ALPHA_I] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4025,7 +4025,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
|||
|
||||
index = *cachep - 1;
|
||||
index_used_count[index]++;
|
||||
dest[INDEXED_PIX] = index;
|
||||
dest[INDEXED] = index;
|
||||
|
||||
/*if (re > global_rmax)
|
||||
re = (re + 3*global_rmax) / 4;
|
||||
|
|
|
@ -1661,17 +1661,17 @@ gimp_image_get_component_index (const GimpImage *image,
|
|||
|
||||
switch (channel)
|
||||
{
|
||||
case GIMP_RED_CHANNEL: return RED_PIX;
|
||||
case GIMP_GREEN_CHANNEL: return GREEN_PIX;
|
||||
case GIMP_BLUE_CHANNEL: return BLUE_PIX;
|
||||
case GIMP_GRAY_CHANNEL: return GRAY_PIX;
|
||||
case GIMP_INDEXED_CHANNEL: return INDEXED_PIX;
|
||||
case GIMP_RED_CHANNEL: return RED;
|
||||
case GIMP_GREEN_CHANNEL: return GREEN;
|
||||
case GIMP_BLUE_CHANNEL: return BLUE;
|
||||
case GIMP_GRAY_CHANNEL: return GRAY;
|
||||
case GIMP_INDEXED_CHANNEL: return INDEXED;
|
||||
case GIMP_ALPHA_CHANNEL:
|
||||
switch (gimp_image_base_type (image))
|
||||
{
|
||||
case GIMP_RGB: return ALPHA_PIX;
|
||||
case GIMP_GRAY: return ALPHA_G_PIX;
|
||||
case GIMP_INDEXED: return ALPHA_I_PIX;
|
||||
case GIMP_RGB: return ALPHA;
|
||||
case GIMP_GRAY: return ALPHA_G;
|
||||
case GIMP_INDEXED: return ALPHA_I;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2220,18 +2220,18 @@ gimp_image_transform_color (const GimpImage *dest_image,
|
|||
case GIMP_GRAY_IMAGE:
|
||||
case GIMP_GRAYA_IMAGE:
|
||||
/* NTSC conversion */
|
||||
*dest = GIMP_RGB_LUMINANCE (src[RED_PIX],
|
||||
src[GREEN_PIX],
|
||||
src[BLUE_PIX]) + 0.5;
|
||||
*dest = GIMP_RGB_LUMINANCE (src[RED],
|
||||
src[GREEN],
|
||||
src[BLUE]) + 0.5;
|
||||
break;
|
||||
|
||||
case GIMP_INDEXED_IMAGE:
|
||||
case GIMP_INDEXEDA_IMAGE:
|
||||
/* Least squares method */
|
||||
*dest = gimp_image_color_hash_rgb_to_indexed (dest_image,
|
||||
src[RED_PIX],
|
||||
src[GREEN_PIX],
|
||||
src[BLUE_PIX]);
|
||||
src[RED],
|
||||
src[GREEN],
|
||||
src[BLUE]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -2257,9 +2257,9 @@ gimp_image_transform_color (const GimpImage *dest_image,
|
|||
case GIMP_INDEXEDA_IMAGE:
|
||||
/* Least squares method */
|
||||
*dest = gimp_image_color_hash_rgb_to_indexed (dest_image,
|
||||
src[GRAY_PIX],
|
||||
src[GRAY_PIX],
|
||||
src[GRAY_PIX]);
|
||||
src[GRAY],
|
||||
src[GRAY],
|
||||
src[GRAY]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -323,7 +323,7 @@ gimp_palette_import_extract (GimpImage *image,
|
|||
gimp_image_get_color (image, type, idata, rgba);
|
||||
|
||||
/* ignore completely transparent pixels */
|
||||
if (rgba[ALPHA_PIX])
|
||||
if (rgba[ALPHA])
|
||||
{
|
||||
guchar rgb_real[MAX_CHANNELS];
|
||||
|
||||
|
|
|
@ -227,16 +227,16 @@ gimp_pickable_pick_color (GimpPickable *pickable,
|
|||
|
||||
gimp_image_get_color (image, type, pixel, col);
|
||||
|
||||
color_avg[RED_PIX] += col[RED_PIX];
|
||||
color_avg[GREEN_PIX] += col[GREEN_PIX];
|
||||
color_avg[BLUE_PIX] += col[BLUE_PIX];
|
||||
color_avg[ALPHA_PIX] += col[ALPHA_PIX];
|
||||
color_avg[RED] += col[RED];
|
||||
color_avg[GREEN] += col[GREEN];
|
||||
color_avg[BLUE] += col[BLUE];
|
||||
color_avg[ALPHA] += col[ALPHA];
|
||||
}
|
||||
|
||||
col[RED_PIX] = (guchar) ((color_avg[RED_PIX] + count / 2) / count);
|
||||
col[GREEN_PIX] = (guchar) ((color_avg[GREEN_PIX] + count / 2) / count);
|
||||
col[BLUE_PIX] = (guchar) ((color_avg[BLUE_PIX] + count / 2) / count);
|
||||
col[ALPHA_PIX] = (guchar) ((color_avg[ALPHA_PIX] + count / 2) / count);
|
||||
col[RED] = (guchar) ((color_avg[RED] + count / 2) / count);
|
||||
col[GREEN] = (guchar) ((color_avg[GREEN] + count / 2) / count);
|
||||
col[BLUE] = (guchar) ((color_avg[BLUE] + count / 2) / count);
|
||||
col[ALPHA] = (guchar) ((color_avg[ALPHA] + count / 2) / count);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -245,10 +245,10 @@ gimp_pickable_pick_color (GimpPickable *pickable,
|
|||
|
||||
|
||||
gimp_rgba_set_uchar (color,
|
||||
col[RED_PIX],
|
||||
col[GREEN_PIX],
|
||||
col[BLUE_PIX],
|
||||
col[ALPHA_PIX]);
|
||||
col[RED],
|
||||
col[GREEN],
|
||||
col[BLUE],
|
||||
col[ALPHA]);
|
||||
|
||||
if (color_index)
|
||||
{
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_anti_erase_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_behind_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_burn_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -129,9 +129,9 @@ gimp_operation_color_balance_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
gfloat r = src[RED_PIX];
|
||||
gfloat g = src[GREEN_PIX];
|
||||
gfloat b = src[BLUE_PIX];
|
||||
gfloat r = src[RED];
|
||||
gfloat g = src[GREEN];
|
||||
gfloat b = src[BLUE];
|
||||
gfloat r_n;
|
||||
gfloat g_n;
|
||||
gfloat b_n;
|
||||
|
@ -176,10 +176,10 @@ gimp_operation_color_balance_process (GeglOperation *operation,
|
|||
b_n = rgb.b;
|
||||
}
|
||||
|
||||
dest[RED_PIX] = r_n;
|
||||
dest[GREEN_PIX] = g_n;
|
||||
dest[BLUE_PIX] = b_n;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = r_n;
|
||||
dest[GREEN] = g_n;
|
||||
dest[BLUE] = b_n;
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_color_erase_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -97,9 +97,9 @@ gimp_operation_colorize_process (GeglOperation *operation,
|
|||
while (samples--)
|
||||
{
|
||||
GimpRGB rgb;
|
||||
gfloat lum = GIMP_RGB_LUMINANCE (src[RED_PIX],
|
||||
src[GREEN_PIX],
|
||||
src[BLUE_PIX]);
|
||||
gfloat lum = GIMP_RGB_LUMINANCE (src[RED],
|
||||
src[GREEN],
|
||||
src[BLUE]);
|
||||
|
||||
if (config->lightness > 0)
|
||||
{
|
||||
|
@ -121,10 +121,10 @@ gimp_operation_colorize_process (GeglOperation *operation,
|
|||
* don't repeat this bug here (this is the reason why the gegl
|
||||
* colorize is brighter than the legacy one).
|
||||
*/
|
||||
dest[RED_PIX] = rgb.r; /* * lum; */
|
||||
dest[GREEN_PIX] = rgb.g; /* * lum; */
|
||||
dest[BLUE_PIX] = rgb.b; /* * lum */;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = rgb.r; /* * lum; */
|
||||
dest[GREEN] = rgb.g; /* * lum; */
|
||||
dest[BLUE] = rgb.b; /* * lum */;
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_color_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_darken_only_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_difference_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_dissolve_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_divide_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_dodge_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_erase_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_grain_extract_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_grain_merge_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_hardlight_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_hue_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -154,9 +154,9 @@ gimp_operation_hue_saturation_process (GeglOperation *operation,
|
|||
gfloat primary_intensity = 0.0;
|
||||
gfloat secondary_intensity = 0.0;
|
||||
|
||||
rgb.r = src[RED_PIX];
|
||||
rgb.g = src[GREEN_PIX];
|
||||
rgb.b = src[BLUE_PIX];
|
||||
rgb.r = src[RED];
|
||||
rgb.g = src[GREEN];
|
||||
rgb.b = src[BLUE];
|
||||
|
||||
gimp_rgb_to_hsl (&rgb, &hsl);
|
||||
|
||||
|
@ -245,10 +245,10 @@ gimp_operation_hue_saturation_process (GeglOperation *operation,
|
|||
|
||||
gimp_hsl_to_rgb (&hsl, &rgb);
|
||||
|
||||
dest[RED_PIX] = rgb.r;
|
||||
dest[GREEN_PIX] = rgb.g;
|
||||
dest[BLUE_PIX] = rgb.b;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = rgb.r;
|
||||
dest[GREEN] = rgb.g;
|
||||
dest[BLUE] = rgb.b;
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
|
|
|
@ -145,7 +145,7 @@ gimp_operation_levels_process (GeglOperation *operation,
|
|||
config->high_output[channel + 1]);
|
||||
|
||||
/* don't apply the overall curve to the alpha channel */
|
||||
if (channel != ALPHA_PIX)
|
||||
if (channel != ALPHA)
|
||||
value = gimp_operation_levels_map (value,
|
||||
inv_gamma[0],
|
||||
config->low_input[0],
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_lighten_only_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_multiply_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_overlay_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -96,10 +96,10 @@ gimp_operation_posterize_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = RINT (src[RED_PIX] * levels) / levels;
|
||||
dest[GREEN_PIX] = RINT (src[GREEN_PIX] * levels) / levels;
|
||||
dest[BLUE_PIX] = RINT (src[BLUE_PIX] * levels) / levels;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = RINT (src[RED] * levels) / levels;
|
||||
dest[GREEN] = RINT (src[GREEN] * levels) / levels;
|
||||
dest[BLUE] = RINT (src[BLUE] * levels) / levels;
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_replace_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_saturation_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_screen_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_softlight_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_subtract_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -94,15 +94,15 @@ gimp_operation_threshold_process (GeglOperation *operation,
|
|||
{
|
||||
gfloat value;
|
||||
|
||||
value = MAX (src[RED_PIX], src[GREEN_PIX]);
|
||||
value = MAX (value, src[BLUE_PIX]);
|
||||
value = MAX (src[RED], src[GREEN]);
|
||||
value = MAX (value, src[BLUE]);
|
||||
|
||||
value = (value >= config->low && value <= config->high) ? 1.0 : 0.0;
|
||||
|
||||
dest[RED_PIX] = value;
|
||||
dest[GREEN_PIX] = value;
|
||||
dest[BLUE_PIX] = value;
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = value;
|
||||
dest[GREEN] = value;
|
||||
dest[BLUE] = value;
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
dest += 4;
|
||||
|
|
|
@ -71,10 +71,10 @@ gimp_operation_value_mode_process (GeglOperation *operation,
|
|||
|
||||
while (samples--)
|
||||
{
|
||||
dest[RED_PIX] = src[RED_PIX];
|
||||
dest[GREEN_PIX] = src[GREEN_PIX];
|
||||
dest[BLUE_PIX] = src[BLUE_PIX];
|
||||
dest[ALPHA_PIX] = src[ALPHA_PIX];
|
||||
dest[RED] = src[RED];
|
||||
dest[GREEN] = src[GREEN];
|
||||
dest[BLUE] = src[BLUE];
|
||||
dest[ALPHA] = src[ALPHA];
|
||||
|
||||
src += 4;
|
||||
aux += 4;
|
||||
|
|
|
@ -343,21 +343,21 @@ subsample_indexed_region (PixelRegion *srcPR,
|
|||
/* transform the color to RGB */
|
||||
if (has_alpha)
|
||||
{
|
||||
if (s[ALPHA_I_PIX] & 0x80)
|
||||
if (s[ALPHA_I] & 0x80)
|
||||
{
|
||||
r[RED_PIX] += cmap[index++] * tot_frac;
|
||||
r[GREEN_PIX] += cmap[index++] * tot_frac;
|
||||
r[BLUE_PIX] += cmap[index++] * tot_frac;
|
||||
r[ALPHA_PIX] += tot_frac;
|
||||
r[RED] += cmap[index++] * tot_frac;
|
||||
r[GREEN] += cmap[index++] * tot_frac;
|
||||
r[BLUE] += cmap[index++] * tot_frac;
|
||||
r[ALPHA] += tot_frac;
|
||||
}
|
||||
/* else the pixel contributes nothing and needs not to be added
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
r[RED_PIX] += cmap[index++] * tot_frac;
|
||||
r[GREEN_PIX] += cmap[index++] * tot_frac;
|
||||
r[BLUE_PIX] += cmap[index++] * tot_frac;
|
||||
r[RED] += cmap[index++] * tot_frac;
|
||||
r[GREEN] += cmap[index++] * tot_frac;
|
||||
r[BLUE] += cmap[index++] * tot_frac;
|
||||
}
|
||||
|
||||
/* increment the destination */
|
||||
|
|
|
@ -282,7 +282,7 @@ gimp_clone_line_image (GimpImage *dest_image,
|
|||
gimp_image_transform_color (dest_image, dest_type, d,
|
||||
GIMP_RGB, rgba);
|
||||
|
||||
d[alpha] = rgba[ALPHA_PIX];
|
||||
d[alpha] = rgba[ALPHA];
|
||||
|
||||
s += src_bytes;
|
||||
d += dest_bytes;
|
||||
|
|
|
@ -140,10 +140,10 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
|
|||
opacity *= gradient_color.a;
|
||||
|
||||
gimp_rgb_get_uchar (&gradient_color,
|
||||
&col[RED_PIX],
|
||||
&col[GREEN_PIX],
|
||||
&col[BLUE_PIX]);
|
||||
col[ALPHA_PIX] = OPAQUE_OPACITY;
|
||||
&col[RED],
|
||||
&col[GREEN],
|
||||
&col[BLUE]);
|
||||
col[ALPHA] = OPAQUE_OPACITY;
|
||||
|
||||
color_pixels (temp_buf_data (area), col,
|
||||
area->width * area->height,
|
||||
|
|
|
@ -960,17 +960,17 @@ gimp_view_render_to_surface (TempBuf *temp_buf,
|
|||
{
|
||||
if (color)
|
||||
{
|
||||
red_component = RED_PIX;
|
||||
green_component = GREEN_PIX;
|
||||
blue_component = BLUE_PIX;
|
||||
alpha_component = ALPHA_PIX;
|
||||
red_component = RED;
|
||||
green_component = GREEN;
|
||||
blue_component = BLUE;
|
||||
alpha_component = ALPHA;
|
||||
}
|
||||
else
|
||||
{
|
||||
red_component = GRAY_PIX;
|
||||
green_component = GRAY_PIX;
|
||||
blue_component = GRAY_PIX;
|
||||
alpha_component = ALPHA_G_PIX;
|
||||
red_component = GRAY;
|
||||
green_component = GRAY;
|
||||
blue_component = GRAY;
|
||||
alpha_component = ALPHA_G;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue