本文整理匯總了C++中GIMP_IS_DRAWABLE函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIMP_IS_DRAWABLE函數的具體用法?C++ GIMP_IS_DRAWABLE怎麽用?C++ GIMP_IS_DRAWABLE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GIMP_IS_DRAWABLE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: gimp_paint_core_validate_undo_tiles
void
gimp_paint_core_validate_undo_tiles (GimpPaintCore *core,
GimpDrawable *drawable,
gint x,
gint y,
gint w,
gint h)
{
gint i, j;
g_return_if_fail (GIMP_IS_PAINT_CORE (core));
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (core->undo_tiles != NULL);
for (i = y; i < (y + h); i += (TILE_HEIGHT - (i % TILE_HEIGHT)))
{
for (j = x; j < (x + w); j += (TILE_WIDTH - (j % TILE_WIDTH)))
{
Tile *dest_tile = tile_manager_get_tile (core->undo_tiles,
j, i, FALSE, FALSE);
if (! tile_is_valid (dest_tile))
{
Tile *src_tile =
tile_manager_get_tile (gimp_drawable_get_tiles (drawable),
j, i, TRUE, FALSE);
tile_manager_map_tile (core->undo_tiles, j, i, src_tile);
tile_release (src_tile, FALSE);
}
}
}
}
示例2: gimp_drawable_apply_operation_to_tiles
void
gimp_drawable_apply_operation_to_tiles (GimpDrawable *drawable,
GimpProgress *progress,
const gchar *undo_desc,
GeglNode *operation,
gboolean linear,
TileManager *new_tiles)
{
GeglRectangle rect;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
g_return_if_fail (undo_desc != NULL);
g_return_if_fail (GEGL_IS_NODE (operation));
g_return_if_fail (new_tiles != NULL);
rect.x = 0;
rect.y = 0;
rect.width = tile_manager_width (new_tiles);
rect.height = tile_manager_height (new_tiles);
gimp_drawable_apply_operation_private (drawable,
progress,
undo_desc,
operation,
linear,
new_tiles,
&rect);
if (progress)
gimp_progress_end (progress);
}
示例3: gimp_edit_clear
void
gimp_edit_clear (GimpImage *image,
GimpDrawable *drawable,
GimpContext *context)
{
GimpFillOptions *options;
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (GIMP_IS_CONTEXT (context));
options = gimp_fill_options_new (context->gimp);
if (gimp_drawable_has_alpha (drawable))
gimp_fill_options_set_by_fill_type (options, context,
GIMP_FILL_TRANSPARENT, NULL);
else
gimp_fill_options_set_by_fill_type (options, context,
GIMP_FILL_BACKGROUND, NULL);
gimp_edit_fill (image, drawable, options, C_("undo-type", "Clear"));
g_object_unref (options);
}
示例4: gimp_edit_clear
gboolean
gimp_edit_clear (GimpImage *image,
GimpDrawable *drawable,
GimpContext *context)
{
GimpRGB background;
GimpLayerModeEffects paint_mode;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
gimp_context_get_background (context, &background);
if (gimp_drawable_has_alpha (drawable))
paint_mode = GIMP_ERASE_MODE;
else
paint_mode = GIMP_NORMAL_MODE;
return gimp_edit_fill_full (image, drawable,
&background, NULL,
GIMP_OPACITY_OPAQUE, paint_mode,
C_("undo-type", "Clear"));
}
示例5: gimp_edit_fill
void
gimp_edit_fill (GimpImage *image,
GimpDrawable *drawable,
GimpFillOptions *options,
const gchar *undo_desc)
{
GeglBuffer *buffer;
gint x, y, width, height;
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (GIMP_IS_FILL_OPTIONS (options));
if (! gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
return; /* nothing to do, but the fill succeeded */
buffer = gimp_fill_options_create_buffer (options, drawable,
GEGL_RECTANGLE (0, 0,
width, height));
if (! undo_desc)
undo_desc = gimp_fill_options_get_undo_desc (options);
gimp_drawable_apply_buffer (drawable, buffer,
GEGL_RECTANGLE (0, 0, width, height),
TRUE, undo_desc,
gimp_context_get_opacity (GIMP_CONTEXT (options)),
gimp_context_get_paint_mode (GIMP_CONTEXT (options)),
NULL, x, y);
g_object_unref (buffer);
gimp_drawable_update (drawable, x, y, width, height);
}
示例6: gimp_paint_core_get_paint_buffer
GeglBuffer *
gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
const GimpCoords *coords,
gint *paint_buffer_x,
gint *paint_buffer_y)
{
GeglBuffer *paint_buffer;
g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), NULL);
g_return_val_if_fail (coords != NULL, NULL);
g_return_val_if_fail (paint_buffer_x != NULL, NULL);
g_return_val_if_fail (paint_buffer_y != NULL, NULL);
paint_buffer =
GIMP_PAINT_CORE_GET_CLASS (core)->get_paint_buffer (core, drawable,
paint_options,
coords,
paint_buffer_x,
paint_buffer_y);
core->paint_buffer_x = *paint_buffer_x;
core->paint_buffer_y = *paint_buffer_y;
return paint_buffer;
}
示例7: gimp_drawable_foreground_extract
void
gimp_drawable_foreground_extract (GimpDrawable *drawable,
GimpForegroundExtractMode mode,
GimpDrawable *mask,
GimpProgress *progress)
{
SioxState *state;
const gdouble sensitivity[3] = { SIOX_DEFAULT_SENSITIVITY_L,
SIOX_DEFAULT_SENSITIVITY_A,
SIOX_DEFAULT_SENSITIVITY_B };
g_return_if_fail (GIMP_IS_DRAWABLE (mask));
g_return_if_fail (mode == GIMP_FOREGROUND_EXTRACT_SIOX);
state =
gimp_drawable_foreground_extract_siox_init (drawable,
0, 0,
gimp_item_get_width (GIMP_ITEM (mask)),
gimp_item_get_height (GIMP_ITEM (mask)));
if (state)
{
gimp_drawable_foreground_extract_siox (mask, state,
SIOX_REFINEMENT_RECALCULATE,
SIOX_DEFAULT_SMOOTHNESS,
sensitivity,
FALSE,
progress);
gimp_drawable_foreground_extract_siox_done (state);
}
}
示例8: gimp_drawable_transform_get_effective_clip
GimpTransformResize
gimp_drawable_transform_get_effective_clip (GimpDrawable *drawable,
GeglBuffer *orig_buffer,
GimpTransformResize clip_result)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), clip_result);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)),
clip_result);
g_return_val_if_fail (orig_buffer == NULL || GEGL_IS_BUFFER (orig_buffer),
clip_result);
/* Always clip unfloated buffers since they must keep their size */
if (GIMP_IS_CHANNEL (drawable))
{
if (orig_buffer)
{
if (! babl_format_has_alpha (gegl_buffer_get_format (orig_buffer)))
clip_result = GIMP_TRANSFORM_RESIZE_CLIP;
}
else
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
if (gimp_channel_is_empty (gimp_image_get_mask (image)))
clip_result = GIMP_TRANSFORM_RESIZE_CLIP;
}
}
return clip_result;
}
示例9: gimp_plug_in_cleanup_remove_shadow
gboolean
gimp_plug_in_cleanup_remove_shadow (GimpPlugIn *plug_in,
GimpDrawable *drawable)
{
GimpPlugInProcFrame *proc_frame;
GimpPlugInCleanupItem *cleanup;
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
cleanup = gimp_plug_in_cleanup_item_get (proc_frame, GIMP_ITEM (drawable));
if (! cleanup)
return FALSE;
if (! cleanup->shadow_buffer)
return FALSE;
proc_frame->item_cleanups = g_list_remove (proc_frame->item_cleanups,
cleanup);
gimp_plug_in_cleanup_item_free (cleanup);
return TRUE;
}
示例10: gimp_image_undo_push_drawable
GimpUndo *
gimp_image_undo_push_drawable (GimpImage *image,
const gchar *undo_desc,
GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y)
{
GimpItem *item;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (GEGL_IS_BUFFER (buffer), NULL);
item = GIMP_ITEM (drawable);
g_return_val_if_fail (gimp_item_is_attached (item), NULL);
return gimp_image_undo_push (image, GIMP_TYPE_DRAWABLE_UNDO,
GIMP_UNDO_DRAWABLE, undo_desc,
GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE,
"item", item,
"buffer", buffer,
"x", x,
"y", y,
NULL);
}
示例11: gimp_symmetry_set_origin
/**
* gimp_symmetry_set_origin:
* @sym: the #GimpSymmetry
* @drawable: the #GimpDrawable where painting will happen
* @origin: new base coordinates.
*
* Set the symmetry to new origin coordinates and drawable.
**/
void
gimp_symmetry_set_origin (GimpSymmetry *sym,
GimpDrawable *drawable,
GimpCoords *origin)
{
g_return_if_fail (GIMP_IS_SYMMETRY (sym));
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_get_image (GIMP_ITEM (drawable)) == sym->image);
if (drawable != sym->drawable)
{
if (sym->drawable)
g_object_unref (sym->drawable);
sym->drawable = g_object_ref (drawable);
}
if (origin != sym->origin)
{
g_free (sym->origin);
sym->origin = g_memdup (origin, sizeof (GimpCoords));
}
g_list_free_full (sym->strokes, g_free);
sym->strokes = NULL;
GIMP_SYMMETRY_GET_CLASS (sym)->update_strokes (sym, drawable, origin);
}
示例12: gimp_edit_named_copy
const gchar *
gimp_edit_named_copy (GimpImage *image,
const gchar *name,
GimpDrawable *drawable,
GimpContext *context,
GError **error)
{
GimpBuffer *buffer;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
buffer = gimp_edit_extract (image, GIMP_PICKABLE (drawable),
context, FALSE, error);
if (buffer)
{
gimp_object_set_name (GIMP_OBJECT (buffer), name);
gimp_container_add (image->gimp->named_buffers, GIMP_OBJECT (buffer));
g_object_unref (buffer);
return gimp_object_get_name (buffer);
}
return NULL;
}
示例13: gimp_drawable_stroke_boundary
void
gimp_drawable_stroke_boundary (GimpDrawable *drawable,
GimpStrokeOptions *options,
const GimpBoundSeg *bound_segs,
gint n_bound_segs,
gint offset_x,
gint offset_y,
gboolean push_undo)
{
GimpScanConvert *scan_convert;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (GIMP_IS_STROKE_OPTIONS (options));
g_return_if_fail (bound_segs == NULL || n_bound_segs != 0);
g_return_if_fail (gimp_fill_options_get_style (GIMP_FILL_OPTIONS (options)) !=
GIMP_FILL_STYLE_PATTERN ||
gimp_context_get_pattern (GIMP_CONTEXT (options)) != NULL);
scan_convert = gimp_scan_convert_new_from_boundary (bound_segs, n_bound_segs,
offset_x, offset_y);
if (scan_convert)
{
gimp_drawable_stroke_scan_convert (drawable, options,
scan_convert, push_undo);
gimp_scan_convert_free (scan_convert);
}
}
示例14: gimp_edit_copy
const GimpBuffer *
gimp_edit_copy (GimpImage *image,
GimpDrawable *drawable,
GimpContext *context,
GError **error)
{
GimpBuffer *buffer;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
buffer = gimp_edit_extract (image, GIMP_PICKABLE (drawable),
context, FALSE, error);
if (buffer)
{
gimp_set_global_buffer (image->gimp, buffer);
g_object_unref (buffer);
return image->gimp->global_buffer;
}
return NULL;
}
示例15: gimp_drawable_mod_undo_constructed
static void
gimp_drawable_mod_undo_constructed (GObject *object)
{
GimpDrawableModUndo *drawable_mod_undo = GIMP_DRAWABLE_MOD_UNDO (object);
GimpItem *item;
GimpDrawable *drawable;
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_DRAWABLE (GIMP_ITEM_UNDO (object)->item));
item = GIMP_ITEM_UNDO (object)->item;
drawable = GIMP_DRAWABLE (item);
if (drawable_mod_undo->copy_buffer)
{
drawable_mod_undo->buffer =
gegl_buffer_dup (gimp_drawable_get_buffer (drawable));
}
else
{
drawable_mod_undo->buffer =
g_object_ref (gimp_drawable_get_buffer (drawable));
}
gimp_item_get_offset (item,
&drawable_mod_undo->offset_x,
&drawable_mod_undo->offset_y);
}