Commit b47b9e08 authored by MEST 1999  Sven Neumann's avatar MEST 1999 Sven Neumann Committed by Sven Neumann

app/clone.c app/dodgeburn.c app/pencil.c applied a patch from Olof S

Fri Jul  9 18:39:03 MEST 1999  Sven Neumann <sven@gimp.org>

        * app/clone.c
        * app/dodgeburn.c
        * app/pencil.c
        * app/smudge.c: applied a patch from Olof S Kylander
        <olof@frozenriver.com> that enables pressure sensitivity for all
        the tools that were missing it


--Sven
parent 0a6d8a2f
Fri Jul 9 18:39:03 MEST 1999 Sven Neumann <sven@gimp.org>
* app/clone.c
* app/dodgeburn.c
* app/pencil.c
* app/smudge.c: applied a patch from Olof S Kylander
<olof@frozenriver.com> that enables pressure sensitivity for all
the tools that were missing it
Fri Jul 9 16:47:04 MEST 1999 Sven Neumann <sven@gimp.org>
* libgimp/gimpmatrix.[ch]: added a few functions to test for
......
......@@ -459,6 +459,7 @@ clone_motion (PaintCore *paint_core,
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
gint opacity;
pr = NULL;
pattern = NULL;
......@@ -587,8 +588,16 @@ clone_motion (PaintCore *paint_core,
}
}
/*Make the clone tool pressure sencitive */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, CONSTANT);
......
......@@ -372,7 +372,9 @@ dodgeburn_motion (PaintCore *paint_core,
tempPR.data = temp_data;
brush_opacity = gimp_context_get_opacity (NULL);
exposure = (dodgeburn_options->exposure)/100.0;
/* Enable pressure sensitive exposure */
exposure = ((dodgeburn_options->exposure)/100.0 * (paint_core->curpressure)/0.5);
/* DodgeBurn the region */
gimp_lut_process (dodgeburn_options->lut, &srcPR, &tempPR);
......
......@@ -459,6 +459,7 @@ clone_motion (PaintCore *paint_core,
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
gint opacity;
pr = NULL;
pattern = NULL;
......@@ -587,8 +588,16 @@ clone_motion (PaintCore *paint_core,
}
}
/*Make the clone tool pressure sencitive */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, CONSTANT);
......
......@@ -372,7 +372,9 @@ dodgeburn_motion (PaintCore *paint_core,
tempPR.data = temp_data;
brush_opacity = gimp_context_get_opacity (NULL);
exposure = (dodgeburn_options->exposure)/100.0;
/* Enable pressure sensitive exposure */
exposure = ((dodgeburn_options->exposure)/100.0 * (paint_core->curpressure)/0.5);
/* DodgeBurn the region */
gimp_lut_process (dodgeburn_options->lut, &srcPR, &tempPR);
......
......@@ -107,6 +107,7 @@ pencil_motion (PaintCore *paint_core,
GImage *gimage;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
gint opacity;
if (! (gimage = drawable_gimage (drawable)))
return;
......@@ -124,8 +125,16 @@ pencil_motion (PaintCore *paint_core,
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/*Make the opacity dependent on the current pressure
This makes a more natural pencil since light pressure
on a graphite pen will give transparent line */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
HARD, CONSTANT);
......
......@@ -314,7 +314,9 @@ smudge_motion (PaintCore *paint_core,
area->x, area->y, area->width, area->height, FALSE);
brush_opacity = gimp_context_get_opacity (NULL);
pressure = (smudge_options->pressure)/100.0;
/* Enable pressure sensitive pressure */
pressure = ((smudge_options->pressure)/100.0 * (paint_core->curpressure)/0.5);
/* The tempPR will be the built up buffer (for smudge) */
tempPR.bytes = accumPR.bytes;
......
......@@ -459,6 +459,7 @@ clone_motion (PaintCore *paint_core,
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
gint opacity;
pr = NULL;
pattern = NULL;
......@@ -587,8 +588,16 @@ clone_motion (PaintCore *paint_core,
}
}
/*Make the clone tool pressure sencitive */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, CONSTANT);
......
......@@ -107,6 +107,7 @@ pencil_motion (PaintCore *paint_core,
GImage *gimage;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
gint opacity;
if (! (gimage = drawable_gimage (drawable)))
return;
......@@ -124,8 +125,16 @@ pencil_motion (PaintCore *paint_core,
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/*Make the opacity dependent on the current pressure
This makes a more natural pencil since light pressure
on a graphite pen will give transparent line */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
HARD, CONSTANT);
......
......@@ -314,7 +314,9 @@ smudge_motion (PaintCore *paint_core,
area->x, area->y, area->width, area->height, FALSE);
brush_opacity = gimp_context_get_opacity (NULL);
pressure = (smudge_options->pressure)/100.0;
/* Enable pressure sensitive pressure */
pressure = ((smudge_options->pressure)/100.0 * (paint_core->curpressure)/0.5);
/* The tempPR will be the built up buffer (for smudge) */
tempPR.bytes = accumPR.bytes;
......
......@@ -459,6 +459,7 @@ clone_motion (PaintCore *paint_core,
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
gint opacity;
pr = NULL;
pattern = NULL;
......@@ -587,8 +588,16 @@ clone_motion (PaintCore *paint_core,
}
}
/*Make the clone tool pressure sencitive */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, CONSTANT);
......
......@@ -372,7 +372,9 @@ dodgeburn_motion (PaintCore *paint_core,
tempPR.data = temp_data;
brush_opacity = gimp_context_get_opacity (NULL);
exposure = (dodgeburn_options->exposure)/100.0;
/* Enable pressure sensitive exposure */
exposure = ((dodgeburn_options->exposure)/100.0 * (paint_core->curpressure)/0.5);
/* DodgeBurn the region */
gimp_lut_process (dodgeburn_options->lut, &srcPR, &tempPR);
......
......@@ -459,6 +459,7 @@ clone_motion (PaintCore *paint_core,
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
gint opacity;
pr = NULL;
pattern = NULL;
......@@ -587,8 +588,16 @@ clone_motion (PaintCore *paint_core,
}
}
/*Make the clone tool pressure sencitive */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, CONSTANT);
......
......@@ -372,7 +372,9 @@ dodgeburn_motion (PaintCore *paint_core,
tempPR.data = temp_data;
brush_opacity = gimp_context_get_opacity (NULL);
exposure = (dodgeburn_options->exposure)/100.0;
/* Enable pressure sensitive exposure */
exposure = ((dodgeburn_options->exposure)/100.0 * (paint_core->curpressure)/0.5);
/* DodgeBurn the region */
gimp_lut_process (dodgeburn_options->lut, &srcPR, &tempPR);
......
......@@ -107,6 +107,7 @@ pencil_motion (PaintCore *paint_core,
GImage *gimage;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
gint opacity;
if (! (gimage = drawable_gimage (drawable)))
return;
......@@ -124,8 +125,16 @@ pencil_motion (PaintCore *paint_core,
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/*Make the opacity dependent on the current pressure
This makes a more natural pencil since light pressure
on a graphite pen will give transparent line */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
HARD, CONSTANT);
......
......@@ -314,7 +314,9 @@ smudge_motion (PaintCore *paint_core,
area->x, area->y, area->width, area->height, FALSE);
brush_opacity = gimp_context_get_opacity (NULL);
pressure = (smudge_options->pressure)/100.0;
/* Enable pressure sensitive pressure */
pressure = ((smudge_options->pressure)/100.0 * (paint_core->curpressure)/0.5);
/* The tempPR will be the built up buffer (for smudge) */
tempPR.bytes = accumPR.bytes;
......
......@@ -459,6 +459,7 @@ clone_motion (PaintCore *paint_core,
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
gint opacity;
pr = NULL;
pattern = NULL;
......@@ -587,8 +588,16 @@ clone_motion (PaintCore *paint_core,
}
}
/*Make the clone tool pressure sencitive */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, CONSTANT);
......
......@@ -107,6 +107,7 @@ pencil_motion (PaintCore *paint_core,
GImage *gimage;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
gint opacity;
if (! (gimage = drawable_gimage (drawable)))
return;
......@@ -124,8 +125,16 @@ pencil_motion (PaintCore *paint_core,
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
/*Make the opacity dependent on the current pressure
This makes a more natural pencil since light pressure
on a graphite pen will give transparent line */
opacity = 255 * gimp_context_get_opacity (NULL) * (paint_core->curpressure / 0.5);
if (opacity > 255)
opacity = 255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
HARD, CONSTANT);
......
......@@ -314,7 +314,9 @@ smudge_motion (PaintCore *paint_core,
area->x, area->y, area->width, area->height, FALSE);
brush_opacity = gimp_context_get_opacity (NULL);
pressure = (smudge_options->pressure)/100.0;
/* Enable pressure sensitive pressure */
pressure = ((smudge_options->pressure)/100.0 * (paint_core->curpressure)/0.5);
/* The tempPR will be the built up buffer (for smudge) */
tempPR.bytes = accumPR.bytes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment