Commit ce643d27 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Use gdouble in a [0.0..1.0] range for opacity values in the whole core's

2002-03-03  Michael Natterer  <mitch@gimp.org>

	Use gdouble in a [0.0..1.0] range for opacity values in the whole
	core's API. Convert them using (opacity * 255.999) when passing
	them to base/ and paint-funcs/

	Affected functions:

	* app/core/gimpchannel.[ch]: gimp_channel_[set|get]_opacity()
	* app/core/gimpimage.[ch]: gimp_image_[apply|replace]_image()
	* app/paint/gimppaintcore.[ch]: gimp_paint_core_[paste|replace]_canvas()

	* app/core/core-types.h: added defines GIMP_OPACITY_TRANSPARENT
	and GIMP_OPACITY_OPAQUE, just like the ones from
	paint-funcs/paint-funcs-types.h

	* app/gimprc.c
	* app/image_map.c
	* app/core/gimpcontext.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable.c
	* app/core/gimpedit.c
	* app/core/gimplayer.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimppalette.c
	* app/paint/gimpairbrush.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimpsmudge.c
	* app/tools/gimpinktool.c
	* app/widgets/gimpcolorpanel.c
	* app/widgets/gimplayerlistitem.c
	* app/widgets/gimppreview.c
	* app/xcf/xcf-load.c: changed accordingly, use the new constants.
parent 8a48904a
2002-03-03 Michael Natterer <mitch@gimp.org>
Use gdouble in a [0.0..1.0] range for opacity values in the whole
core's API. Convert them using (opacity * 255.999) when passing
them to base/ and paint-funcs/
Affected functions:
* app/core/gimpchannel.[ch]: gimp_channel_[set|get]_opacity()
* app/core/gimpimage.[ch]: gimp_image_[apply|replace]_image()
* app/paint/gimppaintcore.[ch]: gimp_paint_core_[paste|replace]_canvas()
* app/core/core-types.h: added defines GIMP_OPACITY_TRANSPARENT
and GIMP_OPACITY_OPAQUE, just like the ones from
paint-funcs/paint-funcs-types.h
* app/gimprc.c
* app/image_map.c
* app/core/gimpcontext.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable.c
* app/core/gimpedit.c
* app/core/gimplayer.c
* app/core/gimplayer-floating-sel.c
* app/core/gimppalette.c
* app/paint/gimpairbrush.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimppaintbrush.c
* app/paint/gimpsmudge.c
* app/tools/gimpinktool.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimplayerlistitem.c
* app/widgets/gimppreview.c
* app/xcf/xcf-load.c: changed accordingly, use the new constants.
2002-03-03 Sven Neumann <sven@gimp.org>
* plug-ins/webbrowser/Makefile.am
......
......@@ -28,6 +28,12 @@
#include "core/core-enums.h"
/* defines */
#define GIMP_OPACITY_TRANSPARENT 0.0
#define GIMP_OPACITY_OPAQUE 1.0
/* enums */
typedef enum /*< chop=ADD_ >*/
......
......@@ -302,8 +302,9 @@ gimp_edit_clear (GimpImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, OPAQUE_OPACITY,
GIMP_ERASE_MODE, NULL, x1, y1);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
GIMP_OPACITY_OPAQUE, GIMP_ERASE_MODE,
NULL, x1, y1);
/* update the image */
gimp_drawable_update (drawable,
......@@ -376,8 +377,9 @@ gimp_edit_fill (GimpImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, OPAQUE_OPACITY,
GIMP_NORMAL_MODE, NULL, x1, y1);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE,
NULL, x1, y1);
/* update the image */
gimp_drawable_update (drawable,
......
......@@ -108,7 +108,7 @@ gimp_channel_class_init (GimpChannelClass *klass)
static void
gimp_channel_init (GimpChannel *channel)
{
gimp_rgba_set (&channel->color, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&channel->color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
channel->show_masked = FALSE;
......@@ -258,23 +258,23 @@ gimp_channel_get_color (const GimpChannel *channel)
return &channel->color;
}
gint
gdouble
gimp_channel_get_opacity (const GimpChannel *channel)
{
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
return (gint) (channel->color.a * 100.999);
return channel->color.a;
}
void
gimp_channel_set_opacity (GimpChannel *channel,
gint opacity)
gdouble opacity)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
opacity = CLAMP (opacity, 0, 100);
opacity = CLAMP (opacity, GIMP_OPACITY_TRANSPARENT, GIMP_OPACITY_OPAQUE);
channel->color.a = opacity / 100.0;
channel->color.a = opacity;
}
void
......
......@@ -76,9 +76,9 @@ GimpChannel * gimp_channel_copy (const GimpChannel *channel,
GType new_type,
gboolean dummy);
gint gimp_channel_get_opacity (const GimpChannel *channel);
gdouble gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity);
gdouble opacity);
const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
......
......@@ -108,7 +108,7 @@ gimp_channel_class_init (GimpChannelClass *klass)
static void
gimp_channel_init (GimpChannel *channel)
{
gimp_rgba_set (&channel->color, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&channel->color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
channel->show_masked = FALSE;
......@@ -258,23 +258,23 @@ gimp_channel_get_color (const GimpChannel *channel)
return &channel->color;
}
gint
gdouble
gimp_channel_get_opacity (const GimpChannel *channel)
{
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
return (gint) (channel->color.a * 100.999);
return channel->color.a;
}
void
gimp_channel_set_opacity (GimpChannel *channel,
gint opacity)
gdouble opacity)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
opacity = CLAMP (opacity, 0, 100);
opacity = CLAMP (opacity, GIMP_OPACITY_TRANSPARENT, GIMP_OPACITY_OPAQUE);
channel->color.a = opacity / 100.0;
channel->color.a = opacity;
}
void
......
......@@ -76,9 +76,9 @@ GimpChannel * gimp_channel_copy (const GimpChannel *channel,
GType new_type,
gboolean dummy);
gint gimp_channel_get_opacity (const GimpChannel *channel);
gdouble gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity);
gdouble opacity);
const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
......
......@@ -653,10 +653,10 @@ gimp_context_init (GimpContext *context)
context->tool_info = NULL;
context->tool_name = NULL;
gimp_rgba_set (&context->foreground, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&context->background, 1.0, 1.0, 1.0, 1.0);
gimp_rgba_set (&context->foreground, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&context->background, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
context->opacity = 1.0;
context->opacity = GIMP_OPACITY_OPAQUE;
context->paint_mode = GIMP_NORMAL_MODE;
context->brush = NULL;
......@@ -1707,8 +1707,8 @@ gimp_context_set_default_colors (GimpContext *context)
context_find_defined (context, GIMP_CONTEXT_FOREGROUND_MASK);
context_find_defined (bg_context, GIMP_CONTEXT_BACKGROUND_MASK);
gimp_rgba_set (&fg, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&bg, 1.0, 1.0, 1.0, 1.0);
gimp_rgba_set (&fg, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&bg, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
gimp_context_real_set_foreground (context, &fg);
gimp_context_real_set_background (bg_context, &bg);
......@@ -1740,7 +1740,7 @@ gimp_context_swap_colors (GimpContext *context)
gdouble
gimp_context_get_opacity (GimpContext *context)
{
g_return_val_if_fail (GIMP_IS_CONTEXT (context), 1.0);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_OPACITY_OPAQUE);
return context->opacity;
}
......
......@@ -229,7 +229,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
opacity * 255, paint_mode,
opacity, paint_mode,
NULL, x1, y1);
/* update the image */
......
......@@ -299,8 +299,8 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable,
/* Apply it to the image */
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
opacity * 255,
paint_mode, NULL, x1, y1);
opacity, paint_mode,
NULL, x1, y1);
tile_manager_destroy (buf_tiles);
/* update the image */
......
......@@ -418,8 +418,9 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&shadowPR, gimage->shadow, x1, y1,
(x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &shadowPR, undo, OPAQUE_OPACITY,
GIMP_REPLACE_MODE, NULL, x1, y1);
gimp_image_apply_image (gimage, drawable, &shadowPR, undo,
GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE,
NULL, x1, y1);
}
void
......@@ -503,7 +504,7 @@ gimp_drawable_fill_by_type (GimpDrawable *drawable,
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
color.a = 1.0;
color.a = GIMP_OPACITY_OPAQUE;
switch (fill_type)
{
......@@ -520,7 +521,7 @@ gimp_drawable_fill_by_type (GimpDrawable *drawable,
break;
case TRANSPARENT_FILL:
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.0);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_TRANSPARENT);
break;
case NO_FILL:
......
......@@ -302,8 +302,9 @@ gimp_edit_clear (GimpImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, OPAQUE_OPACITY,
GIMP_ERASE_MODE, NULL, x1, y1);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
GIMP_OPACITY_OPAQUE, GIMP_ERASE_MODE,
NULL, x1, y1);
/* update the image */
gimp_drawable_update (drawable,
......@@ -376,8 +377,9 @@ gimp_edit_fill (GimpImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE, OPAQUE_OPACITY,
GIMP_NORMAL_MODE, NULL, x1, y1);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE,
NULL, x1, y1);
/* update the image */
gimp_drawable_update (drawable,
......
......@@ -1754,7 +1754,7 @@ gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean push_undo,
gint opacity,
gdouble opacity,
GimpLayerModeEffects mode,
/* alternative to using drawable tiles as src1: */
TileManager *src1_tiles,
......@@ -1847,12 +1847,14 @@ gimp_image_apply_image (GimpImage *gimage,
(x2 - x1), (y2 - y1),
FALSE);
combine_regions (&src1PR, src2PR, &destPR, &maskPR, NULL,
opacity, mode, active_components, operation);
opacity * 255.999, mode,
active_components, operation);
}
else
{
combine_regions (&src1PR, src2PR, &destPR, NULL, NULL,
opacity, mode, active_components, operation);
opacity * 255.999, mode,
active_components, operation);
}
}
......@@ -1867,7 +1869,7 @@ gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean push_undo,
gint opacity,
gdouble opacity,
PixelRegion *maskPR,
gint x,
gint y)
......@@ -1980,14 +1982,16 @@ gimp_image_replace_image (GimpImage *gimage,
tempPR.data = temp_data;
combine_regions_replace (&src1PR, src2PR, &destPR, &tempPR, NULL,
opacity, active_components, operation);
opacity * 255.999,
active_components, operation);
g_free (temp_data);
}
else
{
combine_regions_replace (&src1PR, src2PR, &destPR, maskPR, NULL,
opacity, active_components, operation);
opacity * 255.999,
active_components, operation);
}
}
......
......@@ -338,7 +338,7 @@ void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
gint x,
......@@ -347,7 +347,7 @@ void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
gdouble opacity,
PixelRegion *maskPR,
gint x,
gint y);
......
......@@ -411,8 +411,9 @@ image_map_do (gpointer data)
/* apply the results */
pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE);
gimp_image_apply_image (gimage, image_map->drawable, &shadowPR,
FALSE, OPAQUE_OPACITY, GIMP_REPLACE_MODE, NULL,
gimp_image_apply_image (gimage, image_map->drawable, &shadowPR, FALSE,
GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE,
NULL,
x, y);
/* display the results */
......
......@@ -466,7 +466,7 @@ floating_sel_composite (GimpLayer *layer,
*/
gimp_image_apply_image (gimage, layer->fs.drawable, &fsPR,
undo,
layer->opacity,
(gdouble) layer->opacity / 255.0,
layer->mode,
NULL,
(x1 - offx), (y1 - offy));
......
......@@ -604,7 +604,7 @@ gimp_layer_create_mask (const GimpLayer *layer,
GimpLayerMask *mask;
GimpImage *gimage;
gchar *mask_name;
GimpRGB black = { 0.0, 0.0, 0.0, 1.0 };
GimpRGB black = { 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE };
gimage = gimp_item_get_image (GIMP_ITEM (layer));
......@@ -1480,7 +1480,7 @@ gimp_layer_set_opacity (GimpLayer *layer,
gdouble
gimp_layer_get_opacity (const GimpLayer *layer)
{
g_return_val_if_fail (GIMP_IS_LAYER (layer), 1.0);
g_return_val_if_fail (GIMP_IS_LAYER (layer), GIMP_OPACITY_OPAQUE);
return (gdouble) layer->opacity / 255.0;
}
......
......@@ -576,7 +576,7 @@ gimp_palette_delete_entry (GimpPalette *palette,
{
GimpRGB color;
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_palette_add_entry (palette,
_("Black"),
......
......@@ -576,7 +576,7 @@ gimp_palette_delete_entry (GimpPalette *palette,
{
GimpRGB color;
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_palette_add_entry (palette,
_("Black"),
......
......@@ -576,7 +576,7 @@ gimp_palette_delete_entry (GimpPalette *palette,
{
GimpRGB color;
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_palette_add_entry (palette,
_("Black"),
......
......@@ -439,7 +439,7 @@ color_notebook_new (const gchar *title,
GTK_SHRINK, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (button);
gimp_rgba_set (&bw, 1.0, 1.0, 1.0, 1.0);
gimp_rgba_set (&bw, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
color_area = gimp_color_area_new (&bw,
GIMP_COLOR_AREA_FLAT,
GDK_BUTTON2_MASK);
......@@ -458,7 +458,7 @@ color_notebook_new (const gchar *title,
GTK_SHRINK, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (button);
gimp_rgba_set (&bw, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&bw, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
color_area = gimp_color_area_new (&bw,
GIMP_COLOR_AREA_FLAT,
GDK_BUTTON2_MASK);
......@@ -1321,7 +1321,7 @@ color_history_init (void)
gint i;
for (i = 0; i < COLOR_HISTORY_SIZE; i++)
gimp_rgba_set (&color_history[i], 1.0, 1.0, 1.0, 1.0);
gimp_rgba_set (&color_history[i], 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
color_history_initialized = TRUE;
}
......
......@@ -1395,7 +1395,7 @@ parse_units (gpointer val1p,
static gint
parse_color (GimpRGB *color)
{
gdouble col[4] = { 0.0, 0.0, 0.0, 1.0 };
gdouble col[4] = { 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE };
gint token;
gint i;
gint n_channels;
......@@ -1727,8 +1727,8 @@ parse_device (gpointer val1p,
GdkDeviceKey *keys = NULL;
gchar *tool_name = NULL;
GimpRGB foreground = { 1.0, 1.0, 1.0, 1.0 };
GimpRGB background = { 0.0, 0.0, 0.0, 1.0 };
GimpRGB foreground = { 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE };
GimpRGB background = { 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE };
gchar *brush_name = NULL;
gchar *pattern_name = NULL;
gchar *gradient_name = NULL;
......@@ -1844,7 +1844,7 @@ parse_device (gpointer val1p,
if (parse_color (&foreground) == ERROR)
goto error;
foreground.a = 1.0;
foreground.a = GIMP_OPACITY_OPAQUE;
}
else if (!strcmp ("background", token_sym))
{
......@@ -1853,7 +1853,7 @@ parse_device (gpointer val1p,
if (parse_color (&background) == ERROR)
goto error;
background.a = 1.0;
background.a = GIMP_OPACITY_OPAQUE;
}
else if (!strcmp ("brush", token_sym))
{
......
......@@ -439,7 +439,7 @@ color_notebook_new (const gchar *title,
GTK_SHRINK, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (button);
gimp_rgba_set (&bw, 1.0, 1.0, 1.0, 1.0);
gimp_rgba_set (&bw, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
color_area = gimp_color_area_new (&bw,
GIMP_COLOR_AREA_FLAT,
GDK_BUTTON2_MASK);
......@@ -458,7 +458,7 @@ color_notebook_new (const gchar *title,
GTK_SHRINK, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (button);
gimp_rgba_set (&bw, 0.0, 0.0, 0.0, 1.0);
gimp_rgba_set (&bw, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
color_area = gimp_color_area_new (&bw,
GIMP_COLOR_AREA_FLAT,
GDK_BUTTON2_MASK);
......@@ -1321,7 +1321,7 @@ color_history_init (void)
gint i;
for (i = 0; i < COLOR_HISTORY_SIZE; i++)
gimp_rgba_set (&color_history[i], 1.0, 1.0, 1.0, 1.0);
gimp_rgba_set (&color_history[i], 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
color_history_initialized = TRUE;
}
......
......@@ -466,52 +466,52 @@ gradient_editor_new (Gimp *gimp)
editor->saved_colors[0].r = 0.0; /* Black */
editor->saved_colors[0].g = 0.0;
editor->saved_colors[0].b = 0.0;
editor->saved_colors[0].a = 1.0;
editor->saved_colors[0].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[1].r = 0.5; /* 50% Gray */
editor->saved_colors[1].g = 0.5;
editor->saved_colors[1].b = 0.5;
editor->saved_colors[1].a = 1.0;
editor->saved_colors[1].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[2].r = 1.0; /* White */
editor->saved_colors[2].g = 1.0;
editor->saved_colors[2].b = 1.0;
editor->saved_colors[2].a = 1.0;
editor->saved_colors[2].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[3].r = 0.0; /* Clear */
editor->saved_colors[3].g = 0.0;
editor->saved_colors[3].b = 0.0;
editor->saved_colors[3].a = 0.0;
editor->saved_colors[3].a = GIMP_OPACITY_TRANSPARENT;
editor->saved_colors[4].r = 1.0; /* Red */
editor->saved_colors[4].g = 0.0;
editor->saved_colors[4].b = 0.0;
editor->saved_colors[4].a = 1.0;
editor->saved_colors[4].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[5].r = 1.0; /* Yellow */
editor->saved_colors[5].g = 1.0;
editor->saved_colors[5].b = 0.0;
editor->saved_colors[5].a = 1.0;
editor->saved_colors[5].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[6].r = 0.0; /* Green */
editor->saved_colors[6].g = 1.0;
editor->saved_colors[6].b = 0.0;
editor->saved_colors[6].a = 1.0;
editor->saved_colors[6].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[7].r = 0.0; /* Cyan */
editor->saved_colors[7].g = 1.0;
editor->saved_colors[7].b = 1.0;
editor->saved_colors[7].a = 1.0;
editor->saved_colors[7].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[8].r = 0.0; /* Blue */
editor->saved_colors[8].g = 0.0;
editor->saved_colors[8].b = 1.0;
editor->saved_colors[8].a = 1.0;
editor->saved_colors[8].a = GIMP_OPACITY_OPAQUE;
editor->saved_colors[9].r = 1.0; /* Magenta */
editor->saved_colors[9].g = 0.0;
editor->saved_colors[9].b = 1.0;
editor->saved_colors[9].a = 1.0;
editor->saved_colors[9].a = GIMP_OPACITY_OPAQUE;
if (gimp_container_num_children (gimp->gradient_factory->container))
{
......
......@@ -411,8 +411,9 @@ image_map_do (gpointer data)
/* apply the results */
pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE);
gimp_image_apply_image (gimage, image_map->drawable, &shadowPR,
FALSE, OPAQUE_OPACITY, GIMP_REPLACE_MODE, NULL,
gimp_image_apply_image (gimage, image_map->drawable, &shadowPR, FALSE,
GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE,
NULL,
x, y);
/* display the results */
......
......@@ -268,7 +268,7 @@ gimp_airbrush_motion (GimpPaintCore *paint_core,
paint_appl_mode = paint_options->incremental ? INCREMENTAL : CONSTANT;
pressure = ((GimpAirbrushOptions *) paint_options)->pressure;
pressure = ((GimpAirbrushOptions *) paint_options)->pressure / 100.0;
if (paint_options->pressure_options->size)
scale = paint_core->cur_coords.pressure;
......@@ -319,8 +319,8 @@ gimp_airbrush_motion (GimpPaintCore *paint_core,
/* paste the newly painted area to the image */
gimp_paint_core_paste_canvas (paint_core, drawable,
MIN (pressure, 255),
gimp_context_get_opacity (context) * 255,
MIN (pressure, GIMP_OPACITY_OPAQUE),