本文整理匯總了C++中GIMP_IS_ITEM函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIMP_IS_ITEM函數的具體用法?C++ GIMP_IS_ITEM怎麽用?C++ GIMP_IS_ITEM使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GIMP_IS_ITEM函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: gimp_pdb_item_is_in_same_tree
gboolean
gimp_pdb_item_is_in_same_tree (GimpItem *item,
GimpItem *item2,
GimpImage *image,
GError **error)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (GIMP_IS_ITEM (item2), FALSE);
g_return_val_if_fail (image == NULL || GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (! gimp_pdb_item_is_in_tree (item, image, FALSE, error) ||
! gimp_pdb_item_is_in_tree (item2, image, FALSE, error))
return FALSE;
if (gimp_item_get_tree (item) != gimp_item_get_tree (item2))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Items '%s' (%d) and '%s' (%d) cannot be used "
"because they are not part of the same item tree"),
gimp_object_get_name (item),
gimp_item_get_ID (item),
gimp_object_get_name (item2),
gimp_item_get_ID (item2));
return FALSE;
}
return TRUE;
}
示例2: gimp_item_get_ID
gint
gimp_item_get_ID (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
return item->ID;
}
示例3: gimp_item_get_tattoo
GimpTattoo
gimp_item_get_tattoo (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), 0);
return item->tattoo;
}
示例4: gimp_item_is_removed
/**
* gimp_item_is_removed:
* @item: the #GimpItem to check.
*
* Returns: %TRUE if the 'removed' flag is set for @item, %FALSE otherwise.
*/
gboolean
gimp_item_is_removed (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return item->removed;
}
示例5: gimp_pdb_item_is_modifyable
gboolean
gimp_pdb_item_is_modifyable (GimpItem *item,
GimpPDBItemModify modify,
GError **error)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if ((modify & GIMP_PDB_ITEM_CONTENT) && gimp_item_is_content_locked (item))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be modified because its "
"contents are locked"),
gimp_object_get_name (item),
gimp_item_get_ID (item));
return FALSE;
}
if ((modify & GIMP_PDB_ITEM_POSITION) && gimp_item_is_position_locked (item))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be modified because its "
"position and size are locked"),
gimp_object_get_name (item),
gimp_item_get_ID (item));
return FALSE;
}
return TRUE;
}
示例6: gimp_item_width
/**
* gimp_item_width:
* @item: The #GimpItem to check.
*
* Returns: The width of the item.
*/
gint
gimp_item_width (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
return item->width;
}
示例7: gimp_item_linked_transform
void
gimp_item_linked_transform (GimpItem *item,
GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interpolation_type,
GimpTransformResize clip_result,
GimpProgress *progress)
{
GList *list;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (gimp_item_get_linked (item) == TRUE);
g_return_if_fail (gimp_item_is_attached (item));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
list = gimp_image_item_list_get_list (gimp_item_get_image (item), item,
GIMP_ITEM_TYPE_ALL,
GIMP_ITEM_SET_LINKED);
list = gimp_image_item_list_filter (item, list, TRUE, FALSE);
gimp_image_item_list_transform (gimp_item_get_image (item), list, context,
matrix, direction,
interpolation_type,
clip_result, progress);
g_list_free (list);
}
示例8: gimp_item_is_attached
/**
* gimp_item_is_attached:
* @item: The #GimpItem to check.
*
* Returns: %TRUE if the item is attached to an image, %FALSE otherwise.
*/
gboolean
gimp_item_is_attached (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return GIMP_ITEM_GET_CLASS (item)->is_attached (item);
}
示例9: gimp_item_transform
void
gimp_item_transform (GimpItem *item,
GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interpolation,
gint recursion_level,
GimpTransformResize clip_result,
GimpProgress *progress)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (matrix != NULL);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->transform_desc);
item_class->transform (item, context, matrix, direction, interpolation,
recursion_level, clip_result, progress);
gimp_image_undo_group_end (image);
}
示例10: gimp_item_height
/**
* gimp_item_height:
* @item: The #GimpItem to check.
*
* Returns: The height of the item.
*/
gint
gimp_item_height (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
return item->height;
}
示例11: gimp_item_resize
void
gimp_item_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_CONTEXT (context));
if (new_width < 1 || new_height < 1)
return;
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
if (gimp_item_is_attached (item))
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
item_class->resize_desc);
item_class->resize (item, context, new_width, new_height, offset_x, offset_y);
if (gimp_item_is_attached (item))
gimp_image_undo_group_end (image);
}
示例12: gimp_item_rotate
void
gimp_item_rotate (GimpItem *item,
GimpContext *context,
GimpRotationType rotate_type,
gdouble center_x,
gdouble center_y,
gboolean clip_result)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
g_return_if_fail (GIMP_IS_CONTEXT (context));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->rotate_desc);
item_class->rotate (item, context, rotate_type, center_x, center_y,
clip_result);
gimp_image_undo_group_end (image);
}
示例13: gimp_item_scale
void
gimp_item_scale (GimpItem *item,
gint new_width,
gint new_height,
gint new_offset_x,
gint new_offset_y,
GimpInterpolationType interpolation,
GimpProgress *progress)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (new_width < 1 || new_height < 1)
return;
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
if (gimp_item_is_attached (item))
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_SCALE,
item_class->scale_desc);
item_class->scale (item, new_width, new_height, new_offset_x, new_offset_y,
interpolation, progress);
if (gimp_item_is_attached (item))
gimp_image_undo_group_end (image);
}
示例14: gimp_item_scale_by_factors
/**
* gimp_item_scale_by_factors:
* @item: Item to be transformed by explicit width and height factors.
* @w_factor: scale factor to apply to width and horizontal offset
* @h_factor: scale factor to apply to height and vertical offset
* @interpolation:
* @progress:
*
* Scales item dimensions and offsets by uniform width and
* height factors.
*
* Use gimp_item_scale_by_factors() in circumstances when the same
* width and height scaling factors are to be uniformly applied to a
* set of items. In this context, the item's dimensions and offsets
* from the sides of the containing image all change by these
* predetermined factors. By fiat, the fixed point of the transform is
* the upper left hand corner of the image. Returns #FALSE if a
* requested scale factor is zero or if a scaling zero's out a item
* dimension; returns #TRUE otherwise.
*
* Use gimp_item_scale() in circumstances where new item width
* and height dimensions are predetermined instead.
*
* Side effects: Undo set created for item. Old item imagery
* scaled & painted to new item tiles.
*
* Returns: #TRUE, if the scaled item has positive dimensions
* #FALSE if the scaled item has at least one zero dimension
**/
gboolean
gimp_item_scale_by_factors (GimpItem *item,
gdouble w_factor,
gdouble h_factor,
GimpInterpolationType interpolation,
GimpProgress *progress)
{
gint new_width, new_height;
gint new_offset_x, new_offset_y;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
if (w_factor == 0.0 || h_factor == 0.0)
{
g_warning ("%s: requested width or height scale equals zero", G_STRFUNC);
return FALSE;
}
new_offset_x = ROUND (w_factor * (gdouble) item->offset_x);
new_offset_y = ROUND (h_factor * (gdouble) item->offset_y);
new_width = ROUND (w_factor * (gdouble) gimp_item_width (item));
new_height = ROUND (h_factor * (gdouble) gimp_item_height (item));
if (new_width != 0 && new_height != 0)
{
gimp_item_scale (item,
new_width, new_height,
new_offset_x, new_offset_y,
interpolation, progress);
return TRUE;
}
return FALSE;
}
示例15: gimp_item_parasite_detach
void
gimp_item_parasite_detach (GimpItem *item,
const gchar *name)
{
const GimpParasite *parasite;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (name != NULL);
parasite = gimp_parasite_list_find (item->parasites, name);
if (! parasite)
return;
if (gimp_parasite_is_undoable (parasite))
{
gimp_image_undo_push_item_parasite_remove (item->image,
_("Remove Parasite from Item"),
item,
gimp_parasite_name (parasite));
}
else if (gimp_parasite_is_persistent (parasite))
{
gimp_image_undo_push_cantundo (item->image,
_("Remove Parasite from Item"));
}
gimp_parasite_list_remove (item->parasites, name);
}