Issue #12771: (gimp-layer-new) is missing.

The libgimp wrapper was just calling the PDB procedure. Get rid of the
wrapper and make the PDB proc public. Also reorder the name argument to
be in the second place, just like it was for the wrapper.
This commit is contained in:
Jehan 2025-01-20 20:35:58 +01:00
parent 305303330c
commit e125c30cfd
35 changed files with 125 additions and 165 deletions

View file

@ -71,19 +71,19 @@ layer_new_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
const gchar *name;
gint width;
gint height;
gint type;
const gchar *name;
gdouble opacity;
gint mode;
GimpLayer *layer = NULL;
image = g_value_get_object (gimp_value_array_index (args, 0));
width = g_value_get_int (gimp_value_array_index (args, 1));
height = g_value_get_int (gimp_value_array_index (args, 2));
type = g_value_get_enum (gimp_value_array_index (args, 3));
name = g_value_get_string (gimp_value_array_index (args, 4));
name = g_value_get_string (gimp_value_array_index (args, 1));
width = g_value_get_int (gimp_value_array_index (args, 2));
height = g_value_get_int (gimp_value_array_index (args, 3));
type = g_value_get_enum (gimp_value_array_index (args, 4));
opacity = g_value_get_double (gimp_value_array_index (args, 5));
mode = g_value_get_enum (gimp_value_array_index (args, 6));
@ -1299,12 +1299,16 @@ register_layer_procs (GimpPDB *pdb)
/*
* gimp-layer-new
*/
procedure = gimp_procedure_new (layer_new_invoker, TRUE, TRUE);
procedure = gimp_procedure_new (layer_new_invoker, TRUE, FALSE);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-layer-new");
gimp_procedure_set_static_help (procedure,
"Create a new layer.",
"This procedure creates a new layer with the specified width, height, and type. If @name is %NULL, a default layer name will be used. Opacity, and mode are also supplied parameters. The new layer still needs to be added to the image, as this is not automatic. Add the new layer with the 'gimp-image-insert-layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.",
"This procedure creates a new layer with the specified @width, @height and @type. If @name is %NULL, a default layer name will be used. @opacity and @mode are also supplied parameters.\n"
"\n"
"The new layer still needs to be added to the image as this is not automatic. Add the new layer with the [method@Image.insert_layer] method.\n"
"\n"
"Other attributes such as layer mask modes and offsets should be set with explicit procedure calls.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
@ -1316,6 +1320,13 @@ register_layer_procs (GimpPDB *pdb)
"The image to which to add the layer",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("name",
"name",
"The layer name",
FALSE, TRUE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_int ("width",
"width",
@ -1335,13 +1346,6 @@ register_layer_procs (GimpPDB *pdb)
GIMP_TYPE_IMAGE_TYPE,
GIMP_RGB_IMAGE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("name",
"name",
"The layer name",
FALSE, TRUE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity",
"opacity",
@ -1358,7 +1362,7 @@ register_layer_procs (GimpPDB *pdb)
gimp_procedure_add_return_value (procedure,
gimp_param_spec_layer ("layer",
"layer",
"The newly created layer",
"The newly created layer. The object belongs to libgimp and you should not free it.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);

View file

@ -73,51 +73,6 @@ gimp_layer_get_by_id (gint32 layer_id)
return NULL;
}
/**
* gimp_layer_new:
* @image: The image to which to add the layer.
* @name: (nullable): The layer name.
* @width: The layer width.
* @height: The layer height.
* @type: The layer type.
* @opacity: The layer opacity.
* @mode: The layer combination mode.
*
* Create a new layer.
*
* This procedure creates a new layer with the specified @width, @height, and
* @type. If @name is %NULL, a default layer name will be used.
* @opacity and @mode are also supplied parameters.
*
* The new layer still needs to be added to the image, as this is not automatic.
* Add the new layer with the [method@Image.insert_layer] method.
*
* Other attributes such as layer mask modes, and offsets should be set with
* explicit procedure calls.
*
* Returns: (transfer none): The newly created layer.
* The object belongs to libgimp and you should not free it.
*
* Since: 3.0
*/
GimpLayer *
gimp_layer_new (GimpImage *image,
const gchar *name,
gint width,
gint height,
GimpImageType type,
gdouble opacity,
GimpLayerMode mode)
{
return _gimp_layer_new (image,
width,
height,
type,
name,
opacity,
mode);
}
/**
* gimp_layer_copy:
* @layer: The layer to copy.

View file

@ -58,14 +58,6 @@ struct _GimpLayerClass
GimpLayer * gimp_layer_get_by_id (gint32 layer_id);
GimpLayer * gimp_layer_new (GimpImage *image,
const gchar *name,
gint width,
gint height,
GimpImageType type,
gdouble opacity,
GimpLayerMode mode) G_GNUC_WARN_UNUSED_RESULT;
GimpLayer * gimp_layer_new_from_pixbuf (GimpImage *image,
const gchar *name,
GdkPixbuf *pixbuf,

View file

@ -37,35 +37,39 @@
/**
* _gimp_layer_new:
* gimp_layer_new:
* @image: The image to which to add the layer.
* @name: (nullable): The layer name.
* @width: The layer width.
* @height: The layer height.
* @type: The layer type.
* @name: (nullable): The layer name.
* @opacity: The layer opacity.
* @mode: The layer combination mode.
*
* Create a new layer.
*
* This procedure creates a new layer with the specified width, height,
* and type. If @name is %NULL, a default layer name will be used.
* Opacity, and mode are also supplied parameters. The new layer still
* needs to be added to the image, as this is not automatic. Add the
* new layer with the gimp_image_insert_layer() command. Other
* attributes such as layer mask modes, and offsets should be set with
* explicit procedure calls.
* This procedure creates a new layer with the specified @width,
* @height and @type. If @name is %NULL, a default layer name will be
* used. @opacity and @mode are also supplied parameters.
*
* Returns: (transfer none): The newly created layer.
* The new layer still needs to be added to the image as this is not
* automatic. Add the new layer with the [method@Image.insert_layer]
* method.
*
* Other attributes such as layer mask modes and offsets should be set
* with explicit procedure calls.
*
* Returns: (transfer none):
* The newly created layer. The object belongs to libgimp and you should not free it.
**/
GimpLayer *
_gimp_layer_new (GimpImage *image,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gdouble opacity,
GimpLayerMode mode)
gimp_layer_new (GimpImage *image,
const gchar *name,
gint width,
gint height,
GimpImageType type,
gdouble opacity,
GimpLayerMode mode)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -73,10 +77,10 @@ _gimp_layer_new (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
G_TYPE_STRING, name,
G_TYPE_INT, width,
G_TYPE_INT, height,
GIMP_TYPE_IMAGE_TYPE, type,
G_TYPE_STRING, name,
G_TYPE_DOUBLE, opacity,
GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);

View file

@ -32,11 +32,11 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
G_GNUC_INTERNAL GimpLayer* _gimp_layer_new (GimpImage *image,
GimpLayer* gimp_layer_new (GimpImage *image,
const gchar *name,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gdouble opacity,
GimpLayerMode mode);
GimpLayer* gimp_layer_new_from_visible (GimpImage *image,

View file

@ -20,30 +20,33 @@ sub layer_new {
$blurb = 'Create a new layer.';
$help = <<'HELP';
This procedure creates a new layer with the specified width, height,
and type. If @name is %NULL, a default layer name will be used.
Opacity, and mode are also supplied parameters. The
new layer still needs to be added to the image, as this is not
automatic. Add the new layer with the gimp_image_insert_layer()
command. Other attributes such as layer mask modes, and offsets should
be set with explicit procedure calls.
This procedure creates a new layer with the specified @width, @height
and @type. If @name is %NULL, a default layer name will be used.
@opacity and @mode are also supplied parameters.
The new layer still needs to be added to the image as this is not
automatic. Add the new layer with the [method@Image.insert_layer]
method.
Other attributes such as layer mask modes and offsets should be set
with explicit procedure calls.
HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image to which to add the layer' },
{ name => 'name', type => 'string',
desc => 'The layer name', none_ok => 0 },
{ name => 'width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The layer width' },
{ name => 'height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The layer height' },
{ name => 'type', type => 'enum GimpImageType',
desc => 'The layer type' },
{ name => 'name', type => 'string',
desc => 'The layer name', none_ok => 0 },
{ name => 'opacity', type => '0 <= double <= 100',
desc => 'The layer opacity' },
{ name => 'mode', type => 'enum GimpLayerMode',
@ -53,7 +56,7 @@ HELP
@outargs = (
{ name => 'layer', type => 'layer',
desc => 'The newly created layer' }
desc => 'The newly created layer. The object belongs to libgimp and you should not free it.' }
);
%invoke = (

View file

@ -69,10 +69,10 @@
; Bumpmap has a one pixel border on each side
(bump-layer (car (gimp-layer-new image
_"Bumpmap"
(+ width 2)
(+ height 2)
RGB-IMAGE
_"Bumpmap"
100
LAYER-MODE-NORMAL)))

View file

@ -118,10 +118,10 @@
(set! innerwidth (- imagewidth (* 2 xsize)))
(set! innerheight (- imageheight (* 2 ysize)))))
(let* ((layer (car (gimp-layer-new aimg
(let* ((layer (car (gimp-layer-new aimg _"Border Layer"
outerwidth outerheight
(car (gimp-drawable-type-with-alpha first-layer))
_"Border Layer" 100 LAYER-MODE-NORMAL))))
100 LAYER-MODE-NORMAL))))
(gimp-context-push)
(gimp-context-set-antialias FALSE)

View file

@ -70,7 +70,7 @@
(bg-height (car (gimp-drawable-get-height src-layer)))
(bg-type (car (gimp-drawable-type src-layer)))
(bg-image (car (gimp-item-get-image src-layer)))
(layer1 (car (gimp-layer-new img bg-width bg-height bg-type "Layer1" 100 LAYER-MODE-NORMAL)))
(layer1 (car (gimp-layer-new img "Layer1" bg-width bg-height bg-type 100 LAYER-MODE-NORMAL)))
)
(gimp-context-push)

View file

@ -150,11 +150,11 @@
(brush-size (sota-scale size 0.5 chrome-factor))
(brush (gimp-brush-new "Chrome It"))
(mask (gimp-channel-new img "Chrome Stencil" width height 50 '(0 0 0)))
(bg-layer (gimp-layer-new img width height GRAY-IMAGE _"Background" 100 LAYER-MODE-NORMAL))
(layer1 (gimp-layer-new img banding-width banding-height banding-type _"Layer 1" 100 LAYER-MODE-NORMAL))
(layer2 (gimp-layer-new img width height GRAYA-IMAGE _"Layer 2" 100 LAYER-MODE-DIFFERENCE))
(layer3 (gimp-layer-new img width height GRAYA-IMAGE _"Layer 3" 100 LAYER-MODE-NORMAL))
(shadow (gimp-layer-new img width height GRAYA-IMAGE _"Drop Shadow" 100 LAYER-MODE-NORMAL))
(bg-layer (gimp-layer-new img _"Background" width height GRAY-IMAGE 100 LAYER-MODE-NORMAL))
(layer1 (gimp-layer-new img _"Layer 1" banding-width banding-height banding-type 100 LAYER-MODE-NORMAL))
(layer2 (gimp-layer-new img _"Layer 2" width height GRAYA-IMAGE 100 LAYER-MODE-DIFFERENCE))
(layer3 (gimp-layer-new img _"Layer 3" width height GRAYA-IMAGE 100 LAYER-MODE-NORMAL))
(shadow (gimp-layer-new img _"Drop Shadow" width height GRAYA-IMAGE 100 LAYER-MODE-NORMAL))
(layer-mask 0)
(marble-pattern (gimp-pattern-get-by-name "Marble #1"))
)

View file

@ -69,10 +69,10 @@
(if (= separate-layer TRUE)
(begin
(set! effect-layer (car (gimp-layer-new image
_"Effect layer"
select-width
select-height
type
_"Effect layer"
100
LAYER-MODE-NORMAL)))

View file

@ -10,8 +10,8 @@
(width (car (gimp-drawable-get-width tdrawable)))
(height (car (gimp-drawable-get-height tdrawable)))
(img (car (gimp-image-new width height RGB)))
; (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 LAYER-MODE-MULTIPLY)))
(layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 LAYER-MODE-NORMAL)))
; (layer-two (car (gimp-layer-new img "Y Dots" width height RGB-IMAGE 100 LAYER-MODE-MULTIPLY)))
(layer-one (car (gimp-layer-new img "X Dots" width height RGB-IMAGE 100 LAYER-MODE-NORMAL)))
(layer-two 0)
(bump-layer 0)
)

View file

@ -38,8 +38,8 @@
(while (> theNumber 0)
(set! theNumber (- theNumber 1))
(set! theStain (gimp-layer-new theImage theSize theSize
RGBA-IMAGE _"Stain" 100
(set! theStain (gimp-layer-new theImage _"Stain" theSize theSize
RGBA-IMAGE 100
; inDark is [0, 1] not [#f, #t]
(if (= inDark TRUE)
LAYER-MODE-DARKEN-ONLY

View file

@ -38,8 +38,8 @@
(gimp-image-undo-group-start image)
; Create the cloud layer
(set! diff-clouds (car (gimp-layer-new image width height type
"Clouds" 100 LAYER-MODE-DIFFERENCE)))
(set! diff-clouds (car (gimp-layer-new image "Clouds" width height type
100 LAYER-MODE-DIFFERENCE)))
; Add the cloud layer above the current layer
(gimp-image-insert-layer image diff-clouds 0 -1)

View file

@ -57,10 +57,10 @@
(set! theMode RGBA-IMAGE)
)
(set! theLayer (car (gimp-layer-new theImage
"Distress Scratch Layer"
theWidth
theHeight
theMode
"Distress Scratch Layer"
100
LAYER-MODE-NORMAL)))

View file

@ -123,10 +123,10 @@
)
(set! shadow-layer (car (gimp-layer-new image
"Drop Shadow"
shadow-width
shadow-height
type
"Drop Shadow"
shadow-opacity
LAYER-MODE-NORMAL)))
(gimp-image-set-selected-layers image (make-vector 1 drawable))

View file

@ -90,9 +90,10 @@
(* labels (* label-size num-fonts))))
(img (car (gimp-image-new width height (if (= colors 0)
GRAY RGB))))
(drawable (car (gimp-layer-new img width height (if (= colors 0)
GRAY-IMAGE RGB-IMAGE)
"Background" 100 LAYER-MODE-NORMAL)))
(drawable (car (gimp-layer-new img "Background"
width height (if (= colors 0)
GRAY-IMAGE RGB-IMAGE)
100 LAYER-MODE-NORMAL)))
(count 0)
(font "")
(font-object '())
@ -112,10 +113,10 @@
(if (= labels TRUE)
(begin
(set! drawable (car (gimp-layer-new img width height
(set! drawable (car (gimp-layer-new img "Labels" width height
(if (= colors 0)
GRAYA-IMAGE RGBA-IMAGE)
"Labels" 100 LAYER-MODE-NORMAL)))
100 LAYER-MODE-NORMAL)))
(gimp-image-insert-layer img drawable 0 -1)))
(gimp-drawable-edit-clear drawable)

View file

@ -67,10 +67,10 @@
)
(set! theLayer (car (gimp-layer-new theImage
"layer 1"
theWidth
theHeight
RGBA-IMAGE
"layer 1"
100
LAYER-MODE-NORMAL)))

View file

@ -23,8 +23,8 @@
gradient-reverse)
(let* (
(img (car (gimp-image-new width height RGB)))
(drawable (car (gimp-layer-new img width height RGB
"Gradient example" 100 LAYER-MODE-NORMAL)))
(drawable (car (gimp-layer-new img "Gradient example" width height RGB
100 LAYER-MODE-NORMAL)))
; Calculate colors for checkerboard... just like in the gradient editor

View file

@ -74,10 +74,10 @@
(if (= separate-layer TRUE)
(begin
(set! lava-layer (car (gimp-layer-new image
"Lava Layer"
select-width
select-height
type
"Lava Layer"
100
LAYER-MODE-NORMAL-LEGACY)))

View file

@ -24,9 +24,9 @@
(define (script-fu-make-brush-rectangular name width height spacing)
(let* (
(img (car (gimp-image-new width height GRAY)))
(drawable (car (gimp-layer-new img
(drawable (car (gimp-layer-new img "MakeBrush"
width height GRAY-IMAGE
"MakeBrush" 100 LAYER-MODE-NORMAL)))
100 LAYER-MODE-NORMAL)))
(filename (string-append gimp-directory
"/brushes/r"
(number->string width)
@ -81,9 +81,9 @@
(widthplus (+ width feathering))
(heightplus (+ height feathering))
(img (car (gimp-image-new widthplus heightplus GRAY)))
(drawable (car (gimp-layer-new img
(drawable (car (gimp-layer-new img "MakeBrush"
widthplus heightplus GRAY-IMAGE
"MakeBrush" 100 LAYER-MODE-NORMAL)))
100 LAYER-MODE-NORMAL)))
(filename (string-append gimp-directory
"/brushes/r"
(number->string width)
@ -147,9 +147,9 @@
(define (script-fu-make-brush-elliptical name width height spacing)
(let* (
(img (car (gimp-image-new width height GRAY)))
(drawable (car (gimp-layer-new img
(drawable (car (gimp-layer-new img "MakeBrush"
width height GRAY-IMAGE
"MakeBrush" 100 LAYER-MODE-NORMAL)))
100 LAYER-MODE-NORMAL)))
(filename (string-append gimp-directory
"/brushes/e"
(number->string width)
@ -204,9 +204,9 @@
(widthplus (+ feathering width)) ; add 3 for blurring
(heightplus (+ feathering height))
(img (car (gimp-image-new widthplus heightplus GRAY)))
(drawable (car (gimp-layer-new img
(drawable (car (gimp-layer-new img "MakeBrush"
widthplus heightplus GRAY-IMAGE
"MakeBrush" 100 LAYER-MODE-NORMAL)))
100 LAYER-MODE-NORMAL)))
(filename (string-append gimp-directory
"/brushes/e"
(number->string width)

View file

@ -57,8 +57,8 @@
(set! theHeight (car (gimp-image-get-height theImage)))
(if (= inMottle TRUE)
(let (
(mLayer (car (gimp-layer-new theImage theWidth theHeight
RGBA-IMAGE "Mottle"
(mLayer (car (gimp-layer-new theImage "Mottle"
theWidth theHeight RGBA-IMAGE
100 LAYER-MODE-DARKEN-ONLY)))
)

View file

@ -96,10 +96,10 @@
(set! shadow-layer (car (gimp-layer-new image
"Perspective Shadow"
select-width
select-height
type
"Perspective Shadow"
shadow-opacity
LAYER-MODE-NORMAL)))

View file

@ -16,10 +16,10 @@
(quotient (car (gimp-drawable-type drawable))
2))))
(map-layer (car (gimp-layer-new work-image
"Ripple Map"
width
height
(car (gimp-drawable-type drawable))
"Ripple Map"
100
LAYER-MODE-NORMAL))))
(gimp-context-push)

View file

@ -104,10 +104,10 @@
; optionally add a background
(if (= background-toggle TRUE)
(let* ((bg-layer (car (gimp-layer-new image
"Background"
width
height
type
"Background"
100
LAYER-MODE-NORMAL))))
(gimp-drawable-fill bg-layer FILL-BACKGROUND)

View file

@ -79,17 +79,17 @@
(hole-radius (/ hole-width 4))
(hole-start (- (/ (random 1000) 1000) 0.5))
(film-layer (car (gimp-layer-new image
"Film"
width
height
type
"Film"
100
LAYER-MODE-NORMAL)))
(bg-layer (car (gimp-layer-new image
"Background"
width
height
type
"Background"
100
LAYER-MODE-NORMAL)))
(pic-layer (vector-ref (car (gimp-image-get-selected-drawables image)) 0))

View file

@ -48,8 +48,8 @@
(width (* radius 3.75))
(height (* radius 2.5))
(img (gimp-image-new width height RGB)) ; v3 >>> elide car
(drawable (gimp-layer-new img width height RGB-IMAGE
"Sphere Layer" 100 LAYER-MODE-NORMAL))
(drawable (gimp-layer-new img "Sphere Layer" width height RGB-IMAGE
100 LAYER-MODE-NORMAL))
(radians (/ (* light *pi*) 180))
(cx (/ width 2))
(cy (/ height 2))

View file

@ -12,8 +12,8 @@
(width (car (gimp-drawable-get-width tdrawable)))
(height (car (gimp-drawable-get-height tdrawable)))
(img (car (gimp-image-new width height RGB)))
; (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 LAYER-MODE-MULTIPLY)))
(layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 LAYER-MODE-NORMAL)))
; (layer-two (car (gimp-layer-new img "Y Dots" width height RGB-IMAGE 100 LAYER-MODE-MULTIPLY)))
(layer-one (car (gimp-layer-new img "X Dots" width height RGB-IMAGE 100 LAYER-MODE-NORMAL)))
(layer-two 0)
(bump-layer 0)
)

View file

@ -13,8 +13,8 @@
(width (car (gimp-drawable-get-width tdrawable)))
(height (car (gimp-drawable-get-height tdrawable)))
(img (car (gimp-image-new width height RGB)))
; (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 LAYER-MODE-MULTIPLY)))
(layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 LAYER-MODE-NORMAL)))
; (layer-two (car (gimp-layer-new img "Y Dots" width height RGB-IMAGE 100 LAYER-MODE-MULTIPLY)))
(layer-one (car (gimp-layer-new img "X Dots" width height RGB-IMAGE 100 LAYER-MODE-NORMAL)))
(layer-two 0)
(bump-layer 0)
)

View file

@ -199,9 +199,9 @@
(gimp-image-undo-disable sheet-img)
(set! sheet-layer (car (gimp-layer-new sheet-img sheet-width sheet-height
RGB-IMAGE "Background"
100 LAYER-MODE-NORMAL)))
(set! sheet-layer (car (gimp-layer-new sheet-img "Background"
sheet-width sheet-height
RGB-IMAGE 100 LAYER-MODE-NORMAL)))
(gimp-image-insert-layer sheet-img sheet-layer 0 0)
(init-sheet-img sheet-img sheet-num sheet-width border-y off-y)

View file

@ -159,8 +159,9 @@
(width (* radius 3.75))
(height (* radius 2.5))
(img (car (gimp-image-new width height RGB)))
(drawable (car (gimp-layer-new img width height RGB-IMAGE
"Sphere Layer" 100 LAYER-MODE-NORMAL)))
(drawable (car (gimp-layer-new img "Sphere Layer"
width height RGB-IMAGE
100 LAYER-MODE-NORMAL)))
(radians (/ (* light *pi*) 180))
(cx (/ width 2))
(cy (/ height 2))

View file

@ -17,8 +17,8 @@
(width (gimp-drawable-get-width tdrawable))
(height (gimp-drawable-get-height tdrawable))
(img (gimp-image-new width height RGB))
; (layer-two (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 LAYER-MODE-MULTIPLY))
(layer-one (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 LAYER-MODE-NORMAL))
; (layer-two (gimp-layer-new img "Y Dots" width height RGB-IMAGE 100 LAYER-MODE-MULTIPLY))
(layer-one (gimp-layer-new img "X Dots" width height RGB-IMAGE 100 LAYER-MODE-NORMAL))
(layer-two 0)
(bump-layer 0)
)

View file

@ -21,9 +21,9 @@
(drawable-width (car (gimp-drawable-get-width drw)))
(drawable-height (car (gimp-drawable-get-height drw)))
(new-image (car (gimp-image-new drawable-width drawable-height RGB)))
(original-layer (car (gimp-layer-new new-image
(original-layer (car (gimp-layer-new new-image "Original"
drawable-width drawable-height
RGB-IMAGE "Original"
RGB-IMAGE
100 LAYER-MODE-NORMAL)))
(original-layer-for-darker 0)
(original-layer-for-lighter 0)

View file

@ -50,8 +50,8 @@
(let* ((tile-size (+ (* 2 ribbon-width) (* 2 ribbon-spacing)))
(darkness (* 255 (/ (- 100 shadow-darkness) 100)))
(img (car (gimp-image-new tile-size tile-size RGB)))
(drawable (car (gimp-layer-new img tile-size tile-size RGB-IMAGE
"Weave tile" 100 LAYER-MODE-NORMAL))))
(drawable (car (gimp-layer-new img "Weave tile" tile-size tile-size RGB-IMAGE
100 LAYER-MODE-NORMAL))))
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)
@ -174,8 +174,8 @@
r3-height)
(let* ((tile-size (+ (* 2 ribbon-width) (* 2 ribbon-spacing)))
(img (car (gimp-image-new tile-size tile-size RGB)))
(drawable (car (gimp-layer-new img tile-size tile-size RGB-IMAGE
"Mask" 100 LAYER-MODE-NORMAL))))
(drawable (car (gimp-layer-new img "Mask" tile-size tile-size RGB-IMAGE
100 LAYER-MODE-NORMAL))))
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)
@ -277,8 +277,8 @@
length
density
orientation)
(let* ((drawable (car (gimp-layer-new img width height RGBA-IMAGE
"Threads" 100 LAYER-MODE-NORMAL)))
(let* ((drawable (car (gimp-layer-new img "Threads" width height RGBA-IMAGE
100 LAYER-MODE-NORMAL)))
(dense (/ density 100.0)))
(gimp-image-insert-layer img drawable 0 -1)
(gimp-context-set-background '(255 255 255))

View file

@ -66,7 +66,7 @@
(set! from-selection TRUE)
(set! active-selection (car (gimp-selection-save image)))))
(set! hl-layer (car (gimp-layer-new image image-width image-height type _"Highlight" 100 LAYER-MODE-NORMAL)))
(set! hl-layer (car (gimp-layer-new image _"Highlight" image-width image-height type 100 LAYER-MODE-NORMAL)))
(gimp-image-insert-layer image hl-layer 0 -1)
(gimp-selection-none image)
@ -87,10 +87,10 @@
(gimp-drawable-edit-fill mask FILL-BACKGROUND)
(set! shadow-layer (car (gimp-layer-new image
_"Shadow"
image-width
image-height
type
_"Shadow"
ds-opacity
LAYER-MODE-NORMAL)))
(gimp-image-insert-layer image shadow-layer 0 -1)