Misc changes for .18

* app/indexed_palette.c: fix for wrong color selected in indexed
        palette dialog

        * app/xcf.c: don't crash on bad input (0 byte files)

        * app/plug_in.h
        * app/plug_in.c: fixes Gimp's most obscure bug. Failed plugin
        queries are handle correctly now

        * app/commands.c: added marching ants speed to preferences

        * plug-ins/tiff/tiff.c: correction for inversion for MINISWHITE
        images without alpha

        * plug-ins/pcx/pcx.c: updated to new version

        * app/paint_funcs.h: changed OPAQUE and TRANSPARENT to
        OPAQUE_OPACITY and TRANSPARENT_OPACITY to avoid possible
        conflicts. All affects .c files changed.

-Yosh
This commit is contained in:
Manish Singh 1998-01-25 01:24:46 +00:00
parent 3014db05f3
commit 2ce0e15023
109 changed files with 1011 additions and 1370 deletions

View File

@ -1,3 +1,25 @@
Sat Jan 24 17:23:13 PST 1998 Manish Singh <yosh@gimp.org>
* app/indexed_palette.c: fix for wrong color selected in indexed
palette dialog
* app/xcf.c: don't crash on bad input (0 byte files)
* app/plug_in.h
* app/plug_in.c: fixes Gimp's most obscure bug. Failed plugin
queries are handle correctly now
* app/commands.c: added marching ants speed to preferences
* plug-ins/tiff/tiff.c: correction for inversion for MINISWHITE
images without alpha
* plug-ins/pcx/pcx.c: updated to new version
* app/paint_funcs.h: changed OPAQUE and TRANSPARENT to
OPAQUE_OPACITY and TRANSPARENT_OPACITY to avoid possible
conflicts. All affects .c files changed.
Sat Jan 24 15:16:40 1998 Scott Goehring <scott@poverty.bloomington.in.us>
* app/app_procs.c (make_initialization_status_window): Changed
@ -25,22 +47,6 @@ Tue Jan 13 21:36:07 PST 1998 Manish Singh <yosh@gimp.org>
* ltconfig
* ltmain.sh: downgraded to libtool 1.0f at Jay's suggestion
* app/gimage.c: Fix for the "merge to alpha" bug from Nathan
Summers
* app/text_tool.c: Fix for the font spec bug from Nathan
Summers
* plug-ins/maze/maze.c
* plug-ins/rotate/rotate.c: updated from registry
* plug-ins/blur/blur.c
* plug-ins/randomize/randomize.c
* plug-ins/vpropagate/vpropagate.c
* plug-ins/warp/warp.c: more portability fixes for DEC OSF1
Mon Jan 12 14:49:19 1998 Scott Goehring <scott@poverty.bloomington.in.us>
* plug-ins/fractaltrace/fractaltrace.c (query): ymax argument was
listed twice. Fixed.

View File

@ -111,6 +111,7 @@ static GtkWidget *prefs_dlg = NULL;
static int old_transparency_type;
static int old_transparency_size;
static int old_levels_of_undo;
static int old_marching_speed;
static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
@ -206,7 +207,7 @@ file_new_ok_callback (GtkWidget *widget,
/* Make the background (or first) layer */
layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, "Background", OPAQUE, NORMAL);
type, "Background", OPAQUE_OPACITY, NORMAL);
if (layer) {
/* add the new layer to the gimage */
@ -512,8 +513,8 @@ file_save_as_cmd_callback (GtkWidget *widget,
Still no settings for default-brush, default-gradient,
default-palette, default-pattern, gamma-correction, color-cube,
marching-ants-speed, show-rulers, ruler-units. No widget for
confirm-on-close although a lot of stuff is there.
show-rulers, ruler-units. No widget for confirm-on-close although
a lot of stuff is there.
No UI feedback for the fact that some settings won't take effect
until the next Gimp restart.
@ -567,6 +568,13 @@ file_prefs_ok_callback (GtkWidget *widget,
levels_of_undo = old_levels_of_undo;
return;
}
if (marching_speed <= 50)
{
message_box("Error: Marching speed must be 50 or greater.",
NULL, NULL);
marching_speed = old_marching_speed;
return;
}
if (default_width < 1)
{
message_box("Error: Default width must be one or greater.",
@ -626,6 +634,8 @@ file_prefs_save_callback (GtkWidget *widget,
if (levels_of_undo != old_levels_of_undo)
update = g_list_append (update, "undo-levels");
if (marching_speed != old_marching_speed)
update = g_list_append (update, "marching-ants-speed");
if (allow_resize_windows != old_allow_resize_windows)
update = g_list_append (update, "allow-resize-windows");
if (auto_save != old_auto_save)
@ -751,6 +761,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
prefs_dlg = NULL;
levels_of_undo = old_levels_of_undo;
marching_speed = old_marching_speed;
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
@ -960,6 +971,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_transparency_type = transparency_type;
old_transparency_size = transparency_size;
old_levels_of_undo = levels_of_undo;
old_marching_speed = marching_speed;
old_allow_resize_windows = allow_resize_windows;
old_auto_save = auto_save;
old_preview_size = preview_size;
@ -1287,6 +1299,9 @@ file_pref_cmd_callback (GtkWidget *widget,
sprintf (buffer, "%d", marching_speed);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
(GtkSignalFunc) file_prefs_text_callback,
&marching_speed);
gtk_widget_show (entry);
label = gtk_label_new ("Interface");

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -252,7 +252,7 @@ airbrush_motion (PaintCore *paint_core,
return;
/* color the pixels */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,

View File

@ -190,7 +190,7 @@ app_init_update_status(char *label1val,
gtk_progress_bar_update(GTK_PROGRESS_BAR(pbar), pct_progress);
}
gtk_widget_draw(win_initstatus, &area);
idle_tag = gtk_idle_add(my_idle_proc, NULL);
idle_tag = gtk_idle_add((GtkFunction) my_idle_proc, NULL);
gtk_main_iteration();
gtk_idle_remove(idle_tag);
}

View File

@ -1095,7 +1095,7 @@ gradient_precalc_shapeburst (GImage *gimage,
float *distp;
int size;
void * pr;
unsigned char white[1] = { OPAQUE };
unsigned char white[1] = { OPAQUE_OPACITY };
/* allocate the distance map */
if (distR.tiles)

View File

@ -556,7 +556,7 @@ bucket_fill_line_color (buf, mask, col, has_alpha, bytes, width)
if (mask)
buf[alpha] = *mask++;
else
buf[alpha] = OPAQUE;
buf[alpha] = OPAQUE_OPACITY;
}
buf += bytes;
@ -594,7 +594,7 @@ bucket_fill_line_pattern (buf, mask, pattern, has_alpha, bytes, x, y, width)
if (mask)
buf[alpha] = *mask++;
else
buf[alpha] = OPAQUE;
buf[alpha] = OPAQUE_OPACITY;
}
buf += bytes;

View File

@ -105,7 +105,7 @@ static void
channel_validate (TileManager *tm, Tile *tile, int level)
{
/* Set the contents of the tile to empty */
memset (tile->data, TRANSPARENT, tile->ewidth * tile->eheight);
memset (tile->data, TRANSPARENT_OPACITY, tile->ewidth * tile->eheight);
}

View File

@ -373,7 +373,7 @@ offset (GImage *gimage,
{
palette_get_background (&fill[0], &fill[1], &fill[2]);
if (drawable_has_alpha (drawable))
fill[drawable_bytes (drawable) - 1] = OPAQUE;
fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
}
if (offset_x >= 0 && offset_y >= 0)

View File

@ -446,7 +446,7 @@ clone_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);
}
@ -477,7 +477,7 @@ clone_line_image (GImage *dest,
if (has_alpha)
d[dest_alpha] = s[src_alpha];
else
d[dest_alpha] = OPAQUE;
d[dest_alpha] = OPAQUE_OPACITY;
s += src_bytes;
d += dest_bytes;
@ -517,7 +517,7 @@ clone_line_pattern (GImage *dest,
gimage_transform_color (dest, drawable, p, d, color);
d[alpha] = OPAQUE;
d[alpha] = OPAQUE_OPACITY;
d += bytes;
}

View File

@ -111,6 +111,7 @@ static GtkWidget *prefs_dlg = NULL;
static int old_transparency_type;
static int old_transparency_size;
static int old_levels_of_undo;
static int old_marching_speed;
static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
@ -206,7 +207,7 @@ file_new_ok_callback (GtkWidget *widget,
/* Make the background (or first) layer */
layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, "Background", OPAQUE, NORMAL);
type, "Background", OPAQUE_OPACITY, NORMAL);
if (layer) {
/* add the new layer to the gimage */
@ -512,8 +513,8 @@ file_save_as_cmd_callback (GtkWidget *widget,
Still no settings for default-brush, default-gradient,
default-palette, default-pattern, gamma-correction, color-cube,
marching-ants-speed, show-rulers, ruler-units. No widget for
confirm-on-close although a lot of stuff is there.
show-rulers, ruler-units. No widget for confirm-on-close although
a lot of stuff is there.
No UI feedback for the fact that some settings won't take effect
until the next Gimp restart.
@ -567,6 +568,13 @@ file_prefs_ok_callback (GtkWidget *widget,
levels_of_undo = old_levels_of_undo;
return;
}
if (marching_speed <= 50)
{
message_box("Error: Marching speed must be 50 or greater.",
NULL, NULL);
marching_speed = old_marching_speed;
return;
}
if (default_width < 1)
{
message_box("Error: Default width must be one or greater.",
@ -626,6 +634,8 @@ file_prefs_save_callback (GtkWidget *widget,
if (levels_of_undo != old_levels_of_undo)
update = g_list_append (update, "undo-levels");
if (marching_speed != old_marching_speed)
update = g_list_append (update, "marching-ants-speed");
if (allow_resize_windows != old_allow_resize_windows)
update = g_list_append (update, "allow-resize-windows");
if (auto_save != old_auto_save)
@ -751,6 +761,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
prefs_dlg = NULL;
levels_of_undo = old_levels_of_undo;
marching_speed = old_marching_speed;
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
@ -960,6 +971,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_transparency_type = transparency_type;
old_transparency_size = transparency_size;
old_levels_of_undo = levels_of_undo;
old_marching_speed = marching_speed;
old_allow_resize_windows = allow_resize_windows;
old_auto_save = auto_save;
old_preview_size = preview_size;
@ -1287,6 +1299,9 @@ file_pref_cmd_callback (GtkWidget *widget,
sprintf (buffer, "%d", marching_speed);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
(GtkSignalFunc) file_prefs_text_callback,
&marching_speed);
gtk_widget_show (entry);
label = gtk_label_new ("Interface");

View File

@ -326,7 +326,7 @@ convolve_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_replace_canvas (paint_core, drawable, OPAQUE,
paint_core_replace_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
SOFT, INCREMENTAL);
}

View File

@ -271,7 +271,7 @@ edit_paste (GImage *gimage,
int cx, cy;
/* Make a new floating layer */
float_layer = layer_from_tiles (gimage, drawable, paste, "Pasted Layer", OPAQUE, NORMAL);
float_layer = layer_from_tiles (gimage, drawable, paste, "Pasted Layer", OPAQUE_OPACITY, NORMAL);
if (float_layer)
{
@ -320,7 +320,7 @@ edit_clear (GImage *gimage,
gimage_get_background (gimage, drawable, col);
if (drawable_has_alpha (drawable))
col [drawable_bytes (drawable) - 1] = OPAQUE;
col [drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -332,7 +332,7 @@ edit_clear (GImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE,
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE_OPACITY,
ERASE_MODE, NULL, x1, y1);
/* update the image */
@ -358,7 +358,7 @@ edit_fill (GImage *gimage,
gimage_get_background (gimage, drawable, col);
if (drawable_has_alpha (drawable))
col [drawable_bytes (drawable) - 1] = OPAQUE;
col [drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -370,7 +370,7 @@ edit_fill (GImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE,
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE_OPACITY,
NORMAL_MODE, NULL, x1, y1);
/* update the image */

View File

@ -105,7 +105,7 @@ static void
channel_validate (TileManager *tm, Tile *tile, int level)
{
/* Set the contents of the tile to empty */
memset (tile->data, TRANSPARENT, tile->ewidth * tile->eheight);
memset (tile->data, TRANSPARENT_OPACITY, tile->ewidth * tile->eheight);
}

View File

@ -105,7 +105,7 @@ static void
channel_validate (TileManager *tm, Tile *tile, int level)
{
/* Set the contents of the tile to empty */
memset (tile->data, TRANSPARENT, tile->ewidth * tile->eheight);
memset (tile->data, TRANSPARENT_OPACITY, tile->ewidth * tile->eheight);
}

View File

@ -1095,7 +1095,7 @@ gradient_precalc_shapeburst (GImage *gimage,
float *distp;
int size;
void * pr;
unsigned char white[1] = { OPAQUE };
unsigned char white[1] = { OPAQUE_OPACITY };
/* allocate the distance map */
if (distR.tiles)

View File

@ -373,7 +373,7 @@ offset (GImage *gimage,
{
palette_get_background (&fill[0], &fill[1], &fill[2]);
if (drawable_has_alpha (drawable))
fill[drawable_bytes (drawable) - 1] = OPAQUE;
fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
}
if (offset_x >= 0 && offset_y >= 0)

View File

@ -271,7 +271,7 @@ edit_paste (GImage *gimage,
int cx, cy;
/* Make a new floating layer */
float_layer = layer_from_tiles (gimage, drawable, paste, "Pasted Layer", OPAQUE, NORMAL);
float_layer = layer_from_tiles (gimage, drawable, paste, "Pasted Layer", OPAQUE_OPACITY, NORMAL);
if (float_layer)
{
@ -320,7 +320,7 @@ edit_clear (GImage *gimage,
gimage_get_background (gimage, drawable, col);
if (drawable_has_alpha (drawable))
col [drawable_bytes (drawable) - 1] = OPAQUE;
col [drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -332,7 +332,7 @@ edit_clear (GImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE,
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE_OPACITY,
ERASE_MODE, NULL, x1, y1);
/* update the image */
@ -358,7 +358,7 @@ edit_fill (GImage *gimage,
gimage_get_background (gimage, drawable, col);
if (drawable_has_alpha (drawable))
col [drawable_bytes (drawable) - 1] = OPAQUE;
col [drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -370,7 +370,7 @@ edit_fill (GImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE,
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE_OPACITY,
NORMAL_MODE, NULL, x1, y1);
/* update the image */

View File

@ -373,7 +373,7 @@ offset (GImage *gimage,
{
palette_get_background (&fill[0], &fill[1], &fill[2]);
if (drawable_has_alpha (drawable))
fill[drawable_bytes (drawable) - 1] = OPAQUE;
fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
}
if (offset_x >= 0 && offset_y >= 0)

View File

@ -341,7 +341,7 @@ gimage_mask_float (gimage, drawable, off_x, off_y)
tiles = gimage_mask_extract (gimage, drawable, TRUE, FALSE);
/* Create a new layer from the buffer */
layer = layer_from_tiles (gimage, drawable, tiles, "Floated Layer", OPAQUE, NORMAL);
layer = layer_from_tiles (gimage, drawable, tiles, "Floated Layer", OPAQUE_OPACITY, NORMAL);
/* Set the offsets */
GIMP_DRAWABLE(layer)->offset_x = tiles->x + off_x;
@ -628,14 +628,14 @@ gimage_mask_stroke_paint_func (paint_core, drawable, state)
return NULL;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);

View File

@ -79,7 +79,7 @@ image_map_do (gpointer data)
/* apply the results */
pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE);
gimage_apply_image (gimage, _image_map->drawable, &shadowPR,
FALSE, OPAQUE, REPLACE_MODE, NULL, x, y);
FALSE, OPAQUE_OPACITY, REPLACE_MODE, NULL, x, y);
/* display the results */
if (_image_map->gdisp)

View File

@ -430,15 +430,15 @@ layer_create_mask (layer, add_mask_type)
LayerMask *mask;
char * mask_name;
unsigned char black[3] = {0, 0, 0};
unsigned char white_mask = OPAQUE;
unsigned char black_mask = TRANSPARENT;
unsigned char white_mask = OPAQUE_OPACITY;
unsigned char black_mask = TRANSPARENT_OPACITY;
mask_name = (char *) g_malloc (strlen (GIMP_DRAWABLE(layer)->name) + strlen ("mask") + 2);
sprintf (mask_name, "%s mask", GIMP_DRAWABLE(layer)->name);
/* Create the layer mask */
mask = layer_mask_new (GIMP_DRAWABLE(layer)->gimage_ID, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height,
mask_name, OPAQUE, black);
mask_name, OPAQUE_OPACITY, black);
GIMP_DRAWABLE(mask)->offset_x = GIMP_DRAWABLE(layer)->offset_x;
GIMP_DRAWABLE(mask)->offset_y = GIMP_DRAWABLE(layer)->offset_y;
@ -540,7 +540,7 @@ layer_apply_mask (layer, mode)
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
pixel_region_init (&maskPR, GIMP_DRAWABLE(layer->mask)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
GIMP_DRAWABLE(layer)->preview_valid = FALSE;
layer->mask = NULL;

View File

@ -165,7 +165,7 @@ drawable_merge_shadow (GimpDrawable *drawable, int undo)
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&shadowPR, gimage->shadow, x1, y1,
(x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &shadowPR, undo, OPAQUE,
gimage_apply_image (gimage, drawable, &shadowPR, undo, OPAQUE_OPACITY,
REPLACE_MODE, NULL, x1, y1);
}

View File

@ -105,14 +105,14 @@ eraser_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
ERASE_MODE, SOFT, CONSTANT);
}

View File

@ -690,7 +690,7 @@ gimage_replace_image (GImage *gimage, GimpDrawable *drawable, PixelRegion *src2P
tempPR.h = y2 - y1;
tempPR.data = temp_data;
apply_mask_to_region (&tempPR, maskPR, OPAQUE);
apply_mask_to_region (&tempPR, maskPR, OPAQUE_OPACITY);
tempPR.x = 0;
tempPR.y = 0;
@ -1943,7 +1943,7 @@ gimage_merge_layers (GImage *gimage, link_ptr merge_list, MergeType merge_type)
case INDEXED: type = INDEXED_GIMAGE; break;
}
merge_layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, drawable_name (GIMP_DRAWABLE(layer)), OPAQUE, NORMAL_MODE);
type, drawable_name (GIMP_DRAWABLE(layer)), OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) {
warning("gimage_merge_layers: could not allocate merge layer");
@ -2479,7 +2479,7 @@ gimage_is_flat (GImage *gimage)
/* What makes a flat image?
* 1) the solitary layer is exactly gimage-sized and placed
* 2) no layer mask
* 3) opacity == OPAQUE
* 3) opacity == OPAQUE_OPACITY
* 4) all channels must be visible
*/
drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
@ -2488,7 +2488,7 @@ gimage_is_flat (GImage *gimage)
(off_x != 0) ||
(off_y != 0) ||
(layer->mask != NULL) ||
(layer->opacity != OPAQUE) ||
(layer->opacity != OPAQUE_OPACITY) ||
(ac_visible == FALSE))
flat = FALSE;
}
@ -2698,17 +2698,17 @@ gimage_projection_opacity (GImage *gimage)
Layer * layer;
/* If the gimage is flat, return the opacity of the active layer
* Otherwise, we'll pass back OPAQUE
* Otherwise, we'll pass back OPAQUE_OPACITY
*/
if (gimage_is_flat (gimage))
{
if ((layer = (gimage->active_layer)))
return layer->opacity;
else
return OPAQUE;
return OPAQUE_OPACITY;
}
else
return OPAQUE;
return OPAQUE_OPACITY;
}
void

View File

@ -341,7 +341,7 @@ gimage_mask_float (gimage, drawable, off_x, off_y)
tiles = gimage_mask_extract (gimage, drawable, TRUE, FALSE);
/* Create a new layer from the buffer */
layer = layer_from_tiles (gimage, drawable, tiles, "Floated Layer", OPAQUE, NORMAL);
layer = layer_from_tiles (gimage, drawable, tiles, "Floated Layer", OPAQUE_OPACITY, NORMAL);
/* Set the offsets */
GIMP_DRAWABLE(layer)->offset_x = tiles->x + off_x;
@ -628,14 +628,14 @@ gimage_mask_stroke_paint_func (paint_core, drawable, state)
return NULL;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);

View File

@ -105,7 +105,7 @@ static void
channel_validate (TileManager *tm, Tile *tile, int level)
{
/* Set the contents of the tile to empty */
memset (tile->data, TRANSPARENT, tile->ewidth * tile->eheight);
memset (tile->data, TRANSPARENT_OPACITY, tile->ewidth * tile->eheight);
}

View File

@ -373,7 +373,7 @@ offset (GImage *gimage,
{
palette_get_background (&fill[0], &fill[1], &fill[2]);
if (drawable_has_alpha (drawable))
fill[drawable_bytes (drawable) - 1] = OPAQUE;
fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
}
if (offset_x >= 0 && offset_y >= 0)

View File

@ -373,7 +373,7 @@ offset (GImage *gimage,
{
palette_get_background (&fill[0], &fill[1], &fill[2]);
if (drawable_has_alpha (drawable))
fill[drawable_bytes (drawable) - 1] = OPAQUE;
fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
}
if (offset_x >= 0 && offset_y >= 0)

View File

@ -430,15 +430,15 @@ layer_create_mask (layer, add_mask_type)
LayerMask *mask;
char * mask_name;
unsigned char black[3] = {0, 0, 0};
unsigned char white_mask = OPAQUE;
unsigned char black_mask = TRANSPARENT;
unsigned char white_mask = OPAQUE_OPACITY;
unsigned char black_mask = TRANSPARENT_OPACITY;
mask_name = (char *) g_malloc (strlen (GIMP_DRAWABLE(layer)->name) + strlen ("mask") + 2);
sprintf (mask_name, "%s mask", GIMP_DRAWABLE(layer)->name);
/* Create the layer mask */
mask = layer_mask_new (GIMP_DRAWABLE(layer)->gimage_ID, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height,
mask_name, OPAQUE, black);
mask_name, OPAQUE_OPACITY, black);
GIMP_DRAWABLE(mask)->offset_x = GIMP_DRAWABLE(layer)->offset_x;
GIMP_DRAWABLE(mask)->offset_y = GIMP_DRAWABLE(layer)->offset_y;
@ -540,7 +540,7 @@ layer_apply_mask (layer, mode)
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
pixel_region_init (&maskPR, GIMP_DRAWABLE(layer->mask)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
GIMP_DRAWABLE(layer)->preview_valid = FALSE;
layer->mask = NULL;

View File

@ -271,7 +271,7 @@ edit_paste (GImage *gimage,
int cx, cy;
/* Make a new floating layer */
float_layer = layer_from_tiles (gimage, drawable, paste, "Pasted Layer", OPAQUE, NORMAL);
float_layer = layer_from_tiles (gimage, drawable, paste, "Pasted Layer", OPAQUE_OPACITY, NORMAL);
if (float_layer)
{
@ -320,7 +320,7 @@ edit_clear (GImage *gimage,
gimage_get_background (gimage, drawable, col);
if (drawable_has_alpha (drawable))
col [drawable_bytes (drawable) - 1] = OPAQUE;
col [drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -332,7 +332,7 @@ edit_clear (GImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE,
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE_OPACITY,
ERASE_MODE, NULL, x1, y1);
/* update the image */
@ -358,7 +358,7 @@ edit_fill (GImage *gimage,
gimage_get_background (gimage, drawable, col);
if (drawable_has_alpha (drawable))
col [drawable_bytes (drawable) - 1] = OPAQUE;
col [drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -370,7 +370,7 @@ edit_fill (GImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE,
gimage_apply_image (gimage, drawable, &bufPR, 1, OPAQUE_OPACITY,
NORMAL_MODE, NULL, x1, y1);
/* update the image */

View File

@ -111,6 +111,7 @@ static GtkWidget *prefs_dlg = NULL;
static int old_transparency_type;
static int old_transparency_size;
static int old_levels_of_undo;
static int old_marching_speed;
static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
@ -206,7 +207,7 @@ file_new_ok_callback (GtkWidget *widget,
/* Make the background (or first) layer */
layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, "Background", OPAQUE, NORMAL);
type, "Background", OPAQUE_OPACITY, NORMAL);
if (layer) {
/* add the new layer to the gimage */
@ -512,8 +513,8 @@ file_save_as_cmd_callback (GtkWidget *widget,
Still no settings for default-brush, default-gradient,
default-palette, default-pattern, gamma-correction, color-cube,
marching-ants-speed, show-rulers, ruler-units. No widget for
confirm-on-close although a lot of stuff is there.
show-rulers, ruler-units. No widget for confirm-on-close although
a lot of stuff is there.
No UI feedback for the fact that some settings won't take effect
until the next Gimp restart.
@ -567,6 +568,13 @@ file_prefs_ok_callback (GtkWidget *widget,
levels_of_undo = old_levels_of_undo;
return;
}
if (marching_speed <= 50)
{
message_box("Error: Marching speed must be 50 or greater.",
NULL, NULL);
marching_speed = old_marching_speed;
return;
}
if (default_width < 1)
{
message_box("Error: Default width must be one or greater.",
@ -626,6 +634,8 @@ file_prefs_save_callback (GtkWidget *widget,
if (levels_of_undo != old_levels_of_undo)
update = g_list_append (update, "undo-levels");
if (marching_speed != old_marching_speed)
update = g_list_append (update, "marching-ants-speed");
if (allow_resize_windows != old_allow_resize_windows)
update = g_list_append (update, "allow-resize-windows");
if (auto_save != old_auto_save)
@ -751,6 +761,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
prefs_dlg = NULL;
levels_of_undo = old_levels_of_undo;
marching_speed = old_marching_speed;
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
@ -960,6 +971,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_transparency_type = transparency_type;
old_transparency_size = transparency_size;
old_levels_of_undo = levels_of_undo;
old_marching_speed = marching_speed;
old_allow_resize_windows = allow_resize_windows;
old_auto_save = auto_save;
old_preview_size = preview_size;
@ -1287,6 +1299,9 @@ file_pref_cmd_callback (GtkWidget *widget,
sprintf (buffer, "%d", marching_speed);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
(GtkSignalFunc) file_prefs_text_callback,
&marching_speed);
gtk_widget_show (entry);
label = gtk_label_new ("Interface");

View File

@ -111,6 +111,7 @@ static GtkWidget *prefs_dlg = NULL;
static int old_transparency_type;
static int old_transparency_size;
static int old_levels_of_undo;
static int old_marching_speed;
static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
@ -206,7 +207,7 @@ file_new_ok_callback (GtkWidget *widget,
/* Make the background (or first) layer */
layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, "Background", OPAQUE, NORMAL);
type, "Background", OPAQUE_OPACITY, NORMAL);
if (layer) {
/* add the new layer to the gimage */
@ -512,8 +513,8 @@ file_save_as_cmd_callback (GtkWidget *widget,
Still no settings for default-brush, default-gradient,
default-palette, default-pattern, gamma-correction, color-cube,
marching-ants-speed, show-rulers, ruler-units. No widget for
confirm-on-close although a lot of stuff is there.
show-rulers, ruler-units. No widget for confirm-on-close although
a lot of stuff is there.
No UI feedback for the fact that some settings won't take effect
until the next Gimp restart.
@ -567,6 +568,13 @@ file_prefs_ok_callback (GtkWidget *widget,
levels_of_undo = old_levels_of_undo;
return;
}
if (marching_speed <= 50)
{
message_box("Error: Marching speed must be 50 or greater.",
NULL, NULL);
marching_speed = old_marching_speed;
return;
}
if (default_width < 1)
{
message_box("Error: Default width must be one or greater.",
@ -626,6 +634,8 @@ file_prefs_save_callback (GtkWidget *widget,
if (levels_of_undo != old_levels_of_undo)
update = g_list_append (update, "undo-levels");
if (marching_speed != old_marching_speed)
update = g_list_append (update, "marching-ants-speed");
if (allow_resize_windows != old_allow_resize_windows)
update = g_list_append (update, "allow-resize-windows");
if (auto_save != old_auto_save)
@ -751,6 +761,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
prefs_dlg = NULL;
levels_of_undo = old_levels_of_undo;
marching_speed = old_marching_speed;
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
@ -960,6 +971,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_transparency_type = transparency_type;
old_transparency_size = transparency_size;
old_levels_of_undo = levels_of_undo;
old_marching_speed = marching_speed;
old_allow_resize_windows = allow_resize_windows;
old_auto_save = auto_save;
old_preview_size = preview_size;
@ -1287,6 +1299,9 @@ file_pref_cmd_callback (GtkWidget *widget,
sprintf (buffer, "%d", marching_speed);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
(GtkSignalFunc) file_prefs_text_callback,
&marching_speed);
gtk_widget_show (entry);
label = gtk_label_new ("Interface");

View File

@ -2865,7 +2865,7 @@ new_layer_query_ok_callback (GtkWidget *w,
layer = layer_new (gimage->ID, options->xsize, options->ysize,
gimage_base_type_with_alpha (gimage),
layer_name, OPAQUE, NORMAL_MODE);
layer_name, OPAQUE_OPACITY, NORMAL_MODE);
if (layer)
{
drawable_fill (GIMP_DRAWABLE(layer), fill_type);

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -79,7 +79,7 @@ image_map_do (gpointer data)
/* apply the results */
pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE);
gimage_apply_image (gimage, _image_map->drawable, &shadowPR,
FALSE, OPAQUE, REPLACE_MODE, NULL, x, y);
FALSE, OPAQUE_OPACITY, REPLACE_MODE, NULL, x, y);
/* display the results */
if (_image_map->gdisp)

View File

@ -393,7 +393,7 @@ indexed_palette_area_events (GtkWidget *widget,
{
GImage *gimage;
GdkEventButton *bevent;
int r, g, b;
guchar r, g, b;
if (!indexedP)
return FALSE;
@ -408,7 +408,7 @@ indexed_palette_area_events (GtkWidget *widget,
if (bevent->button == 1)
{
indexedP->col_index = 16 * (bevent->y / CELL_HEIGHT) + (bevent->x / CELL_WIDTH);
indexedP->col_index = 16 * ((int)bevent->y / CELL_HEIGHT) + ((int)bevent->x / CELL_WIDTH);
r = gimage->cmap[indexedP->col_index * 3 + 0];
g = gimage->cmap[indexedP->col_index * 3 + 1];
b = gimage->cmap[indexedP->col_index * 3 + 2];

View File

@ -430,15 +430,15 @@ layer_create_mask (layer, add_mask_type)
LayerMask *mask;
char * mask_name;
unsigned char black[3] = {0, 0, 0};
unsigned char white_mask = OPAQUE;
unsigned char black_mask = TRANSPARENT;
unsigned char white_mask = OPAQUE_OPACITY;
unsigned char black_mask = TRANSPARENT_OPACITY;
mask_name = (char *) g_malloc (strlen (GIMP_DRAWABLE(layer)->name) + strlen ("mask") + 2);
sprintf (mask_name, "%s mask", GIMP_DRAWABLE(layer)->name);
/* Create the layer mask */
mask = layer_mask_new (GIMP_DRAWABLE(layer)->gimage_ID, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height,
mask_name, OPAQUE, black);
mask_name, OPAQUE_OPACITY, black);
GIMP_DRAWABLE(mask)->offset_x = GIMP_DRAWABLE(layer)->offset_x;
GIMP_DRAWABLE(mask)->offset_y = GIMP_DRAWABLE(layer)->offset_y;
@ -540,7 +540,7 @@ layer_apply_mask (layer, mode)
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
pixel_region_init (&maskPR, GIMP_DRAWABLE(layer->mask)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
GIMP_DRAWABLE(layer)->preview_valid = FALSE;
layer->mask = NULL;

View File

@ -2865,7 +2865,7 @@ new_layer_query_ok_callback (GtkWidget *w,
layer = layer_new (gimage->ID, options->xsize, options->ysize,
gimage_base_type_with_alpha (gimage),
layer_name, OPAQUE, NORMAL_MODE);
layer_name, OPAQUE_OPACITY, NORMAL_MODE);
if (layer)
{
drawable_fill (GIMP_DRAWABLE(layer), fill_type);

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -85,7 +85,7 @@ static int color_hash_misses;
static int color_hash_hits;
static unsigned char * tmp_buffer; /* temporary buffer available upon request */
static int tmp_buffer_size;
static unsigned char no_mask = OPAQUE;
static unsigned char no_mask = OPAQUE_OPACITY;
/*******************************/
@ -847,7 +847,7 @@ dissolve_pixels (unsigned char *src,
if (has_alpha)
dest[alpha] = (rand_val > opacity) ? 0 : src[alpha];
else
dest[alpha] = (rand_val > opacity) ? 0 : OPAQUE;
dest[alpha] = (rand_val > opacity) ? 0 : OPAQUE_OPACITY;
dest += db;
src += sb;
@ -949,7 +949,7 @@ add_alpha_pixels (unsigned char *src,
for (b = 0; b < bytes; b++)
dest[b] = src[b];
dest[b] = OPAQUE;
dest[b] = OPAQUE_OPACITY;
src += bytes;
dest += alpha;
@ -1058,7 +1058,7 @@ copy_gray_to_inten_a_pixels (unsigned char *src,
{
for (b = 0; b < alpha; b++)
dest[b] = *src;
dest[b] = OPAQUE;
dest[b] = OPAQUE_OPACITY;
src ++;
dest += bytes;
@ -1080,7 +1080,7 @@ initial_channel_pixels (unsigned char *src,
for (b = 0; b < alpha; b++)
dest[b] = src[0];
dest[alpha] = OPAQUE;
dest[alpha] = OPAQUE_OPACITY;
dest += bytes;
src ++;
@ -1105,7 +1105,7 @@ initial_indexed_pixels (unsigned char *src,
*dest++ = cmap[col_index++];
*dest++ = cmap[col_index++];
*dest++ = cmap[col_index++];
*dest++ = OPAQUE;
*dest++ = OPAQUE_OPACITY;
}
}
@ -1136,7 +1136,7 @@ initial_indexed_a_pixels (unsigned char *src,
*dest++ = cmap[col_index++];
*dest++ = cmap[col_index++];
/* Set the alpha channel */
*dest++ = (new_alpha > 127) ? OPAQUE : TRANSPARENT;
*dest++ = (new_alpha > 127) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
if (mask)
m++;
@ -1371,7 +1371,7 @@ combine_indexed_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < alpha; b++)
dest[b] = (affect[b] && new_alpha > 127) ? src2[b] : src1[b];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE : src1[alpha];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE_OPACITY : src1[alpha];
m++;
@ -1389,7 +1389,7 @@ combine_indexed_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < alpha; b++)
dest[b] = (affect[b] && new_alpha > 127) ? src2[b] : src1[b];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE : src1[alpha];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE_OPACITY : src1[alpha];
src1 += bytes;
src2 += bytes;
@ -1429,7 +1429,7 @@ combine_inten_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < bytes-1; b++)
dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
dest[b] = (new_alpha > 127) ? OPAQUE : src1[b]; /* alpha channel is opaque */
dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b]; /* alpha channel is opaque */
m++;
@ -1449,7 +1449,7 @@ combine_inten_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < bytes-1; b++)
dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
dest[b] = (new_alpha > 127) ? OPAQUE : src1[b]; /* alpha channel is opaque */
dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b]; /* alpha channel is opaque */
/* m++; /Per */
@ -1880,10 +1880,10 @@ behind_indexed_pixels (unsigned char *src1,
{
src1_alpha = src1[alpha];
src2_alpha = (src2[alpha] * *m * opacity) / 65025;
new_alpha = (src2_alpha > 127) ? OPAQUE : TRANSPARENT;
new_alpha = (src2_alpha > 127) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
for (b = 0; b < b1; b++)
dest[b] = (affect[b] && new_alpha == OPAQUE && (src1_alpha > 127)) ?
dest[b] = (affect[b] && new_alpha == OPAQUE_OPACITY && (src1_alpha > 127)) ?
src2[b] : src1[b];
if (mask)
@ -2049,7 +2049,7 @@ erase_indexed_pixels (unsigned char *src1,
dest[b] = src1[b];
src2_alpha = (src2[alpha] * *m * opacity) / 65025;
dest[alpha] = (src2_alpha > 127) ? TRANSPARENT : src1[alpha];
dest[alpha] = (src2_alpha > 127) ? TRANSPARENT_OPACITY : src1[alpha];
if (mask)
m++;

View File

@ -419,8 +419,8 @@ void rgb_to_hls (int *, int *, int *);
void hls_to_rgb (int *, int *, int *);
/* Opacities */
#define TRANSPARENT 0
#define OPAQUE 255
#define TRANSPARENT_OPACITY 0
#define OPAQUE_OPACITY 255
/* Layer Modes */
#define NORMAL_MODE 0

View File

@ -252,7 +252,7 @@ airbrush_motion (PaintCore *paint_core,
return;
/* color the pixels */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,

View File

@ -446,7 +446,7 @@ clone_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);
}
@ -477,7 +477,7 @@ clone_line_image (GImage *dest,
if (has_alpha)
d[dest_alpha] = s[src_alpha];
else
d[dest_alpha] = OPAQUE;
d[dest_alpha] = OPAQUE_OPACITY;
s += src_bytes;
d += dest_bytes;
@ -517,7 +517,7 @@ clone_line_pattern (GImage *dest,
gimage_transform_color (dest, drawable, p, d, color);
d[alpha] = OPAQUE;
d[alpha] = OPAQUE_OPACITY;
d += bytes;
}

View File

@ -326,7 +326,7 @@ convolve_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_replace_canvas (paint_core, drawable, OPAQUE,
paint_core_replace_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
SOFT, INCREMENTAL);
}

View File

@ -105,14 +105,14 @@ eraser_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
ERASE_MODE, SOFT, CONSTANT);
}

View File

@ -106,14 +106,14 @@ pencil_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), HARD, CONSTANT);
}

View File

@ -446,7 +446,7 @@ clone_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);
}
@ -477,7 +477,7 @@ clone_line_image (GImage *dest,
if (has_alpha)
d[dest_alpha] = s[src_alpha];
else
d[dest_alpha] = OPAQUE;
d[dest_alpha] = OPAQUE_OPACITY;
s += src_bytes;
d += dest_bytes;
@ -517,7 +517,7 @@ clone_line_pattern (GImage *dest,
gimage_transform_color (dest, drawable, p, d, color);
d[alpha] = OPAQUE;
d[alpha] = OPAQUE_OPACITY;
d += bytes;
}

View File

@ -761,7 +761,7 @@ paint_core_solidify_mask (brush_mask)
data++;
for (j = 0; j < brush_mask->width; j++)
{
*data++ = (*src++) ? OPAQUE : TRANSPARENT;
*data++ = (*src++) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
}
data++;
}
@ -984,7 +984,7 @@ paint_to_canvas_tiles (paint_core, brush_mask, brush_opacity)
canvas_buf->width, canvas_buf->height, FALSE);
/* apply the canvas tiles to the canvas buf */
apply_mask_to_region (&srcPR, &maskPR, OPAQUE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
}
static void

View File

@ -85,7 +85,7 @@ static int color_hash_misses;
static int color_hash_hits;
static unsigned char * tmp_buffer; /* temporary buffer available upon request */
static int tmp_buffer_size;
static unsigned char no_mask = OPAQUE;
static unsigned char no_mask = OPAQUE_OPACITY;
/*******************************/
@ -847,7 +847,7 @@ dissolve_pixels (unsigned char *src,
if (has_alpha)
dest[alpha] = (rand_val > opacity) ? 0 : src[alpha];
else
dest[alpha] = (rand_val > opacity) ? 0 : OPAQUE;
dest[alpha] = (rand_val > opacity) ? 0 : OPAQUE_OPACITY;
dest += db;
src += sb;
@ -949,7 +949,7 @@ add_alpha_pixels (unsigned char *src,
for (b = 0; b < bytes; b++)
dest[b] = src[b];
dest[b] = OPAQUE;
dest[b] = OPAQUE_OPACITY;
src += bytes;
dest += alpha;
@ -1058,7 +1058,7 @@ copy_gray_to_inten_a_pixels (unsigned char *src,
{
for (b = 0; b < alpha; b++)
dest[b] = *src;
dest[b] = OPAQUE;
dest[b] = OPAQUE_OPACITY;
src ++;
dest += bytes;
@ -1080,7 +1080,7 @@ initial_channel_pixels (unsigned char *src,
for (b = 0; b < alpha; b++)
dest[b] = src[0];
dest[alpha] = OPAQUE;
dest[alpha] = OPAQUE_OPACITY;
dest += bytes;
src ++;
@ -1105,7 +1105,7 @@ initial_indexed_pixels (unsigned char *src,
*dest++ = cmap[col_index++];
*dest++ = cmap[col_index++];
*dest++ = cmap[col_index++];
*dest++ = OPAQUE;
*dest++ = OPAQUE_OPACITY;
}
}
@ -1136,7 +1136,7 @@ initial_indexed_a_pixels (unsigned char *src,
*dest++ = cmap[col_index++];
*dest++ = cmap[col_index++];
/* Set the alpha channel */
*dest++ = (new_alpha > 127) ? OPAQUE : TRANSPARENT;
*dest++ = (new_alpha > 127) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
if (mask)
m++;
@ -1371,7 +1371,7 @@ combine_indexed_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < alpha; b++)
dest[b] = (affect[b] && new_alpha > 127) ? src2[b] : src1[b];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE : src1[alpha];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE_OPACITY : src1[alpha];
m++;
@ -1389,7 +1389,7 @@ combine_indexed_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < alpha; b++)
dest[b] = (affect[b] && new_alpha > 127) ? src2[b] : src1[b];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE : src1[alpha];
dest[alpha] = (affect[alpha] && new_alpha > 127) ? OPAQUE_OPACITY : src1[alpha];
src1 += bytes;
src2 += bytes;
@ -1429,7 +1429,7 @@ combine_inten_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < bytes-1; b++)
dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
dest[b] = (new_alpha > 127) ? OPAQUE : src1[b]; /* alpha channel is opaque */
dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b]; /* alpha channel is opaque */
m++;
@ -1449,7 +1449,7 @@ combine_inten_a_and_indexed_a_pixels (unsigned char *src1,
for (b = 0; b < bytes-1; b++)
dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
dest[b] = (new_alpha > 127) ? OPAQUE : src1[b]; /* alpha channel is opaque */
dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b]; /* alpha channel is opaque */
/* m++; /Per */
@ -1880,10 +1880,10 @@ behind_indexed_pixels (unsigned char *src1,
{
src1_alpha = src1[alpha];
src2_alpha = (src2[alpha] * *m * opacity) / 65025;
new_alpha = (src2_alpha > 127) ? OPAQUE : TRANSPARENT;
new_alpha = (src2_alpha > 127) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
for (b = 0; b < b1; b++)
dest[b] = (affect[b] && new_alpha == OPAQUE && (src1_alpha > 127)) ?
dest[b] = (affect[b] && new_alpha == OPAQUE_OPACITY && (src1_alpha > 127)) ?
src2[b] : src1[b];
if (mask)
@ -2049,7 +2049,7 @@ erase_indexed_pixels (unsigned char *src1,
dest[b] = src1[b];
src2_alpha = (src2[alpha] * *m * opacity) / 65025;
dest[alpha] = (src2_alpha > 127) ? TRANSPARENT : src1[alpha];
dest[alpha] = (src2_alpha > 127) ? TRANSPARENT_OPACITY : src1[alpha];
if (mask)
m++;

View File

@ -419,8 +419,8 @@ void rgb_to_hls (int *, int *, int *);
void hls_to_rgb (int *, int *, int *);
/* Opacities */
#define TRANSPARENT 0
#define OPAQUE 255
#define TRANSPARENT_OPACITY 0
#define OPAQUE_OPACITY 255
/* Layer Modes */
#define NORMAL_MODE 0

View File

@ -161,7 +161,7 @@ paintbrush_motion (PaintCore *paint_core,
GImage *gimage;
TempBuf * area;
double x, paint_left;
unsigned char blend = OPAQUE;
unsigned char blend = OPAQUE_OPACITY;
unsigned char col[MAX_CHANNELS];
if (! (gimage = drawable_gimage (drawable)))
@ -186,7 +186,7 @@ paintbrush_motion (PaintCore *paint_core,
if (blend)
{
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,

View File

@ -106,14 +106,14 @@ pencil_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), HARD, CONSTANT);
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1967,9 +1967,8 @@ plug_in_query (char *filename,
}
plug_in_pop ();
plug_in_destroy (plug_in);
}
plug_in_destroy (plug_in);
}
}

View File

@ -131,7 +131,10 @@ PlugIn* plug_in_new (char *name);
*/
void plug_in_destroy (PlugIn *plug_in);
/* Open a plug-in. This cause the plug-in to run. */
/* Open a plug-in. This cause the plug-in to run.
* If returns 1, you must destroy the plugin. If returns 0 you
* may not destroy the plugin.
*/
int plug_in_open (PlugIn *plug_in);
/* Close a plug-in. This kills the plug-in and releases

View File

@ -1652,18 +1652,18 @@ text_render (GImage *gimage,
if (newmask &&
(layer = layer_new (gimage->ID, newmask->levels[0].width,
newmask->levels[0].height, layer_type,
"Text Layer", OPAQUE, NORMAL_MODE)))
"Text Layer", OPAQUE_OPACITY, NORMAL_MODE)))
{
/* color the layer buffer */
gimage_get_foreground (gimage, drawable, color);
color[GIMP_DRAWABLE(layer)->bytes - 1] = OPAQUE;
color[GIMP_DRAWABLE(layer)->bytes - 1] = OPAQUE_OPACITY;
pixel_region_init (&textPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
color_region (&textPR, color);
/* apply the text mask */
pixel_region_init (&textPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
pixel_region_init (&maskPR, newmask, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
apply_mask_to_region (&textPR, &maskPR, OPAQUE);
apply_mask_to_region (&textPR, &maskPR, OPAQUE_OPACITY);
/* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO);

View File

@ -252,7 +252,7 @@ airbrush_motion (PaintCore *paint_core,
return;
/* color the pixels */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,

View File

@ -1095,7 +1095,7 @@ gradient_precalc_shapeburst (GImage *gimage,
float *distp;
int size;
void * pr;
unsigned char white[1] = { OPAQUE };
unsigned char white[1] = { OPAQUE_OPACITY };
/* allocate the distance map */
if (distR.tiles)

View File

@ -556,7 +556,7 @@ bucket_fill_line_color (buf, mask, col, has_alpha, bytes, width)
if (mask)
buf[alpha] = *mask++;
else
buf[alpha] = OPAQUE;
buf[alpha] = OPAQUE_OPACITY;
}
buf += bytes;
@ -594,7 +594,7 @@ bucket_fill_line_pattern (buf, mask, pattern, has_alpha, bytes, x, y, width)
if (mask)
buf[alpha] = *mask++;
else
buf[alpha] = OPAQUE;
buf[alpha] = OPAQUE_OPACITY;
}
buf += bytes;

View File

@ -446,7 +446,7 @@ clone_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);
}
@ -477,7 +477,7 @@ clone_line_image (GImage *dest,
if (has_alpha)
d[dest_alpha] = s[src_alpha];
else
d[dest_alpha] = OPAQUE;
d[dest_alpha] = OPAQUE_OPACITY;
s += src_bytes;
d += dest_bytes;
@ -517,7 +517,7 @@ clone_line_pattern (GImage *dest,
gimage_transform_color (dest, drawable, p, d, color);
d[alpha] = OPAQUE;
d[alpha] = OPAQUE_OPACITY;
d += bytes;
}

View File

@ -326,7 +326,7 @@ convolve_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_replace_canvas (paint_core, drawable, OPAQUE,
paint_core_replace_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
SOFT, INCREMENTAL);
}

View File

@ -105,14 +105,14 @@ eraser_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
ERASE_MODE, SOFT, CONSTANT);
}

View File

@ -252,7 +252,7 @@ airbrush_motion (PaintCore *paint_core,
return;
/* color the pixels */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,

View File

@ -1095,7 +1095,7 @@ gradient_precalc_shapeburst (GImage *gimage,
float *distp;
int size;
void * pr;
unsigned char white[1] = { OPAQUE };
unsigned char white[1] = { OPAQUE_OPACITY };
/* allocate the distance map */
if (distR.tiles)

View File

@ -556,7 +556,7 @@ bucket_fill_line_color (buf, mask, col, has_alpha, bytes, width)
if (mask)
buf[alpha] = *mask++;
else
buf[alpha] = OPAQUE;
buf[alpha] = OPAQUE_OPACITY;
}
buf += bytes;
@ -594,7 +594,7 @@ bucket_fill_line_pattern (buf, mask, pattern, has_alpha, bytes, x, y, width)
if (mask)
buf[alpha] = *mask++;
else
buf[alpha] = OPAQUE;
buf[alpha] = OPAQUE_OPACITY;
}
buf += bytes;

View File

@ -446,7 +446,7 @@ clone_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);
}
@ -477,7 +477,7 @@ clone_line_image (GImage *dest,
if (has_alpha)
d[dest_alpha] = s[src_alpha];
else
d[dest_alpha] = OPAQUE;
d[dest_alpha] = OPAQUE_OPACITY;
s += src_bytes;
d += dest_bytes;
@ -517,7 +517,7 @@ clone_line_pattern (GImage *dest,
gimage_transform_color (dest, drawable, p, d, color);
d[alpha] = OPAQUE;
d[alpha] = OPAQUE_OPACITY;
d += bytes;
}

View File

@ -326,7 +326,7 @@ convolve_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_replace_canvas (paint_core, drawable, OPAQUE,
paint_core_replace_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
SOFT, INCREMENTAL);
}

View File

@ -105,14 +105,14 @@ eraser_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
ERASE_MODE, SOFT, CONSTANT);
}

View File

@ -106,14 +106,14 @@ pencil_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), HARD, CONSTANT);
}

View File

@ -446,7 +446,7 @@ clone_motion (PaintCore *paint_core,
}
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), SOFT, CONSTANT);
}
@ -477,7 +477,7 @@ clone_line_image (GImage *dest,
if (has_alpha)
d[dest_alpha] = s[src_alpha];
else
d[dest_alpha] = OPAQUE;
d[dest_alpha] = OPAQUE_OPACITY;
s += src_bytes;
d += dest_bytes;
@ -517,7 +517,7 @@ clone_line_pattern (GImage *dest,
gimage_transform_color (dest, drawable, p, d, color);
d[alpha] = OPAQUE;
d[alpha] = OPAQUE_OPACITY;
d += bytes;
}

View File

@ -1652,18 +1652,18 @@ text_render (GImage *gimage,
if (newmask &&
(layer = layer_new (gimage->ID, newmask->levels[0].width,
newmask->levels[0].height, layer_type,
"Text Layer", OPAQUE, NORMAL_MODE)))
"Text Layer", OPAQUE_OPACITY, NORMAL_MODE)))
{
/* color the layer buffer */
gimage_get_foreground (gimage, drawable, color);
color[GIMP_DRAWABLE(layer)->bytes - 1] = OPAQUE;
color[GIMP_DRAWABLE(layer)->bytes - 1] = OPAQUE_OPACITY;
pixel_region_init (&textPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
color_region (&textPR, color);
/* apply the text mask */
pixel_region_init (&textPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
pixel_region_init (&maskPR, newmask, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
apply_mask_to_region (&textPR, &maskPR, OPAQUE);
apply_mask_to_region (&textPR, &maskPR, OPAQUE_OPACITY);
/* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO);

View File

@ -761,7 +761,7 @@ paint_core_solidify_mask (brush_mask)
data++;
for (j = 0; j < brush_mask->width; j++)
{
*data++ = (*src++) ? OPAQUE : TRANSPARENT;
*data++ = (*src++) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
}
data++;
}
@ -984,7 +984,7 @@ paint_to_canvas_tiles (paint_core, brush_mask, brush_opacity)
canvas_buf->width, canvas_buf->height, FALSE);
/* apply the canvas tiles to the canvas buf */
apply_mask_to_region (&srcPR, &maskPR, OPAQUE);
apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
}
static void

View File

@ -161,7 +161,7 @@ paintbrush_motion (PaintCore *paint_core,
GImage *gimage;
TempBuf * area;
double x, paint_left;
unsigned char blend = OPAQUE;
unsigned char blend = OPAQUE_OPACITY;
unsigned char col[MAX_CHANNELS];
if (! (gimage = drawable_gimage (drawable)))
@ -186,7 +186,7 @@ paintbrush_motion (PaintCore *paint_core,
if (blend)
{
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,

View File

@ -106,14 +106,14 @@ pencil_motion (paint_core, drawable)
return;
/* set the alpha channel */
col[area->bytes - 1] = OPAQUE;
col[area->bytes - 1] = OPAQUE_OPACITY;
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE,
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (), HARD, CONSTANT);
}

View File

@ -1652,18 +1652,18 @@ text_render (GImage *gimage,
if (newmask &&
(layer = layer_new (gimage->ID, newmask->levels[0].width,
newmask->levels[0].height, layer_type,
"Text Layer", OPAQUE, NORMAL_MODE)))
"Text Layer", OPAQUE_OPACITY, NORMAL_MODE)))
{
/* color the layer buffer */
gimage_get_foreground (gimage, drawable, color);
color[GIMP_DRAWABLE(layer)->bytes - 1] = OPAQUE;
color[GIMP_DRAWABLE(layer)->bytes - 1] = OPAQUE_OPACITY;
pixel_region_init (&textPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
color_region (&textPR, color);
/* apply the text mask */
pixel_region_init (&textPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
pixel_region_init (&maskPR, newmask, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
apply_mask_to_region (&textPR, &maskPR, OPAQUE);
apply_mask_to_region (&textPR, &maskPR, OPAQUE_OPACITY);
/* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO);

View File

@ -858,15 +858,15 @@ transform_core_do (gimage, drawable, float_tiles, interpolation, matrix)
switch (drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
bg_col[ALPHA_PIX] = TRANSPARENT;
bg_col[ALPHA_PIX] = TRANSPARENT_OPACITY;
alpha = 3;
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
bg_col[ALPHA_G_PIX] = TRANSPARENT;
bg_col[ALPHA_G_PIX] = TRANSPARENT_OPACITY;
alpha = 1;
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
bg_col[ALPHA_I_PIX] = TRANSPARENT;
bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY;
alpha = 1;
/* If the gimage is indexed color, ignore smoothing value */
interpolation = 0;
@ -1187,7 +1187,7 @@ transform_core_paste (gimage, drawable, tiles, new_layer)
if (new_layer)
{
layer = layer_from_tiles (gimage, drawable, tiles, "Transformation", OPAQUE, NORMAL_MODE);
layer = layer_from_tiles (gimage, drawable, tiles, "Transformation", OPAQUE_OPACITY, NORMAL_MODE);
GIMP_DRAWABLE(layer)->offset_x = tiles->x;
GIMP_DRAWABLE(layer)->offset_y = tiles->y;

Some files were not shown because too many files have changed in this diff Show More