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
This commit is contained in:
MEST 1999 Sven Neumann 1999-07-09 16:41:58 +00:00 committed by Sven Neumann
parent 0a6d8a2f4b
commit b47b9e0860
19 changed files with 133 additions and 18 deletions

View File

@ -1,3 +1,12 @@
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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;