app/paint-funcs/paint-funcs-generic.h app/paint-funcs/paint-funcs.c

2001-11-27  Daniel Egger  <degger@fhm.edu>

	* app/paint-funcs/paint-funcs-generic.h
	* app/paint-funcs/paint-funcs.c
	* app/paint-funcs/paint-funcs.h: Unsignified lots of arguments
	and misc cleanups.
This commit is contained in:
Daniel Egger 2001-11-27 22:40:58 +00:00 committed by Daniel Egger
parent 653f6999e1
commit 7933764758
4 changed files with 306 additions and 298 deletions

View File

@ -1,3 +1,10 @@
2001-11-27 Daniel Egger <degger@fhm.edu>
* app/paint-funcs/paint-funcs-generic.h
* app/paint-funcs/paint-funcs.c
* app/paint-funcs/paint-funcs.h: Unsignified lots of arguments
and misc cleanups.
2001-11-27 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am

View File

@ -71,8 +71,8 @@ static gint random_table[RANDOM_TABLE_SIZE];
void
color_pixels (guchar *dest,
const guchar *color,
gint w,
gint bytes)
guint w,
guint bytes)
{
/* dest % bytes and color % bytes must be 0 or we will crash
when bytes = 2 or 4.
@ -81,11 +81,11 @@ color_pixels (guchar *dest,
*/
#if defined(sparc) || defined(__sparc__)
register guchar c0, c1, c2, c3;
guchar c0, c1, c2, c3;
#else
register guchar c0, c1, c2;
register guint32 *longd, longc;
register guint16 *shortd, shortc;
guchar c0, c1, c2;
guint32 *longd, longc;
guint16 *shortd, shortc;
#endif
switch (bytes)
@ -114,6 +114,7 @@ color_pixels (guchar *dest,
}
#endif /* sparc || __sparc__ */
break;
case 3:
c0 = color[0];
c1 = color[1];
@ -126,6 +127,7 @@ color_pixels (guchar *dest,
dest += 3;
}
break;
case 4:
#if defined(sparc) || defined(__sparc__)
c0 = color[0];
@ -150,6 +152,7 @@ color_pixels (guchar *dest,
}
#endif /* sparc || __sparc__ */
break;
default:
while (w--)
{
@ -164,15 +167,15 @@ inline void
blend_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
gint blend,
gint w,
gint bytes,
gint has_alpha)
guchar blend,
guint w,
guint bytes,
guint has_alpha)
{
gint b;
guchar blend2 = (255 - blend);
guint b;
const guchar blend2 = (255 - blend);
while (w --)
while (w--)
{
for (b = 0; b < bytes; b++)
dest[b] = (src1[b] * blend2 + src2[b] * blend) / 255;
@ -188,16 +191,16 @@ inline void
shade_pixels (const guchar *src,
guchar *dest,
const guchar *col,
gint blend,
gint w,
gint bytes,
gint has_alpha)
guchar blend,
guint w,
guint bytes,
guint has_alpha)
{
gint alpha, b;
guchar blend2 = (255 - blend);
const guchar blend2 = (255 - blend);
const guint alpha = (has_alpha) ? bytes - 1 : bytes;
guint b;
alpha = (has_alpha) ? bytes - 1 : bytes;
while (w --)
while (w--)
{
for (b = 0; b < alpha; b++)
dest[b] = (src[b] * blend2 + col[b] * blend) / 255;
@ -215,18 +218,16 @@ inline void
extract_alpha_pixels (const guchar *src,
const guchar *mask,
guchar *dest,
gint w,
gint bytes)
guint w,
guint bytes)
{
const guchar *m;
const guint alpha = bytes - 1;
gint tmp;
const gint alpha = bytes - 1;
if (mask)
{
m = mask;
while (w --)
const guchar *m = mask;
while (w--)
{
*dest++ = INT_MULT(src[alpha], *m, tmp);
m++;
@ -235,10 +236,9 @@ extract_alpha_pixels (const guchar *src,
}
else
{
m = &no_mask;
while (w --)
while (w--)
{
*dest++ = INT_MULT(src[alpha], *m, tmp);
*dest++ = INT_MULT(src[alpha], OPAQUE_OPACITY, tmp);
src += bytes;
}
}
@ -365,8 +365,8 @@ saturation_only_pixels (const guchar *src1,
{
const guint has_alpha1 = HAS_ALPHA (bytes1);
const guint has_alpha2 = HAS_ALPHA (bytes2);
gint r1, g1, b1;
gint r2, g2, b2;
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
@ -405,8 +405,8 @@ value_only_pixels (const guchar *src1,
{
const guint has_alpha1 = HAS_ALPHA (bytes1);
const guint has_alpha2 = HAS_ALPHA (bytes2);
gint r1, g1, b1;
gint r2, g2, b2;
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
@ -445,8 +445,8 @@ color_only_pixels (const guchar *src1,
{
const guint has_alpha1 = HAS_ALPHA (bytes1);
const guint has_alpha2 = HAS_ALPHA (bytes2);
gint r1, g1, b1;
gint r2, g2, b2;
guint r1, g1, b1;
guint r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pixels */
while (length--)
@ -546,7 +546,7 @@ divide_pixels (const guchar *src1,
const guint alpha = (has_alpha1 || has_alpha2) ? MAX (bytes1, bytes2) - 1 : bytes1;
guint b, result;
while (length --)
while (length--)
{
for (b = 0; b < alpha; b++)
{
@ -997,7 +997,7 @@ replace_pixels (guchar *src1,
inline void
swap_pixels (guchar *src,
guchar *dest,
gint length)
guint length)
{
while (length--)
{
@ -1012,7 +1012,7 @@ swap_pixels (guchar *src,
inline void
scale_pixels (const guchar *src,
guchar *dest,
gint length,
guint length,
gint scale)
{
gint tmp;
@ -1027,8 +1027,8 @@ scale_pixels (const guchar *src,
inline void
add_alpha_pixels (const guchar *src,
guchar *dest,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
@ -1051,8 +1051,8 @@ inline void
flatten_pixels (const guchar *src,
guchar *dest,
const guchar *bg,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
gint t1, t2;
@ -1073,8 +1073,8 @@ flatten_pixels (const guchar *src,
inline void
gray_to_rgb_pixels (const guchar *src,
guchar *dest,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint b;
gint dest_bytes;
@ -1100,9 +1100,9 @@ gray_to_rgb_pixels (const guchar *src,
inline void
apply_mask_to_alpha_channel (guchar *src,
const guchar *mask,
gint opacity,
gint length,
gint bytes)
guint opacity,
guint length,
guint bytes)
{
glong tmp;
@ -1132,9 +1132,9 @@ apply_mask_to_alpha_channel (guchar *src,
inline void
combine_mask_and_alpha_channel (guchar *src,
const guchar *mask,
gint opacity,
gint length,
gint bytes)
guint opacity,
guint length,
guint bytes)
{
gint mask_val;
gint alpha;
@ -1164,8 +1164,8 @@ combine_mask_and_alpha_channel (guchar *src,
inline void
copy_gray_to_inten_a_pixels (const guchar *src,
guchar *dest,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint b;
gint alpha;
@ -1187,8 +1187,8 @@ copy_gray_to_inten_a_pixels (const guchar *src,
inline void
initial_channel_pixels (const guchar *src,
guchar *dest,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
@ -1211,7 +1211,7 @@ inline void
initial_indexed_pixels (const guchar *src,
guchar *dest,
const guchar *cmap,
gint length)
guint length)
{
gint col_index;
@ -1234,8 +1234,8 @@ initial_indexed_a_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
const guchar *cmap,
gint opacity,
gint length)
guint opacity,
guint length)
{
gint col_index;
guchar new_alpha;
@ -1268,10 +1268,10 @@ inline void
initial_inten_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gint *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint b;
gint tmp;
@ -1430,10 +1430,10 @@ inline void
initial_inten_a_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
const guchar *m;

View File

@ -122,7 +122,7 @@ static LayerModeFunc layer_mode_funcs[] =
/* Local function prototypes */
static gint * make_curve (gdouble sigma,
gint *length);
guint *length);
static gdouble cubic (gdouble dx,
gint jm1,
gint j,
@ -134,10 +134,10 @@ static void apply_layer_mode_replace (guchar *src1,
guchar *mask,
gint x,
gint y,
gint opacity,
gint length,
gint bytes1,
gint bytes2,
guint opacity,
guint length,
guint bytes1,
guint bytes2,
gboolean *affect);
static void rotate_pointers (gpointer *p,
guint32 n);
@ -337,7 +337,7 @@ update_tile_rowhints (Tile *tile,
static gint *
make_curve (gdouble sigma,
gint *length)
guint *length)
{
gint *curve;
gdouble sigma2;
@ -466,10 +466,10 @@ combine_indexed_and_indexed_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint b;
guchar new_alpha;
@ -515,10 +515,10 @@ combine_indexed_and_indexed_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint b, alpha;
guchar new_alpha;
@ -568,10 +568,10 @@ combine_indexed_a_and_indexed_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
const guchar * m;
gint b, alpha;
@ -627,9 +627,9 @@ combine_inten_a_and_indexed_a_pixels (const guchar *src1,
guchar *dest,
const guchar *mask,
const guchar *cmap,
gint opacity,
gint length,
gint bytes)
guint opacity,
guint length,
guint bytes)
{
gint b, alpha;
guchar new_alpha;
@ -693,10 +693,10 @@ combine_inten_and_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
const guchar * m;
gint b;
@ -745,10 +745,10 @@ combine_inten_and_inten_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
gint src2_bytes;
@ -883,11 +883,11 @@ combine_inten_a_and_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
guint mode_affect, /* how does the combination mode affect alpha? */
gint length,
gint bytes) /* 4 or 2 depending on RGBA or GRAYA */
guint length,
guint bytes) /* 4 or 2 depending on RGBA or GRAYA */
{
gint alpha, b;
gint src2_bytes;
@ -981,23 +981,22 @@ combine_inten_a_and_inten_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
guint mode_affect, /* how does the combination mode affect alpha? */
gint length,
gint bytes) /* 4 or 2 depending on RGBA or GRAYA */
guint length,
guint bytes) /* 4 or 2 depending on RGBA or GRAYA */
{
gint b;
guint b;
guchar src2_alpha;
guchar new_alpha;
const guchar * m;
gfloat ratio, compl_ratio;
glong tmp;
const gint alpha = bytes - 1;
const guint alpha = bytes - 1;
if (mask)
{
m = mask;
const guchar * m = mask;
if (opacity == OPAQUE_OPACITY) /* HAS MASK, FULL OPACITY */
{
@ -1297,9 +1296,9 @@ combine_inten_a_and_channel_mask_pixels (const guchar *src,
const guchar *channel,
guchar *dest,
const guchar *col,
gint opacity,
gint length,
gint bytes)
guint opacity,
guint length,
guint bytes)
{
gint alpha, b;
guchar channel_alpha;
@ -1340,9 +1339,9 @@ combine_inten_a_and_channel_selection_pixels (const guchar *src,
const guchar *channel,
guchar *dest,
const guchar *col,
gint opacity,
gint length,
gint bytes)
guint opacity,
guint length,
guint bytes)
{
gint alpha, b;
guchar channel_alpha;
@ -1388,9 +1387,9 @@ behind_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
guint length,
guint bytes1,
guint bytes2)
{
@ -1707,10 +1706,10 @@ anti_erase_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
guchar src2_alpha;
@ -1746,10 +1745,10 @@ anti_erase_indexed_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha, b;
guchar src2_alpha;
@ -1850,10 +1849,10 @@ color_erase_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint opacity,
guint opacity,
const gboolean *affect,
gint length,
gint bytes)
guint length,
guint bytes)
{
gint alpha;
guchar src2_alpha;
@ -1906,10 +1905,10 @@ extract_from_inten_pixels (guchar *src,
guchar *dest,
const guchar *mask,
const guchar *bg,
gint cut,
gint length,
gint bytes,
gint has_alpha)
guint cut,
guint length,
guint bytes,
guint has_alpha)
{
gint b, alpha;
gint dest_bytes;
@ -1957,10 +1956,10 @@ extract_from_indexed_pixels (guchar *src,
const guchar *mask,
const guchar *cmap,
const guchar *bg,
gint cut,
gint length,
gint bytes,
gint has_alpha)
guint cut,
guint length,
guint bytes,
guint has_alpha)
{
gint b;
gint index;
@ -2001,7 +2000,7 @@ extract_from_indexed_pixels (guchar *src,
void
map_to_color (gint src_type,
map_to_color (guint src_type,
const guchar *cmap,
const guchar *src,
guchar *rgb)
@ -2261,9 +2260,9 @@ extract_from_region (PixelRegion *src,
PixelRegion *mask,
guchar *cmap,
guchar *bg,
gint type,
gint has_alpha,
gint cut)
guint type,
guint has_alpha,
guint cut)
{
gint h;
guchar *s, *d, *m;
@ -2509,7 +2508,7 @@ gaussian_blur_region (PixelRegion *srcR,
{
gdouble std_dev;
glong width, height;
gint bytes;
guint bytes;
guchar *src, *sp;
guchar *dest, *dp;
guchar *data;
@ -2787,8 +2786,8 @@ get_premultiplied_double_row (PixelRegion *srcPR,
static void
expand_line (gdouble *dest,
gdouble *src,
gint bytes,
gint old_width,
guint bytes,
guint old_width,
gint width,
InterpolationType interp)
{
@ -2840,7 +2839,7 @@ expand_line (gdouble *dest,
static void
shrink_line (gdouble *dest,
gdouble *src,
gint bytes,
guint bytes,
gint old_width,
gint width,
InterpolationType interp)
@ -4080,7 +4079,7 @@ apply_mask_to_sub_region (gint *opacityp,
void
apply_mask_to_region (PixelRegion *src,
PixelRegion *mask,
gint opacity)
guint opacity)
{
pixel_regions_process_parallel ((p_func)apply_mask_to_sub_region,
&opacity, 2, src, mask);
@ -4112,7 +4111,7 @@ combine_mask_and_sub_region (gint *opacityp,
void
combine_mask_and_region (PixelRegion *src,
PixelRegion *mask,
gint opacity)
guint opacity)
{
pixel_regions_process_parallel ((p_func)combine_mask_and_sub_region,
@ -4258,12 +4257,11 @@ initial_region (PixelRegion *src,
struct combine_regions_struct
{
gint opacity;
guint opacity;
LayerModeEffects mode;
gboolean *affect;
CombinationMode type;
guchar *data;
//gboolean has_alpha1, has_alpha2;
gboolean opacity_quickskip_possible;
gboolean transparency_quickskip_possible;
};
@ -4717,10 +4715,10 @@ apply_layer_mode_replace (guchar *src1,
guchar *mask,
gint x,
gint y,
gint opacity,
gint length,
gint bytes1,
gint bytes2,
guint opacity,
guint length,
guint bytes1,
guint bytes2,
gboolean *affect)
{
replace_pixels (src1, src2, dest, mask, length, opacity, affect, bytes1, bytes2);

View File

@ -27,48 +27,50 @@ void paint_funcs_free (void);
/* Paint functions */
void color_pixels (unsigned char *dest, const unsigned char *color,
int w, int bytes);
void color_pixels (guchar *dest, const guchar *color,
guint w, guint bytes);
void blend_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
int blend, int w, int bytes, int has_alpha);
void blend_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
guchar blend, guint w,
guint bytes, guint has_alpha);
void shade_pixels (const unsigned char *src, unsigned char *dest,
const unsigned char *color,
int blend, int w, int bytes, int has_alpha);
void shade_pixels (const guchar *src, guchar *dest,
const guchar *color,
guchar rblend, guint w,
guint bytes, guint has_alpha);
void extract_alpha_pixels (const unsigned char *src,
const unsigned char *mask,
unsigned char *dest,
int w, int bytes);
void extract_alpha_pixels (const guchar *src,
const guchar *mask,
guchar *dest,
guint w, guint bytes);
void swap_pixels (unsigned char *src, unsigned char *dest,
int length);
void swap_pixels (guchar *src, guchar *dest,
guint length);
void scale_pixels (const unsigned char *src, unsigned char *dest,
int length, int scale);
void scale_pixels (const guchar *src, guchar *dest,
guint length, int scale);
void add_alpha_pixels (const unsigned char *src, unsigned char *dest,
int length, int bytes);
void add_alpha_pixels (const guchar *src, guchar *dest,
guint length, guint bytes);
void flatten_pixels (const unsigned char *src, unsigned char *dest,
const unsigned char *bg, int length, int bytes);
void flatten_pixels (const guchar *src, guchar *dest,
const guchar *bg, guint length, guint bytes);
void gray_to_rgb_pixels (const unsigned char *src, unsigned char *dest,
int length, int bytes);
void gray_to_rgb_pixels (const guchar *src, guchar *dest,
guint length, guint bytes);
/* apply the mask data to the alpha channel of the pixel data */
void apply_mask_to_alpha_channel (unsigned char *src,
const unsigned char *mask,
int opacity, int length, int bytes);
void apply_mask_to_alpha_channel (guchar *src,
const guchar *mask,
guint opacity, guint length, guint bytes);
/* combine the mask data with the alpha channel of the pixel data */
void combine_mask_and_alpha_channel (unsigned char *src,
const unsigned char *mask,
int opacity, int length, int bytes);
void combine_mask_and_alpha_channel (guchar *src,
const guchar *mask,
guint opacity, guint length, guint bytes);
/* copy gray pixels to intensity-alpha pixels. This function
@ -76,190 +78,191 @@ void combine_mask_and_alpha_channel (unsigned char *src,
* copies it to the destination, expanding to RGB if necessary and
* adding an alpha channel. (OPAQUE)
*/
void copy_gray_to_inten_a_pixels (const unsigned char *src,
unsigned char *dest,
int length, int bytes);
void copy_gray_to_inten_a_pixels (const guchar *src,
guchar *dest,
guint length, guint bytes);
/* lay down the initial pixels in the case of only one
* channel being visible and no layers...In this singular
* case, we want to display a grayscale image w/o transparency
*/
void initial_channel_pixels (const unsigned char *src,
unsigned char *dest,
int length, int bytes);
void initial_channel_pixels (const guchar *src,
guchar *dest,
guint length, guint bytes);
/* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition
*/
void initial_indexed_pixels (const unsigned char *src,
unsigned char *dest,
const unsigned char *cmap,
int length);
void initial_indexed_pixels (const guchar *src,
guchar *dest,
const guchar *cmap,
guint length);
/* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition
*/
void initial_indexed_a_pixels (const unsigned char *src,
unsigned char *dest,
const unsigned char *mask,
const unsigned char *cmap,
int opacity, int length);
void initial_indexed_a_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
const guchar *cmap,
guint opacity, guint length);
/* lay down the initial pixels for the base layer.
* This process obviously requires no composition.
*/
void initial_inten_pixels (const unsigned char *src,
unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
void initial_inten_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
guint opacity, const int *affect,
guint length, guint bytes);
/* lay down the initial pixels for the base layer.
* This process obviously requires no composition.
*/
void initial_inten_a_pixels (const unsigned char *src,
unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
void initial_inten_a_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
guint opacity, const int *affect,
guint length, guint bytes);
/* combine indexed images with an optional mask which
* is interpreted as binary...destination is indexed...
*/
void combine_indexed_and_indexed_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
void combine_indexed_and_indexed_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity, const int *affect,
guint length, guint bytes);
/* combine indexed images with indexed-alpha images
* result is an indexed image
*/
void combine_indexed_and_indexed_a_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
void combine_indexed_and_indexed_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const int *affect,
guint length,
guint bytes);
/* combine indexed-alpha images with indexed-alpha images
* result is an indexed-alpha image. use this for painting
* to an indexed floating sel
*/
void combine_indexed_a_and_indexed_a_pixels(const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity,
void combine_indexed_a_and_indexed_a_pixels(const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const int *affect,
int length,
int bytes);
guint length,
guint bytes);
/* combine intensity with indexed, destination is
* intensity-alpha...use this for an indexed floating sel
*/
void combine_inten_a_and_indexed_a_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
const unsigned char *cmap,
int opacity,
int length,
int bytes);
void combine_inten_a_and_indexed_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
const guchar *cmap,
guint opacity,
guint length,
guint bytes);
/* combine RGB image with RGB or GRAY with GRAY
* destination is intensity-only...
*/
void combine_inten_and_inten_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
void combine_inten_and_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const gboolean *affect,
guint length,
guint bytes);
/* combine an RGBA or GRAYA image with an RGB or GRAY image
* destination is intensity-only...
*/
void combine_inten_and_inten_a_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
void combine_inten_and_inten_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const gboolean *affect,
guint length, guint bytes);
/* combine an RGB or GRAY image with an RGBA or GRAYA image
* destination is intensity-alpha...
*/
void combine_inten_a_and_inten_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
guint mode_affect, int length,
int bytes);
void combine_inten_a_and_inten_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity, const int *affect,
guint mode_affect, guint length,
guint bytes);
/* combine an RGBA or GRAYA image with an RGBA or GRAYA image
* destination is of course intensity-alpha...
*/
void combine_inten_a_and_inten_a_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
guint mode_affect,
int length,
int bytes);
void combine_inten_a_and_inten_a_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const gboolean *affect,
guint mode_affect,
guint length,
guint bytes);
/* combine a channel with intensity-alpha pixels based
* on some opacity, and a channel color...
* destination is intensity-alpha
*/
void combine_inten_a_and_channel_mask_pixels(const unsigned char *src,
const unsigned char *channel,
unsigned char *dest,
const unsigned char *col,
int opacity,
int length,
int bytes);
void combine_inten_a_and_channel_mask_pixels(const guchar *src,
const guchar *channel,
guchar *dest,
const guchar *col,
guint opacity,
guint length,
guint bytes);
void combine_inten_a_and_channel_selection_pixels(const unsigned char *src,
const unsigned char *channel,
unsigned char *dest,
const unsigned char *col,
int opacity,
int length,
int bytes);
void combine_inten_a_and_channel_selection_pixels(const guchar *src,
const guchar *channel,
guchar *dest,
const guchar *col,
guint opacity,
guint length,
guint bytes);
/* extract information from intensity pixels based on
* a mask.
*/
void extract_from_inten_pixels (unsigned char *src,
unsigned char *dest,
const unsigned char *mask,
const unsigned char *bg,
int cut,
int length,
int bytes,
int has_alpha);
void extract_from_inten_pixels (guchar *src,
guchar *dest,
const guchar *mask,
const guchar *bg,
guint cut,
guint length,
guint bytes,
guint has_alpha);
/* extract information from indexed pixels based on
* a mask.
*/
void extract_from_indexed_pixels (unsigned char *src,
unsigned char *dest,
const unsigned char *mask,
const unsigned char *cmap,
const unsigned char *bg,
int cut,
int length,
int bytes,
int has_alpha);
void extract_from_indexed_pixels (guchar *src,
guchar *dest,
const guchar *mask,
const guchar *cmap,
const guchar *bg,
guint cut,
guint length,
guint bytes,
guint has_alpha);
/* variable source to RGB color mapping
@ -267,35 +270,35 @@ void extract_from_indexed_pixels (unsigned char *src,
* src_type == 1 (GRAY)
* src_type == 2 (INDEXED)
*/
void map_to_color (int src_type,
const unsigned char *cmap,
const unsigned char *src,
unsigned char *rgb);
void map_to_color (guint src_type,
const guchar *cmap,
const guchar *src,
guchar *rgb);
/* Region functions */
void color_region (PixelRegion *dest,
const unsigned char *color);
const guchar *color);
void blend_region (PixelRegion *, PixelRegion *,
PixelRegion *, int);
void shade_region (PixelRegion *, PixelRegion *,
unsigned char *, int);
guchar *, int);
void copy_region (PixelRegion *, PixelRegion *);
void add_alpha_region (PixelRegion *, PixelRegion *);
void flatten_region (PixelRegion *, PixelRegion *,
unsigned char *);
guchar *);
void extract_alpha_region (PixelRegion *, PixelRegion *,
PixelRegion *);
void extract_from_region (PixelRegion *, PixelRegion *,
PixelRegion *, unsigned char *,
unsigned char *, int, int, int);
PixelRegion *, guchar *,
guchar *, guint, guint, guint);
void convolve_region (PixelRegion *,
@ -330,10 +333,10 @@ void swap_region (PixelRegion *, PixelRegion *);
/* Apply a mask to an image's alpha channel */
void apply_mask_to_region (PixelRegion *, PixelRegion *, int);
void apply_mask_to_region (PixelRegion *, PixelRegion *, guint);
/* Combine a mask with an image's alpha channel */
void combine_mask_and_region (PixelRegion *, PixelRegion *, int);
void combine_mask_and_region (PixelRegion *, PixelRegion *, guint);
/* Copy a gray image to an intensity-alpha region */
void copy_gray_to_region (PixelRegion *, PixelRegion *);
@ -388,19 +391,19 @@ typedef enum /*< skip >*/
#define OPAQUE_OPACITY 255
void initial_region (PixelRegion *, PixelRegion *,
PixelRegion *, unsigned char *,
PixelRegion *, guchar *,
int, LayerModeEffects, int *,
CombinationMode);
void combine_regions (PixelRegion *, PixelRegion *,
PixelRegion *, PixelRegion *,
unsigned char *, guint,
guchar *, guint,
LayerModeEffects,
int *, CombinationMode);
void combine_regions_replace (PixelRegion *, PixelRegion *,
PixelRegion *, PixelRegion *,
unsigned char *,
guchar *,
guint, int *, CombinationMode);
#endif /* __PAINT_FUNCS_H__ */