gimp/app/paint-funcs/paint-funcs.h

365 lines
12 KiB
C
Raw Normal View History

1997-11-25 06:05:25 +08:00
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1997-11-25 06:05:25 +08:00
*/
#ifndef __PAINT_FUNCS_H__
#define __PAINT_FUNCS_H__
/* Called initially to setup accelerated rendering features */
void paint_funcs_setup (gboolean use_mmx);
1997-11-25 06:05:25 +08:00
void paint_funcs_free (void);
/* Paint functions */
void color_pixels (guchar *dest, const guchar *color,
guint w, guint bytes);
void blend_pixels (const guchar *src1,
const guchar *src2,
guchar *dest,
guchar blend, guint w,
guint bytes, guint 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 guchar *src,
const guchar *mask,
guchar *dest,
guint w, guint bytes);
void swap_pixels (guchar *src, guchar *dest,
guint length);
void scale_pixels (const guchar *src, guchar *dest,
guint length, int scale);
void add_alpha_pixels (const guchar *src, guchar *dest,
guint length, guint bytes);
void flatten_pixels (const guchar *src, guchar *dest,
const guchar *bg, guint length, guint bytes);
void gray_to_rgb_pixels (const guchar *src, guchar *dest,
guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* apply the mask data to the alpha channel of the pixel data */
void apply_mask_to_alpha_channel (guchar *src,
const guchar *mask,
guint opacity, guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* combine the mask data with the alpha channel of the pixel data */
void combine_mask_and_alpha_channel (guchar *src,
const guchar *mask,
guint opacity, guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* copy gray pixels to intensity-alpha pixels. This function
* essentially takes a source that is only a grayscale image and
* copies it to the destination, expanding to RGB if necessary and
* adding an alpha channel. (OPAQUE)
*/
void copy_gray_to_inten_a_pixels (const guchar *src,
guchar *dest,
guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* 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 guchar *src,
guchar *dest,
guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition
*/
void initial_indexed_pixels (const guchar *src,
guchar *dest,
const guchar *cmap,
guint length);
1997-11-25 06:05:25 +08:00
/* lay down the initial pixels in the case of an indexed image.
* This process obviously requires no composition
*/
void initial_indexed_a_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
const guchar *cmap,
guint opacity, guint length);
1997-11-25 06:05:25 +08:00
/* lay down the initial pixels for the base layer.
* This process obviously requires no composition.
*/
void initial_inten_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
guint opacity, const int *affect,
guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* lay down the initial pixels for the base layer.
* This process obviously requires no composition.
*/
void initial_inten_a_pixels (const guchar *src,
guchar *dest,
const guchar *mask,
guint opacity, const int *affect,
guint length, guint bytes);
1997-11-25 06:05:25 +08:00
/* combine indexed images with an optional mask which
* is interpreted as binary...destination is indexed...
*/
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);
1997-11-25 06:05:25 +08:00
/* combine indexed images with indexed-alpha images
* result is an indexed image
*/
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);
1997-11-25 06:05:25 +08:00
/* 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 guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const int *affect,
guint length,
guint bytes);
1997-11-25 06:05:25 +08:00
/* combine intensity with indexed, destination is
* intensity-alpha...use this for an indexed floating sel
*/
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);
1997-11-25 06:05:25 +08:00
/* combine RGB image with RGB or GRAY with GRAY
* destination is intensity-only...
*/
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);
1997-11-25 06:05:25 +08:00
/* combine an RGBA or GRAYA image with an RGB or GRAY image
* destination is intensity-only...
*/
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);
1997-11-25 06:05:25 +08:00
/* combine an RGB or GRAY image with an RGBA or GRAYA image
* destination is intensity-alpha...
*/
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);
1997-11-25 06:05:25 +08:00
/* 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 guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
guint opacity,
const gboolean *affect,
guint mode_affect,
guint length,
guint bytes);
1997-11-25 06:05:25 +08:00
/* 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 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 guchar *src,
const guchar *channel,
guchar *dest,
const guchar *col,
guint opacity,
guint length,
guint bytes);
1997-11-25 06:05:25 +08:00
/* extract information from intensity pixels based on
* a mask.
*/
void extract_from_inten_pixels (guchar *src,
guchar *dest,
const guchar *mask,
const guchar *bg,
guint cut,
guint length,
guint bytes,
guint has_alpha);
1997-11-25 06:05:25 +08:00
/* extract information from indexed pixels based on
* a mask.
*/
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);
1997-11-25 06:05:25 +08:00
/* variable source to RGB color mapping
* src_type == 0 (RGB)
* src_type == 1 (GRAY)
* src_type == 2 (INDEXED)
*/
void map_to_color (guint src_type,
const guchar *cmap,
const guchar *src,
guchar *rgb);
1997-11-25 06:05:25 +08:00
/* Region functions */
void color_region (PixelRegion *dest,
const guchar *color);
1997-11-25 06:05:25 +08:00
void blend_region (PixelRegion *, PixelRegion *,
PixelRegion *, int);
void shade_region (PixelRegion *, PixelRegion *,
guchar *, int);
1997-11-25 06:05:25 +08:00
void copy_region (PixelRegion *, PixelRegion *);
void add_alpha_region (PixelRegion *, PixelRegion *);
void flatten_region (PixelRegion *, PixelRegion *,
guchar *);
1997-11-25 06:05:25 +08:00
void extract_alpha_region (PixelRegion *, PixelRegion *,
PixelRegion *);
void extract_from_region (PixelRegion *, PixelRegion *,
PixelRegion *, guchar *,
guchar *, guint, guint, guint);
1997-11-25 06:05:25 +08:00
void convolve_region (PixelRegion *,
PixelRegion *,
int *, int, int,
app/core/Makefile.am new file that holds enums that are registered with 2001-12-08 Sven Neumann <sven@gimp.org> * app/core/Makefile.am * app/core/core-enums.h: new file that holds enums that are registered with the type system and is used to generate core-enums.c. * app/core/core-types.h: include core-enums.h * app/base/base-types.h: namespace cleanup. Prefix all enumeration types with Gimp and their values with GIMP. Moved GimpLayerModeEffects enum ... * app/base/base-enums.h: ... here. * app/image_map.c * app/base/temp-buf.c * app/core/gimpcontext.[ch] * app/core/gimpdrawable-transform.c * app/core/gimpdrawable.c * app/core/gimpedit.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-new.c * app/core/gimpimage-projection.c * app/core/gimpimage.[ch] * app/core/gimplayer.[ch] * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-render.c * app/gui/brush-select.c * app/gui/layers-commands.c * app/gui/preferences-dialog.c * app/gui/toolbox.c * app/paint-funcs/paint-funcs.[ch] * app/tools/gimpconvolvetool.c * app/tools/gimperasertool.c * app/tools/gimpiscissorstool.c * app/tools/gimppainttool.[ch] * app/tools/gimptexttool.c * app/tools/paint_options.c * app/widgets/gimplayerlistview.c * app/widgets/gimpwidgets-constructors.[ch] * app/xcf/xcf-load.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: changed accordingly. * libgimpbase/gimpbasetypes.h: no need to chop GIMP prefix off the enums any longer. * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/color_cmds.c * app/pdb/layer_cmds.c * app/pdb/message_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/tools_cmds.c * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * app/gimprc.c: removed code to parse for "plug_in" keyword which was left over from some very early gimp days. * app/plug-in/plug-in.[ch]: removed now unused function plug_in_add().
2001-12-09 07:12:59 +08:00
GimpConvolutionType);
1997-11-25 06:05:25 +08:00
void multiply_alpha_region (PixelRegion *);
void separate_alpha_region (PixelRegion *);
void gaussian_blur_region (PixelRegion *, double, double);
1997-11-25 06:05:25 +08:00
void border_region (PixelRegion *, gint16, gint16);
1997-11-25 06:05:25 +08:00
void scale_region (PixelRegion *, PixelRegion *,
GimpInterpolationType);
1997-11-25 06:05:25 +08:00
void subsample_region (PixelRegion *, PixelRegion *,
int);
float shapeburst_region (PixelRegion *, PixelRegion *);
void thin_region (PixelRegion *, gint16 xradius,
gint16 yradius, int edge_lock);
1997-11-25 06:05:25 +08:00
void fatten_region (PixelRegion *,
gint16 xradius, gint16 yradius);
1997-11-25 06:05:25 +08:00
void swap_region (PixelRegion *, PixelRegion *);
/* Apply a mask to an image's alpha channel */
void apply_mask_to_region (PixelRegion *, PixelRegion *, guint);
1997-11-25 06:05:25 +08:00
/* Combine a mask with an image's alpha channel */
void combine_mask_and_region (PixelRegion *, PixelRegion *, guint);
1997-11-25 06:05:25 +08:00
/* Copy a gray image to an intensity-alpha region */
void copy_gray_to_region (PixelRegion *, PixelRegion *);
/* Copy a component (indexed by pixel) to a 1-byte region */
void copy_component (PixelRegion *src,
PixelRegion *dest,
guint pixel);
1997-11-25 06:05:25 +08:00
void initial_region (PixelRegion *, PixelRegion *,
PixelRegion *, guchar *,
app/core/Makefile.am new file that holds enums that are registered with 2001-12-08 Sven Neumann <sven@gimp.org> * app/core/Makefile.am * app/core/core-enums.h: new file that holds enums that are registered with the type system and is used to generate core-enums.c. * app/core/core-types.h: include core-enums.h * app/base/base-types.h: namespace cleanup. Prefix all enumeration types with Gimp and their values with GIMP. Moved GimpLayerModeEffects enum ... * app/base/base-enums.h: ... here. * app/image_map.c * app/base/temp-buf.c * app/core/gimpcontext.[ch] * app/core/gimpdrawable-transform.c * app/core/gimpdrawable.c * app/core/gimpedit.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-new.c * app/core/gimpimage-projection.c * app/core/gimpimage.[ch] * app/core/gimplayer.[ch] * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-render.c * app/gui/brush-select.c * app/gui/layers-commands.c * app/gui/preferences-dialog.c * app/gui/toolbox.c * app/paint-funcs/paint-funcs.[ch] * app/tools/gimpconvolvetool.c * app/tools/gimperasertool.c * app/tools/gimpiscissorstool.c * app/tools/gimppainttool.[ch] * app/tools/gimptexttool.c * app/tools/paint_options.c * app/widgets/gimplayerlistview.c * app/widgets/gimpwidgets-constructors.[ch] * app/xcf/xcf-load.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: changed accordingly. * libgimpbase/gimpbasetypes.h: no need to chop GIMP prefix off the enums any longer. * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/color_cmds.c * app/pdb/layer_cmds.c * app/pdb/message_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/tools_cmds.c * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * app/gimprc.c: removed code to parse for "plug_in" keyword which was left over from some very early gimp days. * app/plug-in/plug-in.[ch]: removed now unused function plug_in_add().
2001-12-09 07:12:59 +08:00
int, GimpLayerModeEffects, int *,
CombinationMode);
void combine_regions (PixelRegion *, PixelRegion *,
PixelRegion *, PixelRegion *,
guchar *, guint,
app/core/Makefile.am new file that holds enums that are registered with 2001-12-08 Sven Neumann <sven@gimp.org> * app/core/Makefile.am * app/core/core-enums.h: new file that holds enums that are registered with the type system and is used to generate core-enums.c. * app/core/core-types.h: include core-enums.h * app/base/base-types.h: namespace cleanup. Prefix all enumeration types with Gimp and their values with GIMP. Moved GimpLayerModeEffects enum ... * app/base/base-enums.h: ... here. * app/image_map.c * app/base/temp-buf.c * app/core/gimpcontext.[ch] * app/core/gimpdrawable-transform.c * app/core/gimpdrawable.c * app/core/gimpedit.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-new.c * app/core/gimpimage-projection.c * app/core/gimpimage.[ch] * app/core/gimplayer.[ch] * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-render.c * app/gui/brush-select.c * app/gui/layers-commands.c * app/gui/preferences-dialog.c * app/gui/toolbox.c * app/paint-funcs/paint-funcs.[ch] * app/tools/gimpconvolvetool.c * app/tools/gimperasertool.c * app/tools/gimpiscissorstool.c * app/tools/gimppainttool.[ch] * app/tools/gimptexttool.c * app/tools/paint_options.c * app/widgets/gimplayerlistview.c * app/widgets/gimpwidgets-constructors.[ch] * app/xcf/xcf-load.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: changed accordingly. * libgimpbase/gimpbasetypes.h: no need to chop GIMP prefix off the enums any longer. * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/color_cmds.c * app/pdb/layer_cmds.c * app/pdb/message_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/tools_cmds.c * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * app/gimprc.c: removed code to parse for "plug_in" keyword which was left over from some very early gimp days. * app/plug-in/plug-in.[ch]: removed now unused function plug_in_add().
2001-12-09 07:12:59 +08:00
GimpLayerModeEffects,
int *, CombinationMode);
void combine_regions_replace (PixelRegion *, PixelRegion *,
PixelRegion *, PixelRegion *,
guchar *,
guint, int *, CombinationMode);
1997-11-25 06:05:25 +08:00
#endif /* __PAINT_FUNCS_H__ */