mirror of https://github.com/GNOME/gimp.git
app: remove GimpPickable::get_image_type()
This commit is contained in:
parent
5fba7c70c7
commit
5e754a9641
|
@ -261,7 +261,6 @@ gimp_drawable_pickable_iface_init (GimpPickableInterface *iface)
|
|||
iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
|
||||
iface->get_format = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_format;
|
||||
iface->get_format_with_alpha = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_format_with_alpha;
|
||||
iface->get_image_type = (GimpImageType (*) (GimpPickable *pickable)) gimp_drawable_type;
|
||||
iface->get_bytes = (gint (*) (GimpPickable *pickable)) gimp_drawable_bytes;
|
||||
iface->get_buffer = (GeglBuffer * (*) (GimpPickable *pickable)) gimp_drawable_get_buffer;
|
||||
iface->get_tiles = (TileManager * (*) (GimpPickable *pickable)) gimp_drawable_get_tiles;
|
||||
|
|
|
@ -91,7 +91,6 @@ static GimpImage * gimp_image_map_get_image (GimpPickable *pick
|
|||
static const Babl * gimp_image_map_get_format (GimpPickable *pickable);
|
||||
static const Babl * gimp_image_map_get_format_with_alpha
|
||||
(GimpPickable *pickable);
|
||||
static GimpImageType gimp_image_map_get_image_type (GimpPickable *pickable);
|
||||
static gint gimp_image_map_get_bytes (GimpPickable *pickable);
|
||||
static GeglBuffer * gimp_image_map_get_buffer (GimpPickable *pickable);
|
||||
static TileManager * gimp_image_map_get_tiles (GimpPickable *pickable);
|
||||
|
@ -143,7 +142,6 @@ gimp_image_map_pickable_iface_init (GimpPickableInterface *iface)
|
|||
iface->get_image = gimp_image_map_get_image;
|
||||
iface->get_format = gimp_image_map_get_format;
|
||||
iface->get_format_with_alpha = gimp_image_map_get_format_with_alpha;
|
||||
iface->get_image_type = gimp_image_map_get_image_type;
|
||||
iface->get_bytes = gimp_image_map_get_bytes;
|
||||
iface->get_buffer = gimp_image_map_get_buffer;
|
||||
iface->get_tiles = gimp_image_map_get_tiles;
|
||||
|
@ -258,14 +256,6 @@ gimp_image_map_get_format_with_alpha (GimpPickable *pickable)
|
|||
return gimp_pickable_get_format_with_alpha (GIMP_PICKABLE (image_map->drawable));
|
||||
}
|
||||
|
||||
static GimpImageType
|
||||
gimp_image_map_get_image_type (GimpPickable *pickable)
|
||||
{
|
||||
GimpImageMap *image_map = GIMP_IMAGE_MAP (pickable);
|
||||
|
||||
return gimp_pickable_get_image_type (GIMP_PICKABLE (image_map->drawable));
|
||||
}
|
||||
|
||||
static gint
|
||||
gimp_image_map_get_bytes (GimpPickable *pickable)
|
||||
{
|
||||
|
|
|
@ -91,21 +91,6 @@ gimp_pickable_get_image (GimpPickable *pickable)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
GimpImageType
|
||||
gimp_pickable_get_image_type (GimpPickable *pickable)
|
||||
{
|
||||
GimpPickableInterface *pickable_iface;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_PICKABLE (pickable), -1);
|
||||
|
||||
pickable_iface = GIMP_PICKABLE_GET_INTERFACE (pickable);
|
||||
|
||||
if (pickable_iface->get_image_type)
|
||||
return pickable_iface->get_image_type (pickable);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
const Babl *
|
||||
gimp_pickable_get_format (GimpPickable *pickable)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@ struct _GimpPickableInterface
|
|||
GimpImage * (* get_image) (GimpPickable *pickable);
|
||||
const Babl * (* get_format) (GimpPickable *pickable);
|
||||
const Babl * (* get_format_with_alpha) (GimpPickable *pickable);
|
||||
GimpImageType (* get_image_type) (GimpPickable *pickable);
|
||||
gint (* get_bytes) (GimpPickable *pickable);
|
||||
GeglBuffer * (* get_buffer) (GimpPickable *pickable);
|
||||
TileManager * (* get_tiles) (GimpPickable *pickable);
|
||||
|
@ -59,7 +58,6 @@ void gimp_pickable_flush (GimpPickable *pickable);
|
|||
GimpImage * gimp_pickable_get_image (GimpPickable *pickable);
|
||||
const Babl * gimp_pickable_get_format (GimpPickable *pickable);
|
||||
const Babl * gimp_pickable_get_format_with_alpha (GimpPickable *pickable);
|
||||
GimpImageType gimp_pickable_get_image_type (GimpPickable *pickable);
|
||||
gint gimp_pickable_get_bytes (GimpPickable *pickable);
|
||||
GeglBuffer * gimp_pickable_get_buffer (GimpPickable *pickable);
|
||||
TileManager * gimp_pickable_get_tiles (GimpPickable *pickable);
|
||||
|
|
|
@ -62,7 +62,6 @@ static gint64 gimp_projection_get_memsize (GimpObject *objec
|
|||
static void gimp_projection_pickable_flush (GimpPickable *pickable);
|
||||
static GimpImage * gimp_projection_get_image (GimpPickable *pickable);
|
||||
static const Babl * gimp_projection_get_format (GimpPickable *pickable);
|
||||
static GimpImageType gimp_projection_get_image_type (GimpPickable *pickable);
|
||||
static gint gimp_projection_get_bytes (GimpPickable *pickable);
|
||||
static GeglBuffer * gimp_projection_get_buffer (GimpPickable *pickable);
|
||||
static TileManager * gimp_projection_get_tiles (GimpPickable *pickable);
|
||||
|
@ -166,7 +165,6 @@ gimp_projection_pickable_iface_init (GimpPickableInterface *iface)
|
|||
iface->get_image = gimp_projection_get_image;
|
||||
iface->get_format = gimp_projection_get_format;
|
||||
iface->get_format_with_alpha = gimp_projection_get_format; /* sic */
|
||||
iface->get_image_type = gimp_projection_get_image_type;
|
||||
iface->get_bytes = gimp_projection_get_bytes;
|
||||
iface->get_buffer = gimp_projection_get_buffer;
|
||||
iface->get_tiles = gimp_projection_get_tiles;
|
||||
|
@ -318,33 +316,12 @@ gimp_projection_get_format (GimpPickable *pickable)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static GimpImageType
|
||||
gimp_projection_get_image_type (GimpPickable *pickable)
|
||||
{
|
||||
GimpProjection *proj = GIMP_PROJECTION (pickable);
|
||||
GimpImageType type;
|
||||
|
||||
type = gimp_projectable_get_image_type (proj->projectable);
|
||||
|
||||
switch (GIMP_IMAGE_TYPE_BASE_TYPE (type))
|
||||
{
|
||||
case GIMP_RGB:
|
||||
case GIMP_INDEXED:
|
||||
return GIMP_RGBA_IMAGE;
|
||||
|
||||
case GIMP_GRAY:
|
||||
return GIMP_GRAYA_IMAGE;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gint
|
||||
gimp_projection_get_bytes (GimpPickable *pickable)
|
||||
{
|
||||
return GIMP_IMAGE_TYPE_BYTES (gimp_projection_get_image_type (pickable));
|
||||
const Babl *format = gimp_projection_get_format (pickable);
|
||||
|
||||
return babl_format_get_bytes_per_pixel (format);
|
||||
}
|
||||
|
||||
static GeglBuffer *
|
||||
|
|
Loading…
Reference in New Issue