Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GIMP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,655
Issues
2,655
List
Boards
Labels
Service Desk
Milestones
Merge Requests
34
Merge Requests
34
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
GIMP
Commits
e5a3b374
Commit
e5a3b374
authored
Mar 21, 1998
by
Manish Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bzero/bcopy pogrom.
-Yosh
parent
947490dd
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
72 additions
and
86 deletions
+72
-86
ChangeLog
ChangeLog
+4
-0
plug-ins/CML_explorer/CML_explorer.c
plug-ins/CML_explorer/CML_explorer.c
+9
-9
plug-ins/common/CML_explorer.c
plug-ins/common/CML_explorer.c
+9
-9
plug-ins/common/emboss.c
plug-ins/common/emboss.c
+7
-10
plug-ins/common/hot.c
plug-ins/common/hot.c
+0
-1
plug-ins/common/nlfilt.c
plug-ins/common/nlfilt.c
+7
-10
plug-ins/common/vpropagate.c
plug-ins/common/vpropagate.c
+10
-11
plug-ins/common/waves.c
plug-ins/common/waves.c
+0
-1
plug-ins/emboss/emboss.c
plug-ins/emboss/emboss.c
+7
-10
plug-ins/flame/rect.c
plug-ins/flame/rect.c
+2
-2
plug-ins/hot/hot.c
plug-ins/hot/hot.c
+0
-1
plug-ins/nlfilt/nlfilt.c
plug-ins/nlfilt/nlfilt.c
+7
-10
plug-ins/vpropagate/vpropagate.c
plug-ins/vpropagate/vpropagate.c
+10
-11
plug-ins/waves/waves.c
plug-ins/waves/waves.c
+0
-1
No files found.
ChangeLog
View file @
e5a3b374
Fri Mar 20 18:15:06 PST 1998 Manish Singh <yosh@gimp.org>
* s/bzero/memset/ and s/bcopy/memcpy/ in plug-ins
Fri Mar 20 16:54:47 EST 1998 Adrian Likins <adrian@gimp.org>
* app/palette.c:
...
...
plug-ins/CML_explorer/CML_explorer.c
View file @
e5a3b374
...
...
@@ -1913,9 +1913,9 @@ CML_copy_parameters_callback (GtkWidget *widget, gpointer data)
gdk_flush
();
return
;
}
bcopy
(
channel_menu
[
copy_source
].
data
,
channel_menu
[
copy_destination
].
data
,
sizeof
(
CML_PARAM
));
memcpy
(
channel_menu
[
copy_destination
].
data
,
channel_menu
[
copy_source
].
data
,
sizeof
(
CML_PARAM
));
CML_preview_defer
=
TRUE
;
widgets
=
widget_pointers
[
copy_destination
];
for
(
index
=
0
;
index
<
CML_PARAM_NUM
;
index
++
)
...
...
@@ -2385,9 +2385,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
{
if
((
selective_load_source
==
0
)
||
(
selective_load_destination
==
0
))
{
bcopy
((
void
*
)
&
ch
[
0
],
&
(
VALS
.
hue
)
,
sizeof
(
CML_PARAM
));
bcopy
((
void
*
)
&
ch
[
1
],
&
(
VALS
.
sat
)
,
sizeof
(
CML_PARAM
));
bcopy
((
void
*
)
&
ch
[
2
],
&
(
VALS
.
val
)
,
sizeof
(
CML_PARAM
));
memcpy
(
&
(
VALS
.
hue
),
(
void
*
)
&
ch
[
0
]
,
sizeof
(
CML_PARAM
));
memcpy
(
&
(
VALS
.
sat
),
(
void
*
)
&
ch
[
1
]
,
sizeof
(
CML_PARAM
));
memcpy
(
&
(
VALS
.
val
),
(
void
*
)
&
ch
[
2
]
,
sizeof
(
CML_PARAM
));
VALS
.
initial_value
=
initial_value
;
VALS
.
scale
=
scale
;
VALS
.
start_offset
=
start_offset
;
...
...
@@ -2395,9 +2395,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
}
else
{
bcopy
((
void
*
)
&
ch
[
selective_load_source
-
1
]
,
(
CML_PARAM
*
)
&
VALS
+
(
selective_load_destination
-
1
)
,
sizeof
(
CML_PARAM
));
memcpy
((
CML_PARAM
*
)
&
VALS
+
(
selective_load_destination
-
1
)
,
(
void
*
)
&
ch
[
selective_load_source
-
1
]
,
sizeof
(
CML_PARAM
));
}
if
(
sizeof
(
VALS
.
last_file_name
)
<=
strlen
(
filename
))
...
...
plug-ins/common/CML_explorer.c
View file @
e5a3b374
...
...
@@ -1913,9 +1913,9 @@ CML_copy_parameters_callback (GtkWidget *widget, gpointer data)
gdk_flush
();
return
;
}
bcopy
(
channel_menu
[
copy_source
].
data
,
channel_menu
[
copy_destination
].
data
,
sizeof
(
CML_PARAM
));
memcpy
(
channel_menu
[
copy_destination
].
data
,
channel_menu
[
copy_source
].
data
,
sizeof
(
CML_PARAM
));
CML_preview_defer
=
TRUE
;
widgets
=
widget_pointers
[
copy_destination
];
for
(
index
=
0
;
index
<
CML_PARAM_NUM
;
index
++
)
...
...
@@ -2385,9 +2385,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
{
if
((
selective_load_source
==
0
)
||
(
selective_load_destination
==
0
))
{
bcopy
((
void
*
)
&
ch
[
0
],
&
(
VALS
.
hue
)
,
sizeof
(
CML_PARAM
));
bcopy
((
void
*
)
&
ch
[
1
],
&
(
VALS
.
sat
)
,
sizeof
(
CML_PARAM
));
bcopy
((
void
*
)
&
ch
[
2
],
&
(
VALS
.
val
)
,
sizeof
(
CML_PARAM
));
memcpy
(
&
(
VALS
.
hue
),
(
void
*
)
&
ch
[
0
]
,
sizeof
(
CML_PARAM
));
memcpy
(
&
(
VALS
.
sat
),
(
void
*
)
&
ch
[
1
]
,
sizeof
(
CML_PARAM
));
memcpy
(
&
(
VALS
.
val
),
(
void
*
)
&
ch
[
2
]
,
sizeof
(
CML_PARAM
));
VALS
.
initial_value
=
initial_value
;
VALS
.
scale
=
scale
;
VALS
.
start_offset
=
start_offset
;
...
...
@@ -2395,9 +2395,9 @@ CML_load_parameter_file (guchar *filename, gint interactive_mode)
}
else
{
bcopy
((
void
*
)
&
ch
[
selective_load_source
-
1
]
,
(
CML_PARAM
*
)
&
VALS
+
(
selective_load_destination
-
1
)
,
sizeof
(
CML_PARAM
));
memcpy
((
CML_PARAM
*
)
&
VALS
+
(
selective_load_destination
-
1
)
,
(
void
*
)
&
ch
[
selective_load_source
-
1
]
,
sizeof
(
CML_PARAM
));
}
if
(
sizeof
(
VALS
.
last_file_name
)
<=
strlen
(
filename
))
...
...
plug-ins/common/emboss.c
View file @
e5a3b374
...
...
@@ -142,7 +142,6 @@ run(gchar *name, gint nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
rvals
[
0
].
type
=
PARAM_STATUS
;
...
...
@@ -332,9 +331,7 @@ int pluginCore(struct piArgs *argp) {
srcbuf
=
(
guchar
*
)
malloc
(
rowsize
*
3
);
dstbuf
=
(
guchar
*
)
malloc
(
rowsize
);
/* bzero(srcbuf, rowsize*3); */
memset
(
srcbuf
,(
int
)
0
,(
size_t
)(
rowsize
*
3
));
/* bzero(dstbuf, rowsize); */
memset
(
dstbuf
,(
int
)
0
,(
size_t
)
rowsize
);
EmbossInit
(
DtoR
(
argp
->
azimuth
),
DtoR
(
argp
->
elevation
),
argp
->
depth
);
...
...
@@ -344,14 +341,14 @@ int pluginCore(struct piArgs *argp) {
/* first row */
gimp_pixel_rgn_get_rect
(
&
src
,
srcbuf
,
0
,
0
,
width
,
3
);
bcopy
(
srcbuf
+
rowsize
,
srcbuf
,
rowsize
);
memcpy
(
srcbuf
,
srcbuf
+
rowsize
,
rowsize
);
EmbossRow
(
srcbuf
,
argp
->
embossp
?
(
guchar
*
)
0
:
srcbuf
,
dstbuf
,
width
,
bypp
,
has_alpha
);
gimp_pixel_rgn_set_row
(
&
dst
,
dstbuf
,
0
,
0
,
width
);
/* last row */
gimp_pixel_rgn_get_rect
(
&
src
,
srcbuf
,
0
,
height
-
3
,
width
,
3
);
bcopy
(
srcbuf
+
rowsize
,
srcbuf
+
rowsize
*
2
,
rowsize
);
memcpy
(
srcbuf
+
rowsize
*
2
,
srcbuf
+
rowsize
,
rowsize
);
EmbossRow
(
srcbuf
,
argp
->
embossp
?
(
guchar
*
)
0
:
srcbuf
,
dstbuf
,
width
,
bypp
,
has_alpha
);
gimp_pixel_rgn_set_row
(
&
dst
,
dstbuf
,
0
,
height
-
1
,
width
);
...
...
@@ -467,8 +464,8 @@ emboss_do_preview(GtkWidget *w) {
dst
=
malloc
(
rowsize
);
c
=
malloc
(
rowsize
*
3
);
bcopy
(
thePreview
->
bits
,
c
,
rowsize
);
bcopy
(
thePreview
->
bits
,
c
+
rowsize
,
rowsize
*
2
);
memcpy
(
c
,
thePreview
->
bits
,
rowsize
);
memcpy
(
c
+
rowsize
,
thePreview
->
bits
,
rowsize
*
2
);
EmbossInit
(
DtoR
(
ap
->
azimuth
),
DtoR
(
ap
->
elevation
),
ap
->
depth
);
EmbossRow
(
c
,
ap
->
embossp
?
(
guchar
*
)
0
:
c
,
...
...
@@ -476,9 +473,9 @@ emboss_do_preview(GtkWidget *w) {
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
dst
,
0
,
0
,
thePreview
->
width
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
),
c
,
rowsize
*
2
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
c
+
(
rowsize
*
2
),
rowsize
);
memcpy
(
c
,
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
)
,
rowsize
*
2
);
memcpy
(
c
+
(
rowsize
*
2
),
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
rowsize
);
EmbossRow
(
c
,
ap
->
embossp
?
(
guchar
*
)
0
:
c
,
dst
,
thePreview
->
width
,
thePreview
->
bpp
,
FALSE
);
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
...
...
plug-ins/common/hot.c
View file @
e5a3b374
...
...
@@ -228,7 +228,6 @@ run(char *name, int nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
args
.
mode
=-
1
;
...
...
plug-ins/common/nlfilt.c
View file @
e5a3b374
...
...
@@ -135,7 +135,6 @@ run(char *name, gint nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
args
.
radius
=-
1
.
0
;
...
...
@@ -213,9 +212,7 @@ gint pluginCore(struct piArgs *argp) {
srcbuf
=
(
guchar
*
)
malloc
(
width
*
Bpp
*
3
);
dstbuf
=
(
guchar
*
)
malloc
(
width
*
Bpp
);
/* bzero(srcbuf, rowsize*3); */
memset
(
srcbuf
,(
int
)
0
,(
size_t
)(
rowsize
*
3
));
/* bzero(dstbuf, rowsize); */
memset
(
dstbuf
,(
int
)
0
,(
size_t
)
rowsize
);
filtno
=
nlfiltInit
(
argp
->
alpha
,
argp
->
radius
,
argp
->
filter
);
...
...
@@ -223,13 +220,13 @@ gint pluginCore(struct piArgs *argp) {
/* first row */
gimp_pixel_rgn_get_rect
(
&
srcPr
,
srcbuf
,
0
,
0
,
width
,
3
);
bcopy
(
srcbuf
+
width
*
Bpp
,
srcbuf
,
rowsize
);
memcpy
(
srcbuf
,
srcbuf
+
width
*
Bpp
,
rowsize
);
nlfiltRow
(
srcbuf
,
dstbuf
,
width
,
Bpp
,
filtno
);
gimp_pixel_rgn_set_row
(
&
dstPr
,
dstbuf
,
0
,
0
,
width
);
/* last row */
gimp_pixel_rgn_get_rect
(
&
srcPr
,
srcbuf
,
0
,
height
-
3
,
width
,
3
);
bcopy
(
srcbuf
+
rowsize
,
srcbuf
+
rowsize
*
2
,
rowsize
);
memcpy
(
srcbuf
+
rowsize
*
2
,
srcbuf
+
rowsize
,
rowsize
);
nlfiltRow
(
srcbuf
,
dstbuf
,
width
,
Bpp
,
filtno
);
gimp_pixel_rgn_set_row
(
&
dstPr
,
dstbuf
,
0
,
height
-
1
,
width
);
...
...
@@ -346,16 +343,16 @@ nlfilt_do_preview(GtkWidget *w) {
rowsize
=
thePreview
->
width
*
thePreview
->
bpp
;
dst
=
malloc
(
rowsize
);
c
=
malloc
(
rowsize
*
3
);
bcopy
(
thePreview
->
bits
,
c
,
rowsize
);
bcopy
(
thePreview
->
bits
,
c
+
rowsize
,
rowsize
*
2
);
memcpy
(
c
,
thePreview
->
bits
,
rowsize
);
memcpy
(
c
+
rowsize
,
thePreview
->
bits
,
rowsize
*
2
);
filtno
=
nlfiltInit
(
ap
->
alpha
,
ap
->
radius
,
ap
->
filter
);
nlfiltRow
(
c
,
dst
,
thePreview
->
width
,
thePreview
->
bpp
,
filtno
);
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
dst
,
0
,
0
,
thePreview
->
width
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
),
c
,
rowsize
*
2
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
c
+
(
rowsize
*
2
),
rowsize
);
memcpy
(
c
,
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
)
,
rowsize
*
2
);
memcpy
(
c
+
(
rowsize
*
2
),
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
rowsize
);
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
dst
,
0
,
thePreview
->
height
-
1
,
thePreview
->
width
);
free
(
c
);
...
...
plug-ins/common/vpropagate.c
View file @
e5a3b374
...
...
@@ -39,7 +39,6 @@
#define PROGRESS_NAME "value propagating..."
#define MENU_POSITION "<Image>/Filters/Distorts/Value Propagate"
/* void bcopy(void *, void *, int); */
typedef
guchar
CH
;
#define RGB (1 << 0)
#define GRAY (1 << 1)
...
...
@@ -411,7 +410,7 @@ value_propagate_body (gint drawable_id)
dest
=
dest_row
+
(
x
*
bytes
);
here
=
cr
+
(
x
*
bytes
);
/* *** copy source value to best value holder *** */
bcopy
((
void
*
)
here
,
(
void
*
)
best
,
bytes
);
memcpy
((
void
*
)
best
,
(
void
*
)
here
,
bytes
);
if
(
operation
.
initializer
)
(
*
operation
.
initializer
)(
dtype
,
bytes
,
best
,
here
,
&
tmp
);
/* *** gather neighbors' values: loop-unfolded version *** */
...
...
@@ -569,7 +568,7 @@ propagate_white (dtype, bytes, orig, here, best, tmp)
if
(
*
(
float
*
)
tmp
<
v_here
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
*
(
float
*
)
tmp
=
v_here
;
bcopy
(
here
,
best
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
memcpy
(
best
,
here
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
}
break
;
case
GRAYA_IMAGE
:
...
...
@@ -615,7 +614,7 @@ propagate_black (image_type, channels, orig, here, best, tmp)
if
(
v_here
<
*
(
float
*
)
tmp
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
*
(
float
*
)
tmp
=
v_here
;
bcopy
(
here
,
best
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
memcpy
(
best
,
here
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
}
break
;
case
GRAYA_IMAGE
:
...
...
@@ -695,13 +694,13 @@ propagate_middle (image_type, channels, orig, here, best, tmp)
if
(
(
v_here
<=
data
->
minv
)
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
data
->
minv
=
v_here
;
bcopy
(
here
,
data
->
min
,
3
*
sizeof
(
CH
));
memcpy
(
data
->
min
,
here
,
3
*
sizeof
(
CH
));
data
->
min_modified
=
1
;
}
if
(
data
->
maxv
<=
v_here
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
data
->
maxv
=
v_here
;
bcopy
(
here
,
data
->
max
,
3
*
sizeof
(
CH
));
memcpy
(
data
->
max
,
here
,
3
*
sizeof
(
CH
));
data
->
max_modified
=
1
;
}
break
;
...
...
@@ -881,7 +880,7 @@ propagate_a_color (image_type, channels, orig, here, best, tmp)
if
(
here
[
0
]
==
fg
[
0
]
&&
here
[
1
]
==
fg
[
1
]
&&
here
[
2
]
==
fg
[
2
]
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
bcopy
(
here
,
best
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
memcpy
(
best
,
here
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
}
break
;
case
GRAYA_IMAGE
:
...
...
@@ -903,11 +902,11 @@ propagate_opaque (image_type, channels, orig, here, best, tmp)
{
case
RGBA_IMAGE
:
if
(
best
[
3
]
<
here
[
3
]
&&
value_difference_check
(
orig
,
here
,
3
)
)
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
case
GRAYA_IMAGE
:
if
(
best
[
1
]
<
here
[
1
]
&&
value_difference_check
(
orig
,
here
,
1
))
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
default:
break
;
...
...
@@ -925,11 +924,11 @@ propagate_transparent (image_type, channels, orig, here, best, tmp)
{
case
RGBA_IMAGE
:
if
(
here
[
3
]
<
best
[
3
]
&&
value_difference_check
(
orig
,
here
,
3
))
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
case
GRAYA_IMAGE
:
if
(
here
[
1
]
<
best
[
1
]
&&
value_difference_check
(
orig
,
here
,
1
))
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
default:
break
;
...
...
plug-ins/common/waves.c
View file @
e5a3b374
...
...
@@ -126,7 +126,6 @@ run(char *name, int nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
args
.
type
=-
1
;
gimp_get_data
(
"plug_in_waves"
,
&
args
);
...
...
plug-ins/emboss/emboss.c
View file @
e5a3b374
...
...
@@ -142,7 +142,6 @@ run(gchar *name, gint nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
rvals
[
0
].
type
=
PARAM_STATUS
;
...
...
@@ -332,9 +331,7 @@ int pluginCore(struct piArgs *argp) {
srcbuf
=
(
guchar
*
)
malloc
(
rowsize
*
3
);
dstbuf
=
(
guchar
*
)
malloc
(
rowsize
);
/* bzero(srcbuf, rowsize*3); */
memset
(
srcbuf
,(
int
)
0
,(
size_t
)(
rowsize
*
3
));
/* bzero(dstbuf, rowsize); */
memset
(
dstbuf
,(
int
)
0
,(
size_t
)
rowsize
);
EmbossInit
(
DtoR
(
argp
->
azimuth
),
DtoR
(
argp
->
elevation
),
argp
->
depth
);
...
...
@@ -344,14 +341,14 @@ int pluginCore(struct piArgs *argp) {
/* first row */
gimp_pixel_rgn_get_rect
(
&
src
,
srcbuf
,
0
,
0
,
width
,
3
);
bcopy
(
srcbuf
+
rowsize
,
srcbuf
,
rowsize
);
memcpy
(
srcbuf
,
srcbuf
+
rowsize
,
rowsize
);
EmbossRow
(
srcbuf
,
argp
->
embossp
?
(
guchar
*
)
0
:
srcbuf
,
dstbuf
,
width
,
bypp
,
has_alpha
);
gimp_pixel_rgn_set_row
(
&
dst
,
dstbuf
,
0
,
0
,
width
);
/* last row */
gimp_pixel_rgn_get_rect
(
&
src
,
srcbuf
,
0
,
height
-
3
,
width
,
3
);
bcopy
(
srcbuf
+
rowsize
,
srcbuf
+
rowsize
*
2
,
rowsize
);
memcpy
(
srcbuf
+
rowsize
*
2
,
srcbuf
+
rowsize
,
rowsize
);
EmbossRow
(
srcbuf
,
argp
->
embossp
?
(
guchar
*
)
0
:
srcbuf
,
dstbuf
,
width
,
bypp
,
has_alpha
);
gimp_pixel_rgn_set_row
(
&
dst
,
dstbuf
,
0
,
height
-
1
,
width
);
...
...
@@ -467,8 +464,8 @@ emboss_do_preview(GtkWidget *w) {
dst
=
malloc
(
rowsize
);
c
=
malloc
(
rowsize
*
3
);
bcopy
(
thePreview
->
bits
,
c
,
rowsize
);
bcopy
(
thePreview
->
bits
,
c
+
rowsize
,
rowsize
*
2
);
memcpy
(
c
,
thePreview
->
bits
,
rowsize
);
memcpy
(
c
+
rowsize
,
thePreview
->
bits
,
rowsize
*
2
);
EmbossInit
(
DtoR
(
ap
->
azimuth
),
DtoR
(
ap
->
elevation
),
ap
->
depth
);
EmbossRow
(
c
,
ap
->
embossp
?
(
guchar
*
)
0
:
c
,
...
...
@@ -476,9 +473,9 @@ emboss_do_preview(GtkWidget *w) {
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
dst
,
0
,
0
,
thePreview
->
width
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
),
c
,
rowsize
*
2
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
c
+
(
rowsize
*
2
),
rowsize
);
memcpy
(
c
,
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
)
,
rowsize
*
2
);
memcpy
(
c
+
(
rowsize
*
2
),
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
rowsize
);
EmbossRow
(
c
,
ap
->
embossp
?
(
guchar
*
)
0
:
c
,
dst
,
thePreview
->
width
,
thePreview
->
bpp
,
FALSE
);
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
...
...
plug-ins/flame/rect.c
View file @
e5a3b374
...
...
@@ -189,12 +189,12 @@ void render_rectangle(spec, out, out_width, field, nchan, progress)
points
=
(
point
*
)
(
last_block
+
(
sizeof
(
bucket
)
+
sizeof
(
abucket
))
*
nbuckets
);
}
bzero
((
char
*
)
accumulate
,
sizeof
(
abucket
)
*
nbuckets
);
memset
((
char
*
)
accumulate
,
0
,
sizeof
(
abucket
)
*
nbuckets
);
for
(
batch_num
=
0
;
batch_num
<
nbatches
;
batch_num
++
)
{
double
batch_time
;
double
sample_density
;
control_point
cp
;
bzero
((
char
*
)
buckets
,
sizeof
(
bucket
)
*
nbuckets
);
memset
((
char
*
)
buckets
,
0
,
sizeof
(
bucket
)
*
nbuckets
);
batch_time
=
spec
->
time
+
temporal_deltas
[
batch_num
];
/* interpolate and get a control point */
...
...
plug-ins/hot/hot.c
View file @
e5a3b374
...
...
@@ -228,7 +228,6 @@ run(char *name, int nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
args
.
mode
=-
1
;
...
...
plug-ins/nlfilt/nlfilt.c
View file @
e5a3b374
...
...
@@ -135,7 +135,6 @@ run(char *name, gint nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
args
.
radius
=-
1
.
0
;
...
...
@@ -213,9 +212,7 @@ gint pluginCore(struct piArgs *argp) {
srcbuf
=
(
guchar
*
)
malloc
(
width
*
Bpp
*
3
);
dstbuf
=
(
guchar
*
)
malloc
(
width
*
Bpp
);
/* bzero(srcbuf, rowsize*3); */
memset
(
srcbuf
,(
int
)
0
,(
size_t
)(
rowsize
*
3
));
/* bzero(dstbuf, rowsize); */
memset
(
dstbuf
,(
int
)
0
,(
size_t
)
rowsize
);
filtno
=
nlfiltInit
(
argp
->
alpha
,
argp
->
radius
,
argp
->
filter
);
...
...
@@ -223,13 +220,13 @@ gint pluginCore(struct piArgs *argp) {
/* first row */
gimp_pixel_rgn_get_rect
(
&
srcPr
,
srcbuf
,
0
,
0
,
width
,
3
);
bcopy
(
srcbuf
+
width
*
Bpp
,
srcbuf
,
rowsize
);
memcpy
(
srcbuf
,
srcbuf
+
width
*
Bpp
,
rowsize
);
nlfiltRow
(
srcbuf
,
dstbuf
,
width
,
Bpp
,
filtno
);
gimp_pixel_rgn_set_row
(
&
dstPr
,
dstbuf
,
0
,
0
,
width
);
/* last row */
gimp_pixel_rgn_get_rect
(
&
srcPr
,
srcbuf
,
0
,
height
-
3
,
width
,
3
);
bcopy
(
srcbuf
+
rowsize
,
srcbuf
+
rowsize
*
2
,
rowsize
);
memcpy
(
srcbuf
+
rowsize
*
2
,
srcbuf
+
rowsize
,
rowsize
);
nlfiltRow
(
srcbuf
,
dstbuf
,
width
,
Bpp
,
filtno
);
gimp_pixel_rgn_set_row
(
&
dstPr
,
dstbuf
,
0
,
height
-
1
,
width
);
...
...
@@ -346,16 +343,16 @@ nlfilt_do_preview(GtkWidget *w) {
rowsize
=
thePreview
->
width
*
thePreview
->
bpp
;
dst
=
malloc
(
rowsize
);
c
=
malloc
(
rowsize
*
3
);
bcopy
(
thePreview
->
bits
,
c
,
rowsize
);
bcopy
(
thePreview
->
bits
,
c
+
rowsize
,
rowsize
*
2
);
memcpy
(
c
,
thePreview
->
bits
,
rowsize
);
memcpy
(
c
+
rowsize
,
thePreview
->
bits
,
rowsize
*
2
);
filtno
=
nlfiltInit
(
ap
->
alpha
,
ap
->
radius
,
ap
->
filter
);
nlfiltRow
(
c
,
dst
,
thePreview
->
width
,
thePreview
->
bpp
,
filtno
);
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
dst
,
0
,
0
,
thePreview
->
width
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
),
c
,
rowsize
*
2
);
bcopy
(
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
c
+
(
rowsize
*
2
),
rowsize
);
memcpy
(
c
,
thePreview
->
bits
+
((
thePreview
->
height
-
2
)
*
rowsize
)
,
rowsize
*
2
);
memcpy
(
c
+
(
rowsize
*
2
),
thePreview
->
bits
+
((
thePreview
->
height
-
1
)
*
rowsize
),
rowsize
);
gtk_preview_draw_row
(
GTK_PREVIEW
(
theWidget
),
dst
,
0
,
thePreview
->
height
-
1
,
thePreview
->
width
);
free
(
c
);
...
...
plug-ins/vpropagate/vpropagate.c
View file @
e5a3b374
...
...
@@ -39,7 +39,6 @@
#define PROGRESS_NAME "value propagating..."
#define MENU_POSITION "<Image>/Filters/Distorts/Value Propagate"
/* void bcopy(void *, void *, int); */
typedef
guchar
CH
;
#define RGB (1 << 0)
#define GRAY (1 << 1)
...
...
@@ -411,7 +410,7 @@ value_propagate_body (gint drawable_id)
dest
=
dest_row
+
(
x
*
bytes
);
here
=
cr
+
(
x
*
bytes
);
/* *** copy source value to best value holder *** */
bcopy
((
void
*
)
here
,
(
void
*
)
best
,
bytes
);
memcpy
((
void
*
)
best
,
(
void
*
)
here
,
bytes
);
if
(
operation
.
initializer
)
(
*
operation
.
initializer
)(
dtype
,
bytes
,
best
,
here
,
&
tmp
);
/* *** gather neighbors' values: loop-unfolded version *** */
...
...
@@ -569,7 +568,7 @@ propagate_white (dtype, bytes, orig, here, best, tmp)
if
(
*
(
float
*
)
tmp
<
v_here
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
*
(
float
*
)
tmp
=
v_here
;
bcopy
(
here
,
best
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
memcpy
(
best
,
here
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
}
break
;
case
GRAYA_IMAGE
:
...
...
@@ -615,7 +614,7 @@ propagate_black (image_type, channels, orig, here, best, tmp)
if
(
v_here
<
*
(
float
*
)
tmp
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
*
(
float
*
)
tmp
=
v_here
;
bcopy
(
here
,
best
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
memcpy
(
best
,
here
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
}
break
;
case
GRAYA_IMAGE
:
...
...
@@ -695,13 +694,13 @@ propagate_middle (image_type, channels, orig, here, best, tmp)
if
(
(
v_here
<=
data
->
minv
)
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
data
->
minv
=
v_here
;
bcopy
(
here
,
data
->
min
,
3
*
sizeof
(
CH
));
memcpy
(
data
->
min
,
here
,
3
*
sizeof
(
CH
));
data
->
min_modified
=
1
;
}
if
(
data
->
maxv
<=
v_here
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
data
->
maxv
=
v_here
;
bcopy
(
here
,
data
->
max
,
3
*
sizeof
(
CH
));
memcpy
(
data
->
max
,
here
,
3
*
sizeof
(
CH
));
data
->
max_modified
=
1
;
}
break
;
...
...
@@ -881,7 +880,7 @@ propagate_a_color (image_type, channels, orig, here, best, tmp)
if
(
here
[
0
]
==
fg
[
0
]
&&
here
[
1
]
==
fg
[
1
]
&&
here
[
2
]
==
fg
[
2
]
&&
value_difference_check
(
orig
,
here
,
3
)
)
{
bcopy
(
here
,
best
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
memcpy
(
best
,
here
,
3
*
sizeof
(
CH
));
/* alpha channel holds old value */
}
break
;
case
GRAYA_IMAGE
:
...
...
@@ -903,11 +902,11 @@ propagate_opaque (image_type, channels, orig, here, best, tmp)
{
case
RGBA_IMAGE
:
if
(
best
[
3
]
<
here
[
3
]
&&
value_difference_check
(
orig
,
here
,
3
)
)
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
case
GRAYA_IMAGE
:
if
(
best
[
1
]
<
here
[
1
]
&&
value_difference_check
(
orig
,
here
,
1
))
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
default:
break
;
...
...
@@ -925,11 +924,11 @@ propagate_transparent (image_type, channels, orig, here, best, tmp)
{
case
RGBA_IMAGE
:
if
(
here
[
3
]
<
best
[
3
]
&&
value_difference_check
(
orig
,
here
,
3
))
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
case
GRAYA_IMAGE
:
if
(
here
[
1
]
<
best
[
1
]
&&
value_difference_check
(
orig
,
here
,
1
))
bcopy
(
here
,
best
,
channels
*
sizeof
(
CH
));
memcpy
(
best
,
here
,
channels
*
sizeof
(
CH
));
break
;
default:
break
;
...
...
plug-ins/waves/waves.c
View file @
e5a3b374
...
...
@@ -126,7 +126,6 @@ run(char *name, int nparam, GParam *param,
*
nretvals
=
1
;
*
retvals
=
rvals
;
/* bzero(&args, sizeof(struct piArgs)); */
memset
(
&
args
,(
int
)
0
,
sizeof
(
struct
piArgs
));
args
.
type
=-
1
;
gimp_get_data
(
"plug_in_waves"
,
&
args
);
...
...
Write
Preview
Markdown
is supported
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