Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
4f553ed2
Commit
4f553ed2
authored
Feb 04, 1999
by
Peter Teichman
Browse files
added pressure support for the Convolve tool
* app/convolve.c: added pressure support for the Convolve tool
parent
008fd40f
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
4f553ed2
Thu Feb 4 17:22:25 EST 1999 Peter Teichman <pat4@acpub.duke.edu>
* app/convolve.c: added pressure support for the Convolve tool
Wed Feb 3 18:12:19 PST 1999 Manish Singh <yosh@gimp.org>
* Made 1.1.2 release
...
...
app/convolve.c
View file @
4f553ed2
...
...
@@ -39,7 +39,7 @@ typedef enum
}
ConvolveType
;
/* forward function declarations */
static
void
calculate_matrix
(
ConvolveType
,
double
);
static
void
calculate_matrix
(
ConvolveType
,
double
,
double
);
static
void
integer_matrix
(
float
*
,
int
*
,
int
);
static
void
copy_matrix
(
float
*
,
float
*
,
int
);
static
int
sum_matrix
(
int
*
,
int
);
...
...
@@ -99,9 +99,6 @@ convolve_scale_update (GtkAdjustment *adjustment,
double
*
scale_val
)
{
*
scale_val
=
adjustment
->
value
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
void
...
...
@@ -109,8 +106,6 @@ convolve_type_callback (GtkWidget *w,
gpointer
client_data
)
{
convolve_options
->
type
=
(
ConvolveType
)
client_data
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
ConvolveOptions
*
...
...
@@ -194,17 +189,9 @@ convolve_paint_func (PaintCore *paint_core,
{
switch
(
state
)
{
case
INIT_PAINT
:
/* calculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
break
;
case
MOTION_PAINT
:
convolve_motion
(
paint_core
,
drawable
);
break
;
case
FINISH_PAINT
:
break
;
}
return
NULL
;
...
...
@@ -264,6 +251,9 @@ convolve_motion (PaintCore *paint_core,
destPR
.
rowstride
=
area
->
width
*
destPR
.
bytes
;
destPR
.
data
=
temp_buf_data
(
area
);
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
,
paint_core
->
curpressure
);
/* convolve the source image with the convolve mask */
if
(
srcPR
.
w
>=
matrix_size
&&
srcPR
.
h
>=
matrix_size
)
{
...
...
@@ -337,12 +327,13 @@ convolve_motion (PaintCore *paint_core,
static
void
calculate_matrix
(
ConvolveType
type
,
double
pressure
)
double
pressure
,
double
curpressure
)
{
float
percent
;
/* find percent of tool pressure */
percent
=
pressure
/
100
.
0
;
percent
=
(
pressure
/
100
.
0
)
*
curpressure
;
/* get the appropriate convolution matrix and size and divisor */
switch
(
type
)
...
...
@@ -541,9 +532,6 @@ convolve_invoker (Argument *args)
if
(
success
)
{
/* calculate the convolution kernel */
calculate_matrix
(
type
,
pressure
);
/* set the paint core's paint func */
non_gui_paint_core
.
paint_func
=
convolve_non_gui_paint_func
;
...
...
app/paint/gimpconvolve.c
View file @
4f553ed2
...
...
@@ -39,7 +39,7 @@ typedef enum
}
ConvolveType
;
/* forward function declarations */
static
void
calculate_matrix
(
ConvolveType
,
double
);
static
void
calculate_matrix
(
ConvolveType
,
double
,
double
);
static
void
integer_matrix
(
float
*
,
int
*
,
int
);
static
void
copy_matrix
(
float
*
,
float
*
,
int
);
static
int
sum_matrix
(
int
*
,
int
);
...
...
@@ -99,9 +99,6 @@ convolve_scale_update (GtkAdjustment *adjustment,
double
*
scale_val
)
{
*
scale_val
=
adjustment
->
value
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
void
...
...
@@ -109,8 +106,6 @@ convolve_type_callback (GtkWidget *w,
gpointer
client_data
)
{
convolve_options
->
type
=
(
ConvolveType
)
client_data
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
ConvolveOptions
*
...
...
@@ -194,17 +189,9 @@ convolve_paint_func (PaintCore *paint_core,
{
switch
(
state
)
{
case
INIT_PAINT
:
/* calculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
break
;
case
MOTION_PAINT
:
convolve_motion
(
paint_core
,
drawable
);
break
;
case
FINISH_PAINT
:
break
;
}
return
NULL
;
...
...
@@ -264,6 +251,9 @@ convolve_motion (PaintCore *paint_core,
destPR
.
rowstride
=
area
->
width
*
destPR
.
bytes
;
destPR
.
data
=
temp_buf_data
(
area
);
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
,
paint_core
->
curpressure
);
/* convolve the source image with the convolve mask */
if
(
srcPR
.
w
>=
matrix_size
&&
srcPR
.
h
>=
matrix_size
)
{
...
...
@@ -337,12 +327,13 @@ convolve_motion (PaintCore *paint_core,
static
void
calculate_matrix
(
ConvolveType
type
,
double
pressure
)
double
pressure
,
double
curpressure
)
{
float
percent
;
/* find percent of tool pressure */
percent
=
pressure
/
100
.
0
;
percent
=
(
pressure
/
100
.
0
)
*
curpressure
;
/* get the appropriate convolution matrix and size and divisor */
switch
(
type
)
...
...
@@ -541,9 +532,6 @@ convolve_invoker (Argument *args)
if
(
success
)
{
/* calculate the convolution kernel */
calculate_matrix
(
type
,
pressure
);
/* set the paint core's paint func */
non_gui_paint_core
.
paint_func
=
convolve_non_gui_paint_func
;
...
...
app/tools/convolve.c
View file @
4f553ed2
...
...
@@ -39,7 +39,7 @@ typedef enum
}
ConvolveType
;
/* forward function declarations */
static
void
calculate_matrix
(
ConvolveType
,
double
);
static
void
calculate_matrix
(
ConvolveType
,
double
,
double
);
static
void
integer_matrix
(
float
*
,
int
*
,
int
);
static
void
copy_matrix
(
float
*
,
float
*
,
int
);
static
int
sum_matrix
(
int
*
,
int
);
...
...
@@ -99,9 +99,6 @@ convolve_scale_update (GtkAdjustment *adjustment,
double
*
scale_val
)
{
*
scale_val
=
adjustment
->
value
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
void
...
...
@@ -109,8 +106,6 @@ convolve_type_callback (GtkWidget *w,
gpointer
client_data
)
{
convolve_options
->
type
=
(
ConvolveType
)
client_data
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
ConvolveOptions
*
...
...
@@ -194,17 +189,9 @@ convolve_paint_func (PaintCore *paint_core,
{
switch
(
state
)
{
case
INIT_PAINT
:
/* calculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
break
;
case
MOTION_PAINT
:
convolve_motion
(
paint_core
,
drawable
);
break
;
case
FINISH_PAINT
:
break
;
}
return
NULL
;
...
...
@@ -264,6 +251,9 @@ convolve_motion (PaintCore *paint_core,
destPR
.
rowstride
=
area
->
width
*
destPR
.
bytes
;
destPR
.
data
=
temp_buf_data
(
area
);
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
,
paint_core
->
curpressure
);
/* convolve the source image with the convolve mask */
if
(
srcPR
.
w
>=
matrix_size
&&
srcPR
.
h
>=
matrix_size
)
{
...
...
@@ -337,12 +327,13 @@ convolve_motion (PaintCore *paint_core,
static
void
calculate_matrix
(
ConvolveType
type
,
double
pressure
)
double
pressure
,
double
curpressure
)
{
float
percent
;
/* find percent of tool pressure */
percent
=
pressure
/
100
.
0
;
percent
=
(
pressure
/
100
.
0
)
*
curpressure
;
/* get the appropriate convolution matrix and size and divisor */
switch
(
type
)
...
...
@@ -541,9 +532,6 @@ convolve_invoker (Argument *args)
if
(
success
)
{
/* calculate the convolution kernel */
calculate_matrix
(
type
,
pressure
);
/* set the paint core's paint func */
non_gui_paint_core
.
paint_func
=
convolve_non_gui_paint_func
;
...
...
app/tools/gimpconvolvetool.c
View file @
4f553ed2
...
...
@@ -39,7 +39,7 @@ typedef enum
}
ConvolveType
;
/* forward function declarations */
static
void
calculate_matrix
(
ConvolveType
,
double
);
static
void
calculate_matrix
(
ConvolveType
,
double
,
double
);
static
void
integer_matrix
(
float
*
,
int
*
,
int
);
static
void
copy_matrix
(
float
*
,
float
*
,
int
);
static
int
sum_matrix
(
int
*
,
int
);
...
...
@@ -99,9 +99,6 @@ convolve_scale_update (GtkAdjustment *adjustment,
double
*
scale_val
)
{
*
scale_val
=
adjustment
->
value
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
void
...
...
@@ -109,8 +106,6 @@ convolve_type_callback (GtkWidget *w,
gpointer
client_data
)
{
convolve_options
->
type
=
(
ConvolveType
)
client_data
;
/* recalculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
}
static
ConvolveOptions
*
...
...
@@ -194,17 +189,9 @@ convolve_paint_func (PaintCore *paint_core,
{
switch
(
state
)
{
case
INIT_PAINT
:
/* calculate the matrix */
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
);
break
;
case
MOTION_PAINT
:
convolve_motion
(
paint_core
,
drawable
);
break
;
case
FINISH_PAINT
:
break
;
}
return
NULL
;
...
...
@@ -264,6 +251,9 @@ convolve_motion (PaintCore *paint_core,
destPR
.
rowstride
=
area
->
width
*
destPR
.
bytes
;
destPR
.
data
=
temp_buf_data
(
area
);
calculate_matrix
(
convolve_options
->
type
,
convolve_options
->
pressure
,
paint_core
->
curpressure
);
/* convolve the source image with the convolve mask */
if
(
srcPR
.
w
>=
matrix_size
&&
srcPR
.
h
>=
matrix_size
)
{
...
...
@@ -337,12 +327,13 @@ convolve_motion (PaintCore *paint_core,
static
void
calculate_matrix
(
ConvolveType
type
,
double
pressure
)
double
pressure
,
double
curpressure
)
{
float
percent
;
/* find percent of tool pressure */
percent
=
pressure
/
100
.
0
;
percent
=
(
pressure
/
100
.
0
)
*
curpressure
;
/* get the appropriate convolution matrix and size and divisor */
switch
(
type
)
...
...
@@ -541,9 +532,6 @@ convolve_invoker (Argument *args)
if
(
success
)
{
/* calculate the convolution kernel */
calculate_matrix
(
type
,
pressure
);
/* set the paint core's paint func */
non_gui_paint_core
.
paint_func
=
convolve_non_gui_paint_func
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment