Top | ![]() |
![]() |
![]() |
![]() |
GimpDrawable * | gimp_drawable_get_by_id () |
GeglBuffer * | gimp_drawable_get_buffer () |
GeglBuffer * | gimp_drawable_get_shadow_buffer () |
const Babl * | gimp_drawable_get_format () |
const Babl * | gimp_drawable_get_thumbnail_format () |
guchar * | gimp_drawable_get_thumbnail_data () |
GdkPixbuf * | gimp_drawable_get_thumbnail () |
guint8 * | gimp_drawable_get_pixel () |
gboolean | gimp_drawable_set_pixel () |
guchar * | gimp_drawable_get_sub_thumbnail_data () |
GdkPixbuf * | gimp_drawable_get_sub_thumbnail () |
gboolean | gimp_drawable_merge_shadow () |
gboolean | gimp_drawable_free_shadow () |
gboolean | gimp_drawable_fill () |
gboolean | gimp_drawable_update () |
gboolean | gimp_drawable_mask_bounds () |
gboolean | gimp_drawable_mask_intersect () |
gboolean | gimp_drawable_has_alpha () |
GimpImageType | gimp_drawable_type_with_alpha () |
GimpImageType | gimp_drawable_type () |
gboolean | gimp_drawable_is_rgb () |
gboolean | gimp_drawable_is_gray () |
gboolean | gimp_drawable_is_indexed () |
gboolean | gimp_drawable_offset () |
gboolean | gimp_drawable_foreground_extract () |
GimpDrawable *
gimp_drawable_get_by_id (gint32 drawable_id
);
Returns a GimpDrawable representing drawable_id
. This function
calls gimp_item_get_by_id()
and returns the item if it is drawable
or NULL
otherwise.
a GimpDrawable for
drawable_id
or NULL
if drawable_id
does not represent a
valid drawable. The object belongs to libgimp and you must
not modify or unref it.
[nullable][transfer none]
Since: 3.0
GeglBuffer *
gimp_drawable_get_buffer (GimpDrawable *drawable
);
Returns a GeglBuffer of a specified drawable. The buffer can be used
like any other GEGL buffer. Its data will we synced back with the core
drawable when the buffer gets destroyed, or when gegl_buffer_flush()
is called.
Since: 2.10
GeglBuffer *
gimp_drawable_get_shadow_buffer (GimpDrawable *drawable
);
Returns a GeglBuffer of a specified drawable's shadow tiles. The
buffer can be used like any other GEGL buffer. Its data will we
synced back with the core drawable's shadow tiles when the buffer
gets destroyed, or when gegl_buffer_flush()
is called.
Since: 2.10
const Babl *
gimp_drawable_get_format (GimpDrawable *drawable
);
Returns the Babl format of the drawable.
Since: 2.10
const Babl *
gimp_drawable_get_thumbnail_format (GimpDrawable *drawable
);
Returns the Babl thumbnail format of the drawable.
Since: 2.10.14
guchar * gimp_drawable_get_thumbnail_data (GimpDrawable *drawable
,gint *width
,gint *height
,gint *bpp
);
Retrieves thumbnail data for the drawable identified by drawable
.
The thumbnail will be not larger than the requested size.
GdkPixbuf * gimp_drawable_get_thumbnail (GimpDrawable *drawable
,gint width
,gint height
,GimpPixbufTransparency alpha
);
Retrieves a thumbnail pixbuf for the drawable identified by
drawable
. The thumbnail will be not larger than the requested
size.
drawable |
the drawable |
|
width |
the requested thumbnail width (<= 1024 pixels) |
|
height |
the requested thumbnail height (<= 1024 pixels) |
|
alpha |
how to handle an alpha channel |
Since: 2.2
guint8 * gimp_drawable_get_pixel (GimpDrawable *drawable
,gint x_coord
,gint y_coord
,gint *num_channels
);
Gets the value of the pixel at the specified coordinates.
This procedure gets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the specified drawable.
gboolean gimp_drawable_set_pixel (GimpDrawable *drawable
,gint x_coord
,gint y_coord
,gint num_channels
,const guint8 *pixel
);
Sets the value of the pixel at the specified coordinates.
This procedure sets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the specified drawable. Note that this function is not undoable, you should use it only on drawables you just created yourself.
guchar * gimp_drawable_get_sub_thumbnail_data (GimpDrawable *drawable
,gint src_x
,gint src_y
,gint src_width
,gint src_height
,gint *dest_width
,gint *dest_height
,gint *bpp
);
Retrieves thumbnail data for the drawable identified by drawable
.
The thumbnail will be not larger than the requested size.
drawable |
the drawable ID |
|
src_x |
the x coordinate of the area |
|
src_y |
the y coordinate of the area |
|
src_width |
the width of the area |
|
src_height |
the height of the area |
|
dest_width |
the requested thumbnail width (<= 1024 pixels). |
[inout] |
dest_height |
the requested thumbnail height (<= 1024 pixels). |
[inout] |
bpp |
the bytes per pixel of the returned thumbnail data. |
[out] |
GdkPixbuf * gimp_drawable_get_sub_thumbnail (GimpDrawable *drawable
,gint src_x
,gint src_y
,gint src_width
,gint src_height
,gint dest_width
,gint dest_height
,GimpPixbufTransparency alpha
);
Retrieves a thumbnail pixbuf for the drawable identified by
drawable
. The thumbnail will be not larger than the requested
size.
drawable |
the drawable ID |
|
src_x |
the x coordinate of the area |
|
src_y |
the y coordinate of the area |
|
src_width |
the width of the area |
|
src_height |
the height of the area |
|
dest_width |
the requested thumbnail width (<= 1024 pixels) |
|
dest_height |
the requested thumbnail height (<= 1024 pixels) |
|
alpha |
how to handle an alpha channel |
Since: 2.2
gboolean gimp_drawable_merge_shadow (GimpDrawable *drawable
,gboolean undo
);
Merge the shadow buffer with the specified drawable.
This procedure combines the contents of the drawable's shadow buffer (for temporary processing) with the specified drawable. The 'undo' parameter specifies whether to add an undo step for the operation. Requesting no undo is useful for such applications as 'auto-apply'.
gboolean
gimp_drawable_free_shadow (GimpDrawable *drawable
);
Free the specified drawable's shadow data (if it exists).
This procedure is intended as a memory saving device. If any shadow memory has been allocated, it will be freed automatically when the drawable is removed from the image, or when the plug-in procedure which allocated it returns.
Since: 2.6
gboolean gimp_drawable_fill (GimpDrawable *drawable
,GimpFillType fill_type
);
Fill the drawable with the specified fill mode.
This procedure fills the drawable. If the fill mode is foreground
the current foreground color is used. If the fill mode is
background, the current background color is used. If the fill type
is white, then white is used. Transparent fill only affects layers
with an alpha channel, in which case the alpha channel is set to
transparent. If the drawable has no alpha channel, it is filled to
white. No fill leaves the drawable's contents undefined.
This procedure is unlike gimp_drawable_edit_fill()
or the bucket
fill tool because it fills regardless of a selection. Its main
purpose is to fill a newly created drawable before adding it to the
image. This operation cannot be undone.
gboolean gimp_drawable_update (GimpDrawable *drawable
,gint x
,gint y
,gint width
,gint height
);
Update the specified region of the drawable.
This procedure updates the specified region of the drawable. The (x, y) coordinate pair is relative to the drawable's origin, not to the image origin. Therefore, the entire drawable can be updated using (0, 0, width, height).
gboolean gimp_drawable_mask_bounds (GimpDrawable *drawable
,gint *x1
,gint *y1
,gint *x2
,gint *y2
);
Find the bounding box of the current selection in relation to the specified drawable.
This procedure returns whether there is a selection. If there is
one, the upper left and lower right-hand corners of its bounding box
are returned. These coordinates are specified relative to the
drawable's origin, and bounded by the drawable's extents. Please
note that the pixel specified by the lower right-hand coordinate of
the bounding box is not part of the selection. The selection ends at
the upper left corner of this pixel. This means the width of the
selection can be calculated as (x2 - x1), its height as (y2 - y1).
Note that the returned boolean does NOT correspond with the returned
region being empty or not, it always returns whether the selection
is non_empty. See gimp_drawable_mask_intersect()
for a boolean
return value which is more useful in most cases.
drawable |
The drawable. |
|
x1 |
x coordinate of the upper left corner of selection bounds. |
[out] |
y1 |
y coordinate of the upper left corner of selection bounds. |
[out] |
x2 |
x coordinate of the lower right corner of selection bounds. |
[out] |
y2 |
y coordinate of the lower right corner of selection bounds. |
[out] |
gboolean gimp_drawable_mask_intersect (GimpDrawable *drawable
,gint *x
,gint *y
,gint *width
,gint *height
);
Find the bounding box of the current selection in relation to the specified drawable.
This procedure returns whether there is an intersection between the
drawable and the selection. Unlike gimp_drawable_mask_bounds()
, the
intersection's bounds are returned as x, y, width, height.
If there is no selection this function returns TRUE and the returned
bounds are the extents of the whole drawable.
drawable |
The drawable. |
|
x |
x coordinate of the upper left corner of the intersection. |
[out] |
y |
y coordinate of the upper left corner of the intersection. |
[out] |
width |
width of the intersection. |
[out] |
height |
height of the intersection. |
[out] |
Since: 2.2
gboolean
gimp_drawable_has_alpha (GimpDrawable *drawable
);
Returns TRUE if the drawable has an alpha channel.
This procedure returns whether the specified drawable has an alpha channel. This can only be true for layers, and the associated type will be one of: { RGBA , GRAYA, INDEXEDA }.
GimpImageType
gimp_drawable_type_with_alpha (GimpDrawable *drawable
);
Returns the drawable's type with alpha.
This procedure returns the drawable's type as if had an alpha channel. If the type is currently Gray, for instance, the returned type would be GrayA. If the drawable already has an alpha channel, the drawable's type is simply returned.
GimpImageType
gimp_drawable_type (GimpDrawable *drawable
);
Returns the drawable's type.
This procedure returns the drawable's type.
gboolean
gimp_drawable_is_rgb (GimpDrawable *drawable
);
Returns whether the drawable is an RGB type.
This procedure returns TRUE if the specified drawable is of type { RGB, RGBA }.
gboolean
gimp_drawable_is_gray (GimpDrawable *drawable
);
Returns whether the drawable is a grayscale type.
This procedure returns TRUE if the specified drawable is of type { Gray, GrayA }.
gboolean
gimp_drawable_is_indexed (GimpDrawable *drawable
);
Returns whether the drawable is an indexed type.
This procedure returns TRUE if the specified drawable is of type { Indexed, IndexedA }.
gboolean gimp_drawable_offset (GimpDrawable *drawable
,gboolean wrap_around
,GimpOffsetType fill_type
,gint offset_x
,gint offset_y
);
Offset the drawable by the specified amounts in the X and Y directions
This procedure offsets the specified drawable by the amounts specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to TRUE, then portions of the drawable which are offset out of bounds are wrapped around. Alternatively, the undefined regions of the drawable can be filled with transparency or the background color, as specified by the 'fill-type' parameter.
gboolean gimp_drawable_foreground_extract (GimpDrawable *drawable
,GimpForegroundExtractMode mode
,GimpDrawable *mask
);
Extract the foreground of a drawable using a given trimap.
Image Segmentation by Uniform Color Clustering, see https://www.inf.fu-berlin.de/inst/pubs/tr-b-05-07.pdf
Since: 2.4