Commit 03a6c044 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/base/base-enums.h moved all remaining enums to base-enums.h

2001-12-11  Sven Neumann  <sven@gimp.org>

	* app/base/base-enums.h
	* app/base/base-types.h: moved all remaining enums to base-enums.h

	* app/core/core-enums.h
	* app/core/core-types.h: moved GimpImageType to core-enums.h and
	changed the values from RGB_GIMAGE to GIMP_RGB_IMAGE and the like.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-preview.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-contiguous-region.c
	* app/core/gimpimage-convert.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.c
	* app/core/gimplayermask.c
	* app/core/gimppalette-import.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell-render.c
	* app/gui/file-save-dialog.c
	* app/gui/toolbox.c
	* app/plug-in/plug-in.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpdodgeburntool.c: changed accordingly.

	* tools/pdbgen/Makefile.am: no need to parse app/base/base-types.h
	any longer.

	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/paint_tools_cmds.c
	* tools/pdbgen/enums.pl: regenerated.
parent a611f063
2001-12-11 Sven Neumann <sven@gimp.org>
* app/base/base-enums.h
* app/base/base-types.h: moved all remaining enums to base-enums.h
* app/core/core-enums.h
* app/core/core-types.h: moved GimpImageType to core-enums.h and
changed the values from RGB_GIMAGE to GIMP_RGB_IMAGE and the like.
* app/core/gimpchannel.c
* app/core/gimpdrawable-preview.c
* app/core/gimpdrawable-transform.c
* app/core/gimpdrawable.c
* app/core/gimpimage-contiguous-region.c
* app/core/gimpimage-convert.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.c
* app/core/gimplayermask.c
* app/core/gimppalette-import.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/gui/file-save-dialog.c
* app/gui/toolbox.c
* app/plug-in/plug-in.c
* app/tools/gimpblendtool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpdodgeburntool.c: changed accordingly.
* tools/pdbgen/Makefile.am: no need to parse app/base/base-types.h
any longer.
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/paint_tools_cmds.c
* tools/pdbgen/enums.pl: regenerated.
2001-12-11 Sven Neumann <sven@gimp.org>
* app/core/core-types.h: removed GimpImageBaseType enum ...
......
......@@ -1400,22 +1400,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
{
switch (type)
{
case RGB_GIMAGE:
case GIMP_RGB_IMAGE:
sensitive = proc_def->image_types_val & PLUG_IN_RGB_IMAGE;
break;
case RGBA_GIMAGE:
case GIMP_RGBA_IMAGE:
sensitive = proc_def->image_types_val & PLUG_IN_RGBA_IMAGE;
break;
case GRAY_GIMAGE:
case GIMP_GRAY_IMAGE:
sensitive = proc_def->image_types_val & PLUG_IN_GRAY_IMAGE;
break;
case GRAYA_GIMAGE:
case GIMP_GRAYA_IMAGE:
sensitive = proc_def->image_types_val & PLUG_IN_GRAYA_IMAGE;
break;
case INDEXED_GIMAGE:
case GIMP_INDEXED_IMAGE:
sensitive = proc_def->image_types_val & PLUG_IN_INDEXED_IMAGE;
break;
case INDEXEDA_GIMAGE:
case GIMP_INDEXEDA_IMAGE:
sensitive = proc_def->image_types_val & PLUG_IN_INDEXEDA_IMAGE;
break;
default:
......
......@@ -19,8 +19,22 @@
#ifndef __BASE_ENUMS_H__
#define __BASE_ENUMS_H__
/* These enums that are registered with the type system. */
#if 0
This file is parsed by two scripts, enumgen.pl in tools/pdbgen
and glib-mkenums. All enums that are not marked with /*< pdb-skip >*/
are exported to libgimp and the PDB. Enums that are not marked with
/*< skip >*/ are registered with the GType system. If you want the
enum to be skipped by both scripts, you have to use /*< pdb-skip >*/
_before_ /*< skip >*/.
All enum values that are marked with /*< skip >*/ are skipped for
both targets.
#endif
/*
* these enums that are registered with the type system
*/
#define GIMP_TYPE_INTERPOLATION_TYPE (gimp_interpolation_type_get_type ())
......@@ -66,11 +80,23 @@ typedef enum
} GimpLayerModeEffects;
#define GIMP_TYPE_CHECK_SIZE (gimp_check_size_get_type ())
GType gimp_check_size_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_SMALL_CHECKS = 0,
GIMP_MEDIUM_CHECKS = 1,
GIMP_LARGE_CHECKS = 2
} GimpCheckSize;
#define GIMP_TYPE_CHECK_TYPE (gimp_check_type_get_type ())
GType gimp_check_type_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
typedef enum /*< pdb-skip >*/
{
GIMP_LIGHT_CHECKS = 0,
GIMP_GRAY_CHECKS = 1,
......@@ -81,16 +107,35 @@ typedef enum /*< pdb-skip >*/
} GimpCheckType;
#define GIMP_TYPE_CHECK_SIZE (gimp_check_size_get_type ())
/*
* non-registered enums; register them if needed
*/
GType gimp_check_size_get_type (void) G_GNUC_CONST;
typedef enum /*< skip >*/
{
GIMP_NORMAL_CONVOL, /* Negative numbers truncated */
GIMP_ABSOLUTE_CONVOL, /* Absolute value */
GIMP_NEGATIVE_CONVOL /* add 127 to values */
} GimpConvolutionType;
typedef enum /*< pdb-skip >*/
typedef enum /*< skip >*/
{
GIMP_SMALL_CHECKS = 0,
GIMP_MEDIUM_CHECKS = 1,
GIMP_LARGE_CHECKS = 2
} GimpCheckSize;
GIMP_VALUE_LUT,
GIMP_RED_LUT,
GIMP_GREEN_LUT,
GIMP_BLUE_LUT,
GIMP_ALPHA_LUT,
GIMP_GRAY_LUT = 0 /*< skip >*/
} GimpChannelLutType;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_HISTOGRAM_VALUE = 0,
GIMP_HISTOGRAM_RED = 1,
GIMP_HISTOGRAM_GREEN = 2,
GIMP_HISTOGRAM_BLUE = 3,
GIMP_HISTOGRAM_ALPHA = 4
} GimpHistogramChannel;
#endif /* __BASE_ENUMS_H__ */
......@@ -39,37 +39,7 @@
#define ALPHA_I_PIX 1
/* enums */
/* Types of convolutions */
typedef enum
{
GIMP_NORMAL_CONVOL, /* Negative numbers truncated */
GIMP_ABSOLUTE_CONVOL, /* Absolute value */
GIMP_NEGATIVE_CONVOL /* add 127 to values */
} GimpConvolutionType;
typedef enum
{
GIMP_VALUE_LUT,
GIMP_RED_LUT,
GIMP_GREEN_LUT,
GIMP_BLUE_LUT,
GIMP_ALPHA_LUT,
GIMP_GRAY_LUT = 0 /*< skip >*/
} GimpChannelLutType;
typedef enum /*< pdb-skip >*/
{
GIMP_HISTOGRAM_VALUE = 0,
GIMP_HISTOGRAM_RED = 1,
GIMP_HISTOGRAM_GREEN = 2,
GIMP_HISTOGRAM_BLUE = 3,
GIMP_HISTOGRAM_ALPHA = 4
} GimpHistogramChannel;
/* types */
/* types */
typedef struct _BoundSeg BoundSeg;
......
......@@ -19,8 +19,22 @@
#ifndef __CORE_ENUMS_H__
#define __CORE_ENUMS_H__
/* These enums that are registered with the type system. */
#if 0
This file is parsed by two scripts, enumgen.pl in tools/pdbgen
and glib-mkenums. All enums that are not marked with /*< pdb-skip >*/
are exported to libgimp and the PDB. Enums that are not marked with
/*< skip >*/ are registered with the GType system. If you want the
enum to be skipped by both scripts, you have to use /*< pdb-skip >*/
_before_ /*< skip >*/.
All enum values that are marked with /*< skip >*/ are skipped for
both targets.
#endif
/*
* these enums that are registered with the type system
*/
#define GIMP_TYPE_IMAGE_BASE_TYPE (gimp_image_base_type_get_type ())
......@@ -38,7 +52,7 @@ typedef enum
GType gimp_preview_size_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
typedef enum /*< pdb-skip >*/
{
GIMP_PREVIEW_SIZE_NONE = 0,
GIMP_PREVIEW_SIZE_TINY = 16,
......@@ -52,4 +66,42 @@ typedef enum /*< pdb-skip >*/
GIMP_PREVIEW_SIZE_GIGANTIC = 256
} GimpPreviewSize;
/*
* non-registered enums; register them if needed
*/
typedef enum /*< skip >*/
{
GIMP_RGB_IMAGE,
GIMP_RGBA_IMAGE,
GIMP_GRAY_IMAGE,
GIMP_GRAYA_IMAGE,
GIMP_INDEXED_IMAGE,
GIMP_INDEXEDA_IMAGE
} GimpImageType;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_SELECTION_OFF,
GIMP_SELECTION_LAYER_OFF,
GIMP_SELECTION_ON,
GIMP_SELECTION_PAUSE,
GIMP_SELECTION_RESUME
} GimpSelectionControl;
typedef enum /*< skip >*/
{
GIMP_SHADOWS,
GIMP_MIDTONES,
GIMP_HIGHLIGHTS
} GimpTransferMode;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_TRANSFORM_FORWARD,
GIMP_TRANSFORM_BACKWARD
} GimpTransformDirection;
#endif /* __CORE_TYPES_H__ */
......@@ -34,16 +34,6 @@
/* enums */
typedef enum
{
RGB_GIMAGE, /*< nick=RGB_IMAGE >*/
RGBA_GIMAGE, /*< nick=RGBA_IMAGE >*/
GRAY_GIMAGE, /*< nick=GRAY_IMAGE >*/
GRAYA_GIMAGE, /*< nick=GRAYA_IMAGE >*/
INDEXED_GIMAGE, /*< nick=INDEXED_IMAGE >*/
INDEXEDA_GIMAGE /*< nick=INDEXEDA_IMAGE >*/
} GimpImageType;
typedef enum
{
RED_CHANNEL,
......@@ -92,15 +82,6 @@ typedef enum /*< chop=CHANNEL_OP_ >*/
CHANNEL_OP_INTERSECT
} ChannelOps;
typedef enum /*< pdb-skip >*/
{
GIMP_SELECTION_OFF,
GIMP_SELECTION_LAYER_OFF,
GIMP_SELECTION_ON,
GIMP_SELECTION_PAUSE,
GIMP_SELECTION_RESUME
} GimpSelectionControl;
typedef enum
{
FOREGROUND_FILL, /*< nick=FG_IMAGE_FILL >*/
......@@ -110,13 +91,6 @@ typedef enum
NO_FILL /*< nick=NO_IMAGE_FILL >*/
} GimpFillType;
typedef enum
{
GIMP_SHADOWS,
GIMP_MIDTONES,
GIMP_HIGHLIGHTS
} GimpTransferMode;
typedef enum
{
OFFSET_BACKGROUND,
......@@ -203,12 +177,6 @@ typedef enum
REPEAT_TRIANGULAR
} RepeatMode;
typedef enum /*< pdb-skip >*/
{
GIMP_TRANSFORM_FORWARD,
GIMP_TRANSFORM_BACKWARD
} GimpTransformDirection;
/* base objects */
......
......@@ -132,15 +132,15 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
switch (gimp_drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE:
bg_col[ALPHA_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_PIX;
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE:
bg_col[ALPHA_G_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_G_PIX;
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE:
bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_I_PIX;
/* If the gimage is indexed color, ignore smoothing value */
......
......@@ -168,7 +168,7 @@ gimp_channel_new (GimpImage *gimage,
channel = g_object_new (GIMP_TYPE_CHANNEL, NULL);
gimp_drawable_configure (GIMP_DRAWABLE (channel),
gimage, width, height, GRAY_GIMAGE, name);
gimage, width, height, GIMP_GRAY_IMAGE, name);
/* set the channel color and opacity */
channel->color = *color;
......
......@@ -168,7 +168,7 @@ gimp_channel_new (GimpImage *gimage,
channel = g_object_new (GIMP_TYPE_CHANNEL, NULL);
gimp_drawable_configure (GIMP_DRAWABLE (channel),
gimage, width, height, GRAY_GIMAGE, name);
gimage, width, height, GIMP_GRAY_IMAGE, name);
/* set the channel color and opacity */
channel->color = *color;
......
......@@ -116,17 +116,17 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
{
switch (gimp_drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE:
type = GIMP_RGB;
bytes = gimp_drawable_bytes (drawable);
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE:
type = GIMP_GRAY;
bytes = gimp_drawable_bytes (drawable);
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE:
type = GIMP_INDEXED;
bytes = (gimp_drawable_type (drawable) == INDEXED_GIMAGE) ? 3 : 4;
bytes = (gimp_drawable_type (drawable) == GIMP_INDEXED_IMAGE) ? 3 : 4;
break;
}
......
......@@ -132,15 +132,15 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
switch (gimp_drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE:
bg_col[ALPHA_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_PIX;
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE:
bg_col[ALPHA_G_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_G_PIX;
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE:
bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_I_PIX;
/* If the gimage is indexed color, ignore smoothing value */
......
......@@ -348,17 +348,17 @@ gimp_drawable_configure (GimpDrawable *drawable,
switch (type)
{
case RGB_GIMAGE:
case GIMP_RGB_IMAGE:
bpp = 3; alpha = FALSE; break;
case GRAY_GIMAGE:
case GIMP_GRAY_IMAGE:
bpp = 1; alpha = FALSE; break;
case RGBA_GIMAGE:
case GIMP_RGBA_IMAGE:
bpp = 4; alpha = TRUE; break;
case GRAYA_GIMAGE:
case GIMP_GRAYA_IMAGE:
bpp = 2; alpha = TRUE; break;
case INDEXED_GIMAGE:
case GIMP_INDEXED_IMAGE:
bpp = 1; alpha = FALSE; break;
case INDEXEDA_GIMAGE:
case GIMP_INDEXEDA_IMAGE:
bpp = 2; alpha = TRUE; break;
default:
g_warning ("%s: Layer type %d not supported.",
......@@ -522,34 +522,34 @@ gimp_drawable_fill (GimpDrawable *drawable,
switch (gimp_drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE:
gimp_rgba_get_uchar (color,
&c[RED_PIX],
&c[GREEN_PIX],
&c[BLUE_PIX],
&c[ALPHA_PIX]);
if (gimp_drawable_type (drawable) != RGBA_GIMAGE)
if (gimp_drawable_type (drawable) != GIMP_RGBA_IMAGE)
c[ALPHA_PIX] = 255;
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE:
gimp_rgba_get_uchar (color,
&c[GRAY_PIX],
NULL,
NULL,
&c[ALPHA_G_PIX]);
if (gimp_drawable_type (drawable) != GRAYA_GIMAGE)
if (gimp_drawable_type (drawable) != GIMP_GRAYA_IMAGE)
c[ALPHA_G_PIX] = 255;
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE:
gimp_rgb_get_uchar (color,
&c[RED_PIX],
&c[GREEN_PIX],
&c[BLUE_PIX]);
gimp_image_transform_color (gimage, drawable, c, &i, GIMP_RGB);
c[INDEXED_PIX] = i;
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE)
if (gimp_drawable_type (drawable) == GIMP_INDEXEDA_IMAGE)
gimp_rgba_get_uchar (color,
NULL,
NULL,
......@@ -697,14 +697,14 @@ gimp_drawable_type_with_alpha (const GimpDrawable *drawable)
{
switch (type)
{
case RGB_GIMAGE:
return RGBA_GIMAGE;
case GIMP_RGB_IMAGE:
return GIMP_RGBA_IMAGE;
break;
case GRAY_GIMAGE:
return GRAYA_GIMAGE;
case GIMP_GRAY_IMAGE:
return GIMP_GRAYA_IMAGE;
break;
case INDEXED_GIMAGE:
return INDEXEDA_GIMAGE;
case GIMP_INDEXED_IMAGE:
return GIMP_INDEXEDA_IMAGE;
break;
default:
g_assert_not_reached ();
......@@ -908,8 +908,8 @@ gimp_drawable_is_rgb (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == RGBA_GIMAGE ||
gimp_drawable_type (drawable) == RGB_GIMAGE)
if (gimp_drawable_type (drawable) == GIMP_RGBA_IMAGE ||
gimp_drawable_type (drawable) == GIMP_RGB_IMAGE)
return TRUE;
else
return FALSE;
......@@ -920,8 +920,8 @@ gimp_drawable_is_gray (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == GRAYA_GIMAGE ||
gimp_drawable_type (drawable) == GRAY_GIMAGE)
if (gimp_drawable_type (drawable) == GIMP_GRAYA_IMAGE ||
gimp_drawable_type (drawable) == GIMP_GRAY_IMAGE)
return TRUE;
else
return FALSE;
......@@ -932,8 +932,8 @@ gimp_drawable_is_indexed (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE ||
gimp_drawable_type (drawable) == INDEXED_GIMAGE)
if (gimp_drawable_type (drawable) == GIMP_INDEXEDA_IMAGE ||
gimp_drawable_type (drawable) == GIMP_INDEXED_IMAGE)
return TRUE;
else
return FALSE;
......
......@@ -102,9 +102,9 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage,
pixel_region_init (&srcPR, gimp_image_projection (gimage), 0, 0,
gimage->width, gimage->height, FALSE);
type = gimp_image_projection_type (gimage);
has_alpha = (type == RGBA_GIMAGE ||
type == GRAYA_GIMAGE ||
type == INDEXEDA_GIMAGE);
has_alpha = (type == GIMP_RGBA_IMAGE ||
type == GIMP_GRAYA_IMAGE ||
type == GIMP_INDEXEDA_IMAGE);
}
else
{
......@@ -181,10 +181,10 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage,
{
bytes = gimp_image_projection_bytes (gimage);
d_type = gimp_image_projection_type (gimage);
has_alpha = (d_type == RGBA_GIMAGE ||
d_type == GRAYA_GIMAGE ||
d_type == INDEXEDA_GIMAGE);
indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE;
has_alpha = (d_type == GIMP_RGBA_IMAGE ||
d_type == GIMP_GRAYA_IMAGE ||
d_type == GIMP_INDEXEDA_IMAGE);
indexed = d_type == GIMP_INDEXEDA_IMAGE || d_type == GIMP_INDEXED_IMAGE;
width = gimage->width;
height = gimage->height;
pixel_region_init (&imagePR, gimp_image_projection (gimage),
......
......@@ -688,7 +688,7 @@ gimp_image_convert (GimpImage *gimage,
g_return_if_fail (GIMP_IS_IMAGE (gimage));
quantobj = NULL;
new_layer_type = RGBA_GIMAGE;
new_layer_type = GIMP_RGBA_IMAGE;
new_layer_bytes = 4;
theCustomPalette = custom_palette;
......@@ -816,15 +816,15 @@ gimp_image_convert (GimpImage *gimage,
switch (new_type)
{
case GIMP_RGB:
new_layer_type = (has_alpha) ? RGBA_GIMAGE : RGB_GIMAGE;
new_layer_type = (has_alpha) ? GIMP_RGBA_IMAGE : GIMP_RGB_IMAGE;
new_layer_bytes = (has_alpha) ? 4 : 3;
break;
case GIMP_GRAY:
new_layer_type = (has_alpha) ? GRAYA_GIMAGE : GRAY_GIMAGE;
new_layer_type = (has_alpha) ? GIMP_GRAYA_IMAGE : GIMP_GRAY_IMAGE;
new_layer_bytes = (has_alpha) ? 2 : 1;
break;
case GIMP_INDEXED:
new_layer_type = (has_alpha) ? INDEXEDA_GIMAGE : INDEXED_GIMAGE;
new_layer_type = (has_alpha) ? GIMP_INDEXEDA_IMAGE : GIMP_INDEXED_IMAGE;
new_layer_bytes = (has_alpha) ? 2 : 1;
break;
default:
......
......@@ -238,15 +238,15 @@ gimp_image_mask_extract (GimpImage *gimage,
/* How many bytes in the temp buffer? */
switch (gimp_drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE:
bytes = add_alpha ? 4 : drawable->bytes;
type = GIMP_RGB;
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE:
bytes = add_alpha ? 2 : drawable->bytes;