Modified Files: ChangeLog app/gimpbrushgenerated.c

Modified Files:
 	ChangeLog app/gimpbrushgenerated.c app/gimpbrushgenerated.h
 	app/paint_funcs.c app/paint_funcs.h

  Constification
This commit is contained in:
jaycox 1998-09-15 01:53:40 +00:00
parent 28c14528e7
commit f0b060c2d3
11 changed files with 1426 additions and 1112 deletions

View File

@ -1,3 +1,9 @@
Mon Sep 14 18:51:54 1998 Jay Cox (jaycox@earthlink.net)
* app/gimpbrushgenerated.c app/gimpbrushgenerated.h
* app/paint_funcs.c app/paint_funcs.h:
Made function parameters const where appropriate
Fri Sep 11 11:15:17 EDT 1998 Adrian Likins <adrian@gimp.org> Fri Sep 11 11:15:17 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/file_new_dialog.c: fixed a typo that wouldnt let * app/file_new_dialog.c: fixed a typo that wouldnt let

View File

@ -101,7 +101,7 @@ GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness,
} }
GimpBrushGenerated * GimpBrushGenerated *
gimp_brush_generated_load (char *file_name) gimp_brush_generated_load (const char *file_name)
{ {
GimpBrushGenerated *brush; GimpBrushGenerated *brush;
FILE *fp; FILE *fp;
@ -154,7 +154,7 @@ gimp_brush_generated_load (char *file_name)
void void
gimp_brush_generated_save (GimpBrushGenerated *brush, gimp_brush_generated_save (GimpBrushGenerated *brush,
char *file_name) const char *file_name)
{ {
/* WARNING: untested function */ /* WARNING: untested function */
FILE *fp; FILE *fp;
@ -397,28 +397,28 @@ gimp_brush_generated_set_aspect_ratio (GimpBrushGenerated* brush, float ratio)
} }
float float
gimp_brush_generated_get_radius (GimpBrushGenerated* brush) gimp_brush_generated_get_radius (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->radius; return brush->radius;
} }
float float
gimp_brush_generated_get_hardness (GimpBrushGenerated* brush) gimp_brush_generated_get_hardness (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->hardness; return brush->hardness;
} }
float float
gimp_brush_generated_get_angle (GimpBrushGenerated* brush) gimp_brush_generated_get_angle (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->angle; return brush->angle;
} }
float float
gimp_brush_generated_get_aspect_ratio (GimpBrushGenerated* brush) gimp_brush_generated_get_aspect_ratio (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->aspect_ratio; return brush->aspect_ratio;

View File

@ -101,7 +101,7 @@ GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness,
} }
GimpBrushGenerated * GimpBrushGenerated *
gimp_brush_generated_load (char *file_name) gimp_brush_generated_load (const char *file_name)
{ {
GimpBrushGenerated *brush; GimpBrushGenerated *brush;
FILE *fp; FILE *fp;
@ -154,7 +154,7 @@ gimp_brush_generated_load (char *file_name)
void void
gimp_brush_generated_save (GimpBrushGenerated *brush, gimp_brush_generated_save (GimpBrushGenerated *brush,
char *file_name) const char *file_name)
{ {
/* WARNING: untested function */ /* WARNING: untested function */
FILE *fp; FILE *fp;
@ -397,28 +397,28 @@ gimp_brush_generated_set_aspect_ratio (GimpBrushGenerated* brush, float ratio)
} }
float float
gimp_brush_generated_get_radius (GimpBrushGenerated* brush) gimp_brush_generated_get_radius (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->radius; return brush->radius;
} }
float float
gimp_brush_generated_get_hardness (GimpBrushGenerated* brush) gimp_brush_generated_get_hardness (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->hardness; return brush->hardness;
} }
float float
gimp_brush_generated_get_angle (GimpBrushGenerated* brush) gimp_brush_generated_get_angle (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->angle; return brush->angle;
} }
float float
gimp_brush_generated_get_aspect_ratio (GimpBrushGenerated* brush) gimp_brush_generated_get_aspect_ratio (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->aspect_ratio; return brush->aspect_ratio;

View File

@ -101,7 +101,7 @@ GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness,
} }
GimpBrushGenerated * GimpBrushGenerated *
gimp_brush_generated_load (char *file_name) gimp_brush_generated_load (const char *file_name)
{ {
GimpBrushGenerated *brush; GimpBrushGenerated *brush;
FILE *fp; FILE *fp;
@ -154,7 +154,7 @@ gimp_brush_generated_load (char *file_name)
void void
gimp_brush_generated_save (GimpBrushGenerated *brush, gimp_brush_generated_save (GimpBrushGenerated *brush,
char *file_name) const char *file_name)
{ {
/* WARNING: untested function */ /* WARNING: untested function */
FILE *fp; FILE *fp;
@ -397,28 +397,28 @@ gimp_brush_generated_set_aspect_ratio (GimpBrushGenerated* brush, float ratio)
} }
float float
gimp_brush_generated_get_radius (GimpBrushGenerated* brush) gimp_brush_generated_get_radius (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->radius; return brush->radius;
} }
float float
gimp_brush_generated_get_hardness (GimpBrushGenerated* brush) gimp_brush_generated_get_hardness (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->hardness; return brush->hardness;
} }
float float
gimp_brush_generated_get_angle (GimpBrushGenerated* brush) gimp_brush_generated_get_angle (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->angle; return brush->angle;
} }
float float
gimp_brush_generated_get_aspect_ratio (GimpBrushGenerated* brush) gimp_brush_generated_get_aspect_ratio (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->aspect_ratio; return brush->aspect_ratio;

View File

@ -54,10 +54,10 @@ guint gimp_brush_generated_get_type (void);
GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness, GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness,
float angle, float aspect_ratio); float angle, float aspect_ratio);
GimpBrushGenerated *gimp_brush_generated_load (char *file_name); GimpBrushGenerated *gimp_brush_generated_load (const char *file_name);
void gimp_brush_generated_save (GimpBrushGenerated *brush, void gimp_brush_generated_save (GimpBrushGenerated *brush,
char *file_name); const char *file_name);
void gimp_brush_generated_freeze (GimpBrushGenerated *brush); void gimp_brush_generated_freeze (GimpBrushGenerated *brush);
void gimp_brush_generated_thaw (GimpBrushGenerated *brush); void gimp_brush_generated_thaw (GimpBrushGenerated *brush);
@ -70,9 +70,9 @@ float gimp_brush_generated_set_angle (GimpBrushGenerated* brush,
float gimp_brush_generated_set_aspect_ratio(GimpBrushGenerated* brush, float gimp_brush_generated_set_aspect_ratio(GimpBrushGenerated* brush,
float ratio); float ratio);
float gimp_brush_generated_get_radius (GimpBrushGenerated* brush); float gimp_brush_generated_get_radius (const GimpBrushGenerated* brush);
float gimp_brush_generated_get_hardness (GimpBrushGenerated* brush); float gimp_brush_generated_get_hardness (const GimpBrushGenerated* brush);
float gimp_brush_generated_get_angle (GimpBrushGenerated* brush); float gimp_brush_generated_get_angle (const GimpBrushGenerated* brush);
float gimp_brush_generated_get_aspect_ratio (GimpBrushGenerated* brush); float gimp_brush_generated_get_aspect_ratio (const GimpBrushGenerated* brush);
#endif /* __GIMP_BRUSH_GENERATED_H__ */ #endif /* __GIMP_BRUSH_GENERATED_H__ */

View File

@ -101,7 +101,7 @@ GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness,
} }
GimpBrushGenerated * GimpBrushGenerated *
gimp_brush_generated_load (char *file_name) gimp_brush_generated_load (const char *file_name)
{ {
GimpBrushGenerated *brush; GimpBrushGenerated *brush;
FILE *fp; FILE *fp;
@ -154,7 +154,7 @@ gimp_brush_generated_load (char *file_name)
void void
gimp_brush_generated_save (GimpBrushGenerated *brush, gimp_brush_generated_save (GimpBrushGenerated *brush,
char *file_name) const char *file_name)
{ {
/* WARNING: untested function */ /* WARNING: untested function */
FILE *fp; FILE *fp;
@ -397,28 +397,28 @@ gimp_brush_generated_set_aspect_ratio (GimpBrushGenerated* brush, float ratio)
} }
float float
gimp_brush_generated_get_radius (GimpBrushGenerated* brush) gimp_brush_generated_get_radius (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->radius; return brush->radius;
} }
float float
gimp_brush_generated_get_hardness (GimpBrushGenerated* brush) gimp_brush_generated_get_hardness (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->hardness; return brush->hardness;
} }
float float
gimp_brush_generated_get_angle (GimpBrushGenerated* brush) gimp_brush_generated_get_angle (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->angle; return brush->angle;
} }
float float
gimp_brush_generated_get_aspect_ratio (GimpBrushGenerated* brush) gimp_brush_generated_get_aspect_ratio (const GimpBrushGenerated* brush)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0); g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED(brush), -1.0);
return brush->aspect_ratio; return brush->aspect_ratio;

View File

@ -54,10 +54,10 @@ guint gimp_brush_generated_get_type (void);
GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness, GimpBrushGenerated *gimp_brush_generated_new(float radius, float hardness,
float angle, float aspect_ratio); float angle, float aspect_ratio);
GimpBrushGenerated *gimp_brush_generated_load (char *file_name); GimpBrushGenerated *gimp_brush_generated_load (const char *file_name);
void gimp_brush_generated_save (GimpBrushGenerated *brush, void gimp_brush_generated_save (GimpBrushGenerated *brush,
char *file_name); const char *file_name);
void gimp_brush_generated_freeze (GimpBrushGenerated *brush); void gimp_brush_generated_freeze (GimpBrushGenerated *brush);
void gimp_brush_generated_thaw (GimpBrushGenerated *brush); void gimp_brush_generated_thaw (GimpBrushGenerated *brush);
@ -70,9 +70,9 @@ float gimp_brush_generated_set_angle (GimpBrushGenerated* brush,
float gimp_brush_generated_set_aspect_ratio(GimpBrushGenerated* brush, float gimp_brush_generated_set_aspect_ratio(GimpBrushGenerated* brush,
float ratio); float ratio);
float gimp_brush_generated_get_radius (GimpBrushGenerated* brush); float gimp_brush_generated_get_radius (const GimpBrushGenerated* brush);
float gimp_brush_generated_get_hardness (GimpBrushGenerated* brush); float gimp_brush_generated_get_hardness (const GimpBrushGenerated* brush);
float gimp_brush_generated_get_angle (GimpBrushGenerated* brush); float gimp_brush_generated_get_angle (const GimpBrushGenerated* brush);
float gimp_brush_generated_get_aspect_ratio (GimpBrushGenerated* brush); float gimp_brush_generated_get_aspect_ratio (const GimpBrushGenerated* brush);
#endif /* __GIMP_BRUSH_GENERATED_H__ */ #endif /* __GIMP_BRUSH_GENERATED_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -34,76 +34,119 @@ void paint_funcs_free (void);
/* Paint functions */ /* Paint functions */
void color_pixels (unsigned char *, unsigned char *, void color_pixels (unsigned char *dest, const unsigned char *color,
int, int); int w, int bytes);
void blend_pixels (unsigned char *, unsigned char *, void blend_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int); const unsigned char *src2,
unsigned char *dest,
int blend, int w, int bytes, int has_alpha);
void shade_pixels (unsigned char *, unsigned char *, void shade_pixels (const unsigned char *src, unsigned char *dest,
unsigned char *, int, int, int, int); const unsigned char *color,
int blend, int w, int bytes, int has_alpha);
void extract_alpha_pixels (unsigned char *, unsigned char *, void extract_alpha_pixels (const unsigned char *src,
unsigned char *, int, int); const unsigned char *mask,
unsigned char *dest,
int w, int bytes);
void darken_pixels (unsigned char *, unsigned char *, void darken_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void lighten_pixels (unsigned char *, unsigned char *, void lighten_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void hsv_only_pixels (unsigned char *, unsigned char *, void hsv_only_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int mode, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void color_only_pixels (unsigned char *, unsigned char *, void color_only_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int mode, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void multiply_pixels (unsigned char *, unsigned char *, void multiply_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void divide_pixels (unsigned char *, unsigned char *, void divide_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void screen_pixels (unsigned char *, unsigned char *, void screen_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void overlay_pixels (unsigned char *, unsigned char *, void overlay_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void add_pixels (unsigned char *, unsigned char *, void add_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void subtract_pixels (unsigned char *, unsigned char *, void subtract_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void difference_pixels (unsigned char *, unsigned char *, void difference_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void dissolve_pixels (unsigned char *, unsigned char *, int, int, void dissolve_pixels (const unsigned char *src,
int, int, int, int, int); unsigned char *dest, int x, int y,
int opacity, int length, int sb, int db,
int has_alpha);
void swap_pixels (unsigned char *, unsigned char *, int); void swap_pixels (unsigned char *src, unsigned char *dest,
int length);
void scale_pixels (unsigned char *, unsigned char *, void scale_pixels (const unsigned char *src, unsigned char *dest,
int, int); int length, int scale);
void add_alpha_pixels (unsigned char *, unsigned char *, void add_alpha_pixels (const unsigned char *src, unsigned char *dest,
int, int); int length, int bytes);
void flatten_pixels (unsigned char *, unsigned char *, void flatten_pixels (const unsigned char *src, unsigned char *dest,
unsigned char *, int, int); const unsigned char *bg, int length, int bytes);
void gray_to_rgb_pixels (unsigned char *, unsigned char *, void gray_to_rgb_pixels (const unsigned char *src, unsigned char *dest,
int, int); int length, int bytes);
/* apply the mask data to the alpha channel of the pixel data */ /* apply the mask data to the alpha channel of the pixel data */
void apply_mask_to_alpha_channel (unsigned char *, unsigned char *, void apply_mask_to_alpha_channel (unsigned char *src,
int, int, int); const unsigned char *mask,
int opacity, int length, int bytes);
/* combine the mask data with the alpha channel of the pixel data */ /* combine the mask data with the alpha channel of the pixel data */
void combine_mask_and_alpha_channel (unsigned char *, unsigned char *, void combine_mask_and_alpha_channel (unsigned char *src,
int, int, int); const unsigned char *mask,
int opacity, int length, int bytes);
/* copy gray pixels to intensity-alpha pixels. This function /* copy gray pixels to intensity-alpha pixels. This function
@ -111,169 +154,276 @@ void combine_mask_and_alpha_channel (unsigned char *, unsigned char *,
* copies it to the destination, expanding to RGB if necessary and * copies it to the destination, expanding to RGB if necessary and
* adding an alpha channel. (OPAQUE) * adding an alpha channel. (OPAQUE)
*/ */
void copy_gray_to_inten_a_pixels (unsigned char *, unsigned char *, void copy_gray_to_inten_a_pixels (const unsigned char *src,
int, int); unsigned char *dest,
int length, int bytes);
/* lay down the initial pixels in the case of only one /* lay down the initial pixels in the case of only one
* channel being visible and no layers...In this singular * channel being visible and no layers...In this singular
* case, we want to display a grayscale image w/o transparency * case, we want to display a grayscale image w/o transparency
*/ */
void initial_channel_pixels (unsigned char *, unsigned char *, void initial_channel_pixels (const unsigned char *src,
int, int); unsigned char *dest,
int length, int bytes);
/* lay down the initial pixels in the case of an indexed image. /* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition * This process obviously requires no composition
*/ */
void initial_indexed_pixels (unsigned char *, unsigned char *, void initial_indexed_pixels (const unsigned char *src,
unsigned char *, int); unsigned char *dest,
const unsigned char *cmap,
int length);
/* lay down the initial pixels in the case of an indexed image. /* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition * This process obviously requires no composition
*/ */
void initial_indexed_a_pixels (unsigned char *, unsigned char *, void initial_indexed_a_pixels (const unsigned char *src,
unsigned char *, unsigned char *, unsigned char *dest,
int, int); const unsigned char *mask,
const unsigned char *cmap,
int opacity, int length);
/* lay down the initial pixels for the base layer. /* lay down the initial pixels for the base layer.
* This process obviously requires no composition. * This process obviously requires no composition.
*/ */
void initial_inten_pixels (unsigned char *, unsigned char *, void initial_inten_pixels (const unsigned char *src,
unsigned char *, int, unsigned char *dest,
int *, int, int); const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* lay down the initial pixels for the base layer. /* lay down the initial pixels for the base layer.
* This process obviously requires no composition. * This process obviously requires no composition.
*/ */
void initial_inten_a_pixels (unsigned char *, unsigned char *, void initial_inten_a_pixels (const unsigned char *src,
unsigned char *, int, unsigned char *dest,
int *, int, int); const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* combine indexed images with an optional mask which /* combine indexed images with an optional mask which
* is interpreted as binary...destination is indexed... * is interpreted as binary...destination is indexed...
*/ */
void combine_indexed_and_indexed_pixels (unsigned char *, unsigned char *, void combine_indexed_and_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* combine indexed images with indexed-alpha images /* combine indexed images with indexed-alpha images
* result is an indexed image * result is an indexed image
*/ */
void combine_indexed_and_indexed_a_pixels(unsigned char *, unsigned char *, void combine_indexed_and_indexed_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* combine indexed-alpha images with indexed-alpha images /* combine indexed-alpha images with indexed-alpha images
* result is an indexed-alpha image. use this for painting * result is an indexed-alpha image. use this for painting
* to an indexed floating sel * to an indexed floating sel
*/ */
void combine_indexed_a_and_indexed_a_pixels(unsigned char *, unsigned char *, void combine_indexed_a_and_indexed_a_pixels(const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* combine intensity with indexed, destination is /* combine intensity with indexed, destination is
* intensity-alpha...use this for an indexed floating sel * intensity-alpha...use this for an indexed floating sel
*/ */
void combine_inten_a_and_indexed_a_pixels(unsigned char *, unsigned char *, void combine_inten_a_and_indexed_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
unsigned char *, int, int, int); unsigned char *dest,
const unsigned char *mask,
const unsigned char *cmap,
int opacity,
int length,
int bytes);
/* combine RGB image with RGB or GRAY with GRAY /* combine RGB image with RGB or GRAY with GRAY
* destination is intensity-only... * destination is intensity-only...
*/ */
void combine_inten_and_inten_pixels (unsigned char *, unsigned char *, void combine_inten_and_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* combine an RGBA or GRAYA image with an RGB or GRAY image /* combine an RGBA or GRAYA image with an RGB or GRAY image
* destination is intensity-only... * destination is intensity-only...
*/ */
void combine_inten_and_inten_a_pixels (unsigned char *, unsigned char *, void combine_inten_and_inten_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* combine an RGB or GRAY image with an RGBA or GRAYA image /* combine an RGB or GRAY image with an RGBA or GRAYA image
* destination is intensity-alpha... * destination is intensity-alpha...
*/ */
void combine_inten_a_and_inten_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int mode_affect, int length,
int bytes);
/* combine an RGBA or GRAYA image with an RGBA or GRAYA image /* combine an RGBA or GRAYA image with an RGBA or GRAYA image
* destination is of course intensity-alpha... * destination is of course intensity-alpha...
*/ */
void combine_inten_a_and_inten_a_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_inten_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int mode_affect,
int length,
int bytes);
/* combine a channel with intensity-alpha pixels based /* combine a channel with intensity-alpha pixels based
* on some opacity, and a channel color... * on some opacity, and a channel color...
* destination is intensity-alpha * destination is intensity-alpha
*/ */
void combine_inten_a_and_channel_mask_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_channel_mask_pixels(const unsigned char *src,
unsigned char *, unsigned char *, const unsigned char *channel,
int, int, int); unsigned char *dest,
const unsigned char *col,
int opacity,
int length,
int bytes);
void combine_inten_a_and_channel_selection_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_channel_selection_pixels(const unsigned char *src,
unsigned char *, unsigned char *, const unsigned char *channel,
int, int, int); unsigned char *dest,
const unsigned char *col,
int opacity,
int length,
int bytes);
/* paint "behind" the existing pixel row. /* paint "behind" the existing pixel row.
* This is similar in appearance to painting on a layer below * This is similar in appearance to painting on a layer below
* the existing pixels. * the existing pixels.
*/ */
void behind_inten_pixels (unsigned char *, unsigned char *, void behind_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* paint "behind" the existing pixel row (for indexed images). /* paint "behind" the existing pixel row (for indexed images).
* This is similar in appearance to painting on a layer below * This is similar in appearance to painting on a layer below
* the existing pixels. * the existing pixels.
*/ */
void behind_indexed_pixels (unsigned char *, unsigned char *, void behind_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* replace the contents of one pixel row with the other /* replace the contents of one pixel row with the other
* The operation is still bounded by mask/opacity constraints * The operation is still bounded by mask/opacity constraints
*/ */
void replace_inten_pixels (unsigned char *, unsigned char *, void replace_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* replace the contents of one pixel row with the other /* replace the contents of one pixel row with the other
* The operation is still bounded by mask/opacity constraints * The operation is still bounded by mask/opacity constraints
*/ */
void replace_indexed_pixels (unsigned char *, unsigned char *, void replace_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* apply source 2 to source 1, but in a non-additive way, /* apply source 2 to source 1, but in a non-additive way,
* multiplying alpha channels (works for intensity) * multiplying alpha channels (works for intensity)
*/ */
void erase_inten_pixels (unsigned char *, unsigned char *, void erase_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* apply source 2 to source 1, but in a non-additive way, /* apply source 2 to source 1, but in a non-additive way,
* multiplying alpha channels (works for indexed) * multiplying alpha channels (works for indexed)
*/ */
void erase_indexed_pixels (unsigned char *, unsigned char *, void erase_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* extract information from intensity pixels based on /* extract information from intensity pixels based on
* a mask. * a mask.
*/ */
void extract_from_inten_pixels (unsigned char *, unsigned char *, void extract_from_inten_pixels (unsigned char *src,
unsigned char *, unsigned char *, unsigned char *dest,
int, int, int, int); const unsigned char *mask,
const unsigned char *bg,
int cut,
int length,
int bytes,
int has_alpha);
/* extract information from indexed pixels based on /* extract information from indexed pixels based on
* a mask. * a mask.
*/ */
void extract_from_indexed_pixels (unsigned char *, unsigned char *, void extract_from_indexed_pixels (unsigned char *src,
unsigned char *, unsigned char *, unsigned char *dest,
unsigned char *, int, int, int, int); const unsigned char *mask,
const unsigned char *cmap,
const unsigned char *bg,
int cut,
int length,
int bytes,
int has_alpha);
/* variable source to RGB color mapping /* variable source to RGB color mapping
@ -282,8 +432,10 @@ void extract_from_indexed_pixels (unsigned char *, unsigned char *,
* src_type == 2 (INDEXED) * src_type == 2 (INDEXED)
*/ */
void void
map_to_color (int, unsigned char *, map_to_color (int src_type,
unsigned char *, unsigned char *); const unsigned char *cmap,
const unsigned char *src,
unsigned char *rgb);
/* RGB to index mapping functions... /* RGB to index mapping functions...
@ -291,12 +443,14 @@ map_to_color (int, unsigned char *,
* Hash table lookup speeds up the standard * Hash table lookup speeds up the standard
* least squares method * least squares method
*/ */
int map_rgb_to_indexed (unsigned char *, int, GimpImage*, int map_rgb_to_indexed (const unsigned char *cmap,
int, int, int); int num_cols, GimpImage* gimage,
int r, int g, int b);
/* Region functions */ /* Region functions */
void color_region (PixelRegion *, unsigned char *); void color_region (PixelRegion *dest,
const unsigned char *color);
void blend_region (PixelRegion *, PixelRegion *, void blend_region (PixelRegion *, PixelRegion *,

File diff suppressed because it is too large Load Diff

View File

@ -34,76 +34,119 @@ void paint_funcs_free (void);
/* Paint functions */ /* Paint functions */
void color_pixels (unsigned char *, unsigned char *, void color_pixels (unsigned char *dest, const unsigned char *color,
int, int); int w, int bytes);
void blend_pixels (unsigned char *, unsigned char *, void blend_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int); const unsigned char *src2,
unsigned char *dest,
int blend, int w, int bytes, int has_alpha);
void shade_pixels (unsigned char *, unsigned char *, void shade_pixels (const unsigned char *src, unsigned char *dest,
unsigned char *, int, int, int, int); const unsigned char *color,
int blend, int w, int bytes, int has_alpha);
void extract_alpha_pixels (unsigned char *, unsigned char *, void extract_alpha_pixels (const unsigned char *src,
unsigned char *, int, int); const unsigned char *mask,
unsigned char *dest,
int w, int bytes);
void darken_pixels (unsigned char *, unsigned char *, void darken_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void lighten_pixels (unsigned char *, unsigned char *, void lighten_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void hsv_only_pixels (unsigned char *, unsigned char *, void hsv_only_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int mode, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void color_only_pixels (unsigned char *, unsigned char *, void color_only_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int mode, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void multiply_pixels (unsigned char *, unsigned char *, void multiply_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void divide_pixels (unsigned char *, unsigned char *, void divide_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void screen_pixels (unsigned char *, unsigned char *, void screen_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void overlay_pixels (unsigned char *, unsigned char *, void overlay_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void add_pixels (unsigned char *, unsigned char *, void add_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void subtract_pixels (unsigned char *, unsigned char *, void subtract_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void difference_pixels (unsigned char *, unsigned char *, void difference_pixels (const unsigned char *src1,
unsigned char *, int, int, int, int, int); const unsigned char *src2,
unsigned char *dest, int length,
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
void dissolve_pixels (unsigned char *, unsigned char *, int, int, void dissolve_pixels (const unsigned char *src,
int, int, int, int, int); unsigned char *dest, int x, int y,
int opacity, int length, int sb, int db,
int has_alpha);
void swap_pixels (unsigned char *, unsigned char *, int); void swap_pixels (unsigned char *src, unsigned char *dest,
int length);
void scale_pixels (unsigned char *, unsigned char *, void scale_pixels (const unsigned char *src, unsigned char *dest,
int, int); int length, int scale);
void add_alpha_pixels (unsigned char *, unsigned char *, void add_alpha_pixels (const unsigned char *src, unsigned char *dest,
int, int); int length, int bytes);
void flatten_pixels (unsigned char *, unsigned char *, void flatten_pixels (const unsigned char *src, unsigned char *dest,
unsigned char *, int, int); const unsigned char *bg, int length, int bytes);
void gray_to_rgb_pixels (unsigned char *, unsigned char *, void gray_to_rgb_pixels (const unsigned char *src, unsigned char *dest,
int, int); int length, int bytes);
/* apply the mask data to the alpha channel of the pixel data */ /* apply the mask data to the alpha channel of the pixel data */
void apply_mask_to_alpha_channel (unsigned char *, unsigned char *, void apply_mask_to_alpha_channel (unsigned char *src,
int, int, int); const unsigned char *mask,
int opacity, int length, int bytes);
/* combine the mask data with the alpha channel of the pixel data */ /* combine the mask data with the alpha channel of the pixel data */
void combine_mask_and_alpha_channel (unsigned char *, unsigned char *, void combine_mask_and_alpha_channel (unsigned char *src,
int, int, int); const unsigned char *mask,
int opacity, int length, int bytes);
/* copy gray pixels to intensity-alpha pixels. This function /* copy gray pixels to intensity-alpha pixels. This function
@ -111,169 +154,276 @@ void combine_mask_and_alpha_channel (unsigned char *, unsigned char *,
* copies it to the destination, expanding to RGB if necessary and * copies it to the destination, expanding to RGB if necessary and
* adding an alpha channel. (OPAQUE) * adding an alpha channel. (OPAQUE)
*/ */
void copy_gray_to_inten_a_pixels (unsigned char *, unsigned char *, void copy_gray_to_inten_a_pixels (const unsigned char *src,
int, int); unsigned char *dest,
int length, int bytes);
/* lay down the initial pixels in the case of only one /* lay down the initial pixels in the case of only one
* channel being visible and no layers...In this singular * channel being visible and no layers...In this singular
* case, we want to display a grayscale image w/o transparency * case, we want to display a grayscale image w/o transparency
*/ */
void initial_channel_pixels (unsigned char *, unsigned char *, void initial_channel_pixels (const unsigned char *src,
int, int); unsigned char *dest,
int length, int bytes);
/* lay down the initial pixels in the case of an indexed image. /* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition * This process obviously requires no composition
*/ */
void initial_indexed_pixels (unsigned char *, unsigned char *, void initial_indexed_pixels (const unsigned char *src,
unsigned char *, int); unsigned char *dest,
const unsigned char *cmap,
int length);
/* lay down the initial pixels in the case of an indexed image. /* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition * This process obviously requires no composition
*/ */
void initial_indexed_a_pixels (unsigned char *, unsigned char *, void initial_indexed_a_pixels (const unsigned char *src,
unsigned char *, unsigned char *, unsigned char *dest,
int, int); const unsigned char *mask,
const unsigned char *cmap,
int opacity, int length);
/* lay down the initial pixels for the base layer. /* lay down the initial pixels for the base layer.
* This process obviously requires no composition. * This process obviously requires no composition.
*/ */
void initial_inten_pixels (unsigned char *, unsigned char *, void initial_inten_pixels (const unsigned char *src,
unsigned char *, int, unsigned char *dest,
int *, int, int); const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* lay down the initial pixels for the base layer. /* lay down the initial pixels for the base layer.
* This process obviously requires no composition. * This process obviously requires no composition.
*/ */
void initial_inten_a_pixels (unsigned char *, unsigned char *, void initial_inten_a_pixels (const unsigned char *src,
unsigned char *, int, unsigned char *dest,
int *, int, int); const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* combine indexed images with an optional mask which /* combine indexed images with an optional mask which
* is interpreted as binary...destination is indexed... * is interpreted as binary...destination is indexed...
*/ */
void combine_indexed_and_indexed_pixels (unsigned char *, unsigned char *, void combine_indexed_and_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* combine indexed images with indexed-alpha images /* combine indexed images with indexed-alpha images
* result is an indexed image * result is an indexed image
*/ */
void combine_indexed_and_indexed_a_pixels(unsigned char *, unsigned char *, void combine_indexed_and_indexed_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* combine indexed-alpha images with indexed-alpha images /* combine indexed-alpha images with indexed-alpha images
* result is an indexed-alpha image. use this for painting * result is an indexed-alpha image. use this for painting
* to an indexed floating sel * to an indexed floating sel
*/ */
void combine_indexed_a_and_indexed_a_pixels(unsigned char *, unsigned char *, void combine_indexed_a_and_indexed_a_pixels(const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* combine intensity with indexed, destination is /* combine intensity with indexed, destination is
* intensity-alpha...use this for an indexed floating sel * intensity-alpha...use this for an indexed floating sel
*/ */
void combine_inten_a_and_indexed_a_pixels(unsigned char *, unsigned char *, void combine_inten_a_and_indexed_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
unsigned char *, int, int, int); unsigned char *dest,
const unsigned char *mask,
const unsigned char *cmap,
int opacity,
int length,
int bytes);
/* combine RGB image with RGB or GRAY with GRAY /* combine RGB image with RGB or GRAY with GRAY
* destination is intensity-only... * destination is intensity-only...
*/ */
void combine_inten_and_inten_pixels (unsigned char *, unsigned char *, void combine_inten_and_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* combine an RGBA or GRAYA image with an RGB or GRAY image /* combine an RGBA or GRAYA image with an RGB or GRAY image
* destination is intensity-only... * destination is intensity-only...
*/ */
void combine_inten_and_inten_a_pixels (unsigned char *, unsigned char *, void combine_inten_and_inten_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int length, int bytes);
/* combine an RGB or GRAY image with an RGBA or GRAYA image /* combine an RGB or GRAY image with an RGBA or GRAYA image
* destination is intensity-alpha... * destination is intensity-alpha...
*/ */
void combine_inten_a_and_inten_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity, const int *affect,
int mode_affect, int length,
int bytes);
/* combine an RGBA or GRAYA image with an RGBA or GRAYA image /* combine an RGBA or GRAYA image with an RGBA or GRAYA image
* destination is of course intensity-alpha... * destination is of course intensity-alpha...
*/ */
void combine_inten_a_and_inten_a_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_inten_a_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int mode_affect,
int length,
int bytes);
/* combine a channel with intensity-alpha pixels based /* combine a channel with intensity-alpha pixels based
* on some opacity, and a channel color... * on some opacity, and a channel color...
* destination is intensity-alpha * destination is intensity-alpha
*/ */
void combine_inten_a_and_channel_mask_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_channel_mask_pixels(const unsigned char *src,
unsigned char *, unsigned char *, const unsigned char *channel,
int, int, int); unsigned char *dest,
const unsigned char *col,
int opacity,
int length,
int bytes);
void combine_inten_a_and_channel_selection_pixels (unsigned char *, unsigned char *, void combine_inten_a_and_channel_selection_pixels(const unsigned char *src,
unsigned char *, unsigned char *, const unsigned char *channel,
int, int, int); unsigned char *dest,
const unsigned char *col,
int opacity,
int length,
int bytes);
/* paint "behind" the existing pixel row. /* paint "behind" the existing pixel row.
* This is similar in appearance to painting on a layer below * This is similar in appearance to painting on a layer below
* the existing pixels. * the existing pixels.
*/ */
void behind_inten_pixels (unsigned char *, unsigned char *, void behind_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* paint "behind" the existing pixel row (for indexed images). /* paint "behind" the existing pixel row (for indexed images).
* This is similar in appearance to painting on a layer below * This is similar in appearance to painting on a layer below
* the existing pixels. * the existing pixels.
*/ */
void behind_indexed_pixels (unsigned char *, unsigned char *, void behind_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* replace the contents of one pixel row with the other /* replace the contents of one pixel row with the other
* The operation is still bounded by mask/opacity constraints * The operation is still bounded by mask/opacity constraints
*/ */
void replace_inten_pixels (unsigned char *, unsigned char *, void replace_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* replace the contents of one pixel row with the other /* replace the contents of one pixel row with the other
* The operation is still bounded by mask/opacity constraints * The operation is still bounded by mask/opacity constraints
*/ */
void replace_indexed_pixels (unsigned char *, unsigned char *, void replace_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int, int, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes1,
int bytes2,
int has_alpha1,
int has_alpha2);
/* apply source 2 to source 1, but in a non-additive way, /* apply source 2 to source 1, but in a non-additive way,
* multiplying alpha channels (works for intensity) * multiplying alpha channels (works for intensity)
*/ */
void erase_inten_pixels (unsigned char *, unsigned char *, void erase_inten_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* apply source 2 to source 1, but in a non-additive way, /* apply source 2 to source 1, but in a non-additive way,
* multiplying alpha channels (works for indexed) * multiplying alpha channels (works for indexed)
*/ */
void erase_indexed_pixels (unsigned char *, unsigned char *, void erase_indexed_pixels (const unsigned char *src1,
unsigned char *, unsigned char *, const unsigned char *src2,
int, int *, int, int); unsigned char *dest,
const unsigned char *mask,
int opacity,
const int *affect,
int length,
int bytes);
/* extract information from intensity pixels based on /* extract information from intensity pixels based on
* a mask. * a mask.
*/ */
void extract_from_inten_pixels (unsigned char *, unsigned char *, void extract_from_inten_pixels (unsigned char *src,
unsigned char *, unsigned char *, unsigned char *dest,
int, int, int, int); const unsigned char *mask,
const unsigned char *bg,
int cut,
int length,
int bytes,
int has_alpha);
/* extract information from indexed pixels based on /* extract information from indexed pixels based on
* a mask. * a mask.
*/ */
void extract_from_indexed_pixels (unsigned char *, unsigned char *, void extract_from_indexed_pixels (unsigned char *src,
unsigned char *, unsigned char *, unsigned char *dest,
unsigned char *, int, int, int, int); const unsigned char *mask,
const unsigned char *cmap,
const unsigned char *bg,
int cut,
int length,
int bytes,
int has_alpha);
/* variable source to RGB color mapping /* variable source to RGB color mapping
@ -282,8 +432,10 @@ void extract_from_indexed_pixels (unsigned char *, unsigned char *,
* src_type == 2 (INDEXED) * src_type == 2 (INDEXED)
*/ */
void void
map_to_color (int, unsigned char *, map_to_color (int src_type,
unsigned char *, unsigned char *); const unsigned char *cmap,
const unsigned char *src,
unsigned char *rgb);
/* RGB to index mapping functions... /* RGB to index mapping functions...
@ -291,12 +443,14 @@ map_to_color (int, unsigned char *,
* Hash table lookup speeds up the standard * Hash table lookup speeds up the standard
* least squares method * least squares method
*/ */
int map_rgb_to_indexed (unsigned char *, int, GimpImage*, int map_rgb_to_indexed (const unsigned char *cmap,
int, int, int); int num_cols, GimpImage* gimage,
int r, int g, int b);
/* Region functions */ /* Region functions */
void color_region (PixelRegion *, unsigned char *); void color_region (PixelRegion *dest,
const unsigned char *color);
void blend_region (PixelRegion *, PixelRegion *, void blend_region (PixelRegion *, PixelRegion *,