Commit 9a09d3a7 authored by Michael Natterer's avatar Michael Natterer 😴

app: drop "babl" from gimp_foo_get_babl_format[_with_alpha]()

parent 6708baa1
......@@ -556,7 +556,7 @@ gimp_edit_fill_internal (GimpImage *image,
return TRUE; /* nothing to do, but the fill succeded */
tiles_bytes = gimp_drawable_bytes (drawable);
format = gimp_drawable_get_babl_format (drawable);
format = gimp_drawable_get_format (drawable);
switch (fill_type)
{
......@@ -579,7 +579,7 @@ gimp_edit_fill_internal (GimpImage *image,
(pattern->mask->bytes == 2 || pattern->mask->bytes == 4))
{
tiles_bytes++;
format = gimp_drawable_get_babl_format_with_alpha (drawable);
format = gimp_drawable_get_format_with_alpha (drawable);
}
break;
......
......@@ -90,7 +90,7 @@ gimp_drawable_offset (GimpDrawable *drawable,
src_buffer = gimp_drawable_get_read_buffer (drawable);
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
gimp_drawable_get_babl_format (drawable),
gimp_drawable_get_format (drawable),
TRUE);
if (! wrap_around)
......
......@@ -63,7 +63,7 @@ gimp_drawable_apply_operation (GimpDrawable *drawable,
dest_buffer =
gimp_tile_manager_create_buffer (gimp_drawable_get_shadow_tiles (drawable),
gimp_drawable_get_babl_format (drawable),
gimp_drawable_get_format (drawable),
TRUE);
gimp_apply_operation (gimp_drawable_get_read_buffer (drawable),
......@@ -151,7 +151,7 @@ gimp_drawable_apply_operation_to_tiles (GimpDrawable *drawable,
g_return_if_fail (dest_tiles != NULL);
dest_buffer = gimp_tile_manager_create_buffer (dest_tiles,
gimp_drawable_get_babl_format (drawable),
gimp_drawable_get_format (drawable),
TRUE);
gimp_drawable_apply_operation_to_buffer (drawable,
......
......@@ -269,14 +269,14 @@ gimp_drawable_init (GimpDrawable *drawable)
static void
gimp_drawable_pickable_iface_init (GimpPickableInterface *iface)
{
iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
iface->get_babl_format = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_babl_format;
iface->get_babl_format_with_alpha = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_babl_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_read_buffer;
iface->get_tiles = (TileManager * (*) (GimpPickable *pickable)) gimp_drawable_get_tiles;
iface->get_pixel_at = gimp_drawable_get_pixel_at;
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_read_buffer;
iface->get_tiles = (TileManager * (*) (GimpPickable *pickable)) gimp_drawable_get_tiles;
iface->get_pixel_at = gimp_drawable_get_pixel_at;
}
static void
......@@ -578,7 +578,7 @@ gimp_drawable_resize (GimpItem *item,
gimp_drawable_bytes (drawable));
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
gimp_drawable_get_babl_format (drawable),
gimp_drawable_get_format (drawable),
TRUE);
if (copy_width != new_width ||
......@@ -594,7 +594,7 @@ gimp_drawable_resize (GimpItem *item,
gimp_drawable_type (drawable), bg);
col = gegl_color_new (NULL);
gegl_color_set_pixel (col, gimp_drawable_get_babl_format (drawable), bg);
gegl_color_set_pixel (col, gimp_drawable_get_format (drawable), bg);
gegl_buffer_set_color (dest_buffer, NULL, col);
......@@ -930,7 +930,7 @@ gimp_drawable_real_push_undo (GimpDrawable *drawable,
tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable));
dest_buffer = gimp_tile_manager_create_buffer (tiles,
gimp_drawable_get_babl_format (drawable),
gimp_drawable_get_format (drawable),
TRUE);
src_rect.x = x;
......@@ -1508,7 +1508,7 @@ gimp_drawable_create_buffer (GimpDrawable *drawable,
gboolean write)
{
TileManager *tiles = gimp_drawable_get_tiles (drawable);
const Babl *format = gimp_drawable_get_babl_format (drawable);
const Babl *format = gimp_drawable_get_format (drawable);
return gimp_tile_manager_create_buffer (tiles, format, write);
}
......@@ -1822,7 +1822,7 @@ gimp_drawable_fill_by_type (GimpDrawable *drawable,
}
const Babl *
gimp_drawable_get_babl_format (const GimpDrawable *drawable)
gimp_drawable_get_format (const GimpDrawable *drawable)
{
GimpImageType type;
......@@ -1853,7 +1853,7 @@ gimp_drawable_get_babl_format (const GimpDrawable *drawable)
}
const Babl *
gimp_drawable_get_babl_format_with_alpha (const GimpDrawable *drawable)
gimp_drawable_get_format_with_alpha (const GimpDrawable *drawable)
{
GimpImageType type;
......
......@@ -225,8 +225,8 @@ void gimp_drawable_fill_by_type (GimpDrawable *drawable,
GimpContext *context,
GimpFillType fill_type);
const Babl * gimp_drawable_get_babl_format (const GimpDrawable *drawable);
const Babl * gimp_drawable_get_babl_format_with_alpha
const Babl * gimp_drawable_get_format (const GimpDrawable *drawable);
const Babl * gimp_drawable_get_format_with_alpha
(const GimpDrawable *drawable);
gboolean gimp_drawable_has_alpha (const GimpDrawable *drawable);
GimpImageType gimp_drawable_type (const GimpDrawable *drawable);
......
......@@ -549,7 +549,7 @@ gimp_image_merge_layers (GimpImage *image,
rect.height = y2 - y1;
color = gegl_color_new (NULL);
gegl_color_set_pixel (color, gimp_drawable_get_babl_format (GIMP_DRAWABLE (merge_layer)), bg);
gegl_color_set_pixel (color, gimp_drawable_get_format (GIMP_DRAWABLE (merge_layer)), bg);
gegl_buffer_set_color (gimp_drawable_get_write_buffer (GIMP_DRAWABLE (merge_layer)),
&rect, color);
......
......@@ -101,8 +101,8 @@ static void gimp_image_map_dispose (GObject *obje
static void gimp_image_map_finalize (GObject *object);
static GimpImage * gimp_image_map_get_image (GimpPickable *pickable);
static const Babl * gimp_image_map_get_babl_format (GimpPickable *pickable);
static const Babl * gimp_image_map_get_babl_format_with_alpha
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);
......@@ -156,14 +156,14 @@ gimp_image_map_class_init (GimpImageMapClass *klass)
static void
gimp_image_map_pickable_iface_init (GimpPickableInterface *iface)
{
iface->get_image = gimp_image_map_get_image;
iface->get_babl_format = gimp_image_map_get_babl_format;
iface->get_babl_format_with_alpha = gimp_image_map_get_babl_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;
iface->get_pixel_at = gimp_image_map_get_pixel_at;
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;
iface->get_pixel_at = gimp_image_map_get_pixel_at;
}
static void
......@@ -268,19 +268,19 @@ gimp_image_map_get_image (GimpPickable *pickable)
}
static const Babl *
gimp_image_map_get_babl_format (GimpPickable *pickable)
gimp_image_map_get_format (GimpPickable *pickable)
{
GimpImageMap *image_map = GIMP_IMAGE_MAP (pickable);
return gimp_pickable_get_babl_format (GIMP_PICKABLE (image_map->drawable));
return gimp_pickable_get_format (GIMP_PICKABLE (image_map->drawable));
}
static const Babl *
gimp_image_map_get_babl_format_with_alpha (GimpPickable *pickable)
gimp_image_map_get_format_with_alpha (GimpPickable *pickable)
{
GimpImageMap *image_map = GIMP_IMAGE_MAP (pickable);
return gimp_pickable_get_babl_format_with_alpha (GIMP_PICKABLE (image_map->drawable));
return gimp_pickable_get_format_with_alpha (GIMP_PICKABLE (image_map->drawable));
}
static GimpImageType
......@@ -309,7 +309,7 @@ gimp_image_map_get_buffer (GimpPickable *pickable)
if (! image_map->undo_buffer)
image_map->undo_buffer =
gimp_tile_manager_create_buffer (image_map->undo_tiles,
gimp_drawable_get_babl_format (image_map->drawable),
gimp_drawable_get_format (image_map->drawable),
FALSE);
return image_map->undo_buffer;
......@@ -427,7 +427,7 @@ gimp_image_map_apply (GimpImageMap *image_map,
if (image_map->operation)
{
const Babl *format = gimp_drawable_get_babl_format (image_map->drawable);
const Babl *format = gimp_drawable_get_format (image_map->drawable);
GeglBuffer *input_buffer;
GeglBuffer *output_buffer;
......@@ -724,7 +724,7 @@ gimp_image_map_update_undo_tiles (GimpImageMap *image_map,
/* Copy from the image to the new tiles */
src = gimp_drawable_get_read_buffer (image_map->drawable);
dest = gimp_tile_manager_create_buffer (image_map->undo_tiles,
gimp_drawable_get_babl_format (image_map->drawable),
gimp_drawable_get_format (image_map->drawable),
TRUE);
gegl_buffer_copy (src, rect, dest, &dest_rect);
......@@ -886,7 +886,7 @@ gimp_image_map_data_written (GObject *operation,
GeglRectangle dest_rect;
src = gimp_tile_manager_create_buffer (image_map->undo_tiles,
gimp_drawable_get_babl_format (image_map->drawable),
gimp_drawable_get_format (image_map->drawable),
FALSE);
dest = gimp_drawable_get_write_buffer (image_map->drawable);
......
......@@ -1770,7 +1770,7 @@ gimp_layer_add_alpha (GimpLayer *layer)
GIMP_IMAGE_TYPE_BYTES (new_type));
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
gimp_drawable_get_babl_format_with_alpha (GIMP_DRAWABLE (layer)),
gimp_drawable_get_format_with_alpha (GIMP_DRAWABLE (layer)),
TRUE);
gegl_buffer_copy (gimp_drawable_get_read_buffer (drawable), NULL,
......
......@@ -287,7 +287,7 @@ gimp_palette_import_extract (GimpImage *image,
buffer = gimp_pickable_get_buffer (pickable);
type = gimp_pickable_get_image_type (pickable);
format = gimp_pickable_get_babl_format (pickable);
format = gimp_pickable_get_format (pickable);
iter = gegl_buffer_iterator_new (buffer, &rect, format,
GEGL_BUFFER_READ);
......@@ -304,10 +304,10 @@ gimp_palette_import_extract (GimpImage *image,
rect.x = x + pickable_off_x;
rect.y = y + pickable_off_y;
format = gimp_drawable_get_babl_format (mask);
format = gimp_drawable_get_format (mask);
gegl_buffer_iterator_add (iter, buffer, &rect,
gimp_drawable_get_babl_format (mask),
gimp_drawable_get_format (mask),
GEGL_BUFFER_READ);
mask_roi = &iter->roi[1];
mask_bpp = babl_format_get_bytes_per_pixel (format);
......
......@@ -107,7 +107,7 @@ gimp_pickable_get_image_type (GimpPickable *pickable)
}
const Babl *
gimp_pickable_get_babl_format (GimpPickable *pickable)
gimp_pickable_get_format (GimpPickable *pickable)
{
GimpPickableInterface *pickable_iface;
......@@ -115,14 +115,14 @@ gimp_pickable_get_babl_format (GimpPickable *pickable)
pickable_iface = GIMP_PICKABLE_GET_INTERFACE (pickable);
if (pickable_iface->get_babl_format)
return pickable_iface->get_babl_format (pickable);
if (pickable_iface->get_format)
return pickable_iface->get_format (pickable);
return NULL;
}
const Babl *
gimp_pickable_get_babl_format_with_alpha (GimpPickable *pickable)
gimp_pickable_get_format_with_alpha (GimpPickable *pickable)
{
GimpPickableInterface *pickable_iface;
......@@ -130,8 +130,8 @@ gimp_pickable_get_babl_format_with_alpha (GimpPickable *pickable)
pickable_iface = GIMP_PICKABLE_GET_INTERFACE (pickable);
if (pickable_iface->get_babl_format_with_alpha)
return pickable_iface->get_babl_format_with_alpha (pickable);
if (pickable_iface->get_format_with_alpha)
return pickable_iface->get_format_with_alpha (pickable);
return NULL;
}
......
......@@ -35,54 +35,53 @@ struct _GimpPickableInterface
GTypeInterface base_iface;
/* virtual functions */
void (* flush) (GimpPickable *pickable);
GimpImage * (* get_image) (GimpPickable *pickable);
const Babl * (* get_babl_format) (GimpPickable *pickable);
const Babl * (* get_babl_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);
gboolean (* get_pixel_at) (GimpPickable *pickable,
gint x,
gint y,
guchar *pixel);
gint (* get_opacity_at) (GimpPickable *pickable,
gint x,
gint y);
void (* flush) (GimpPickable *pickable);
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);
gboolean (* get_pixel_at) (GimpPickable *pickable,
gint x,
gint y,
guchar *pixel);
gint (* get_opacity_at) (GimpPickable *pickable,
gint x,
gint y);
};
GType gimp_pickable_interface_get_type (void) G_GNUC_CONST;
GType gimp_pickable_interface_get_type (void) G_GNUC_CONST;
void gimp_pickable_flush (GimpPickable *pickable);
GimpImage * gimp_pickable_get_image (GimpPickable *pickable);
const Babl * gimp_pickable_get_babl_format (GimpPickable *pickable);
const Babl * gimp_pickable_get_babl_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);
gboolean gimp_pickable_get_pixel_at (GimpPickable *pickable,
gint x,
gint y,
guchar *pixel);
gboolean gimp_pickable_get_color_at (GimpPickable *pickable,
gint x,
gint y,
GimpRGB *color);
gint gimp_pickable_get_opacity_at (GimpPickable *pickable,
gint x,
gint y);
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);
gboolean gimp_pickable_get_pixel_at (GimpPickable *pickable,
gint x,
gint y,
guchar *pixel);
gboolean gimp_pickable_get_color_at (GimpPickable *pickable,
gint x,
gint y,
GimpRGB *color);
gint gimp_pickable_get_opacity_at (GimpPickable *pickable,
gint x,
gint y);
gboolean gimp_pickable_pick_color (GimpPickable *pickable,
gint x,
gint y,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color,
gint *color_index);
gboolean gimp_pickable_pick_color (GimpPickable *pickable,
gint x,
gint y,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color,
gint *color_index);
#endif /* __GIMP_PICKABLE_H__ */
......@@ -61,7 +61,7 @@ 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_babl_format (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);
......@@ -162,16 +162,16 @@ gimp_projection_init (GimpProjection *proj)
static void
gimp_projection_pickable_iface_init (GimpPickableInterface *iface)
{
iface->flush = gimp_projection_pickable_flush;
iface->get_image = gimp_projection_get_image;
iface->get_babl_format = gimp_projection_get_babl_format;
iface->get_babl_format_with_alpha = gimp_projection_get_babl_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;
iface->get_pixel_at = gimp_projection_get_pixel_at;
iface->get_opacity_at = gimp_projection_get_opacity_at;
iface->flush = gimp_projection_pickable_flush;
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;
iface->get_pixel_at = gimp_projection_get_pixel_at;
iface->get_opacity_at = gimp_projection_get_opacity_at;
}
static void
......@@ -296,7 +296,7 @@ gimp_projection_get_image (GimpPickable *pickable)
}
static const Babl *
gimp_projection_get_babl_format (GimpPickable *pickable)
gimp_projection_get_format (GimpPickable *pickable)
{
GimpProjection *proj = GIMP_PROJECTION (pickable);
GimpImageType type;
......
......@@ -1628,7 +1628,7 @@ gimp_brush_core_paint_line_pixmap_mask (GimpImage *dest,
gint i;
fish = babl_fish (gimp_bpp_to_babl_format_with_alpha (pixmap_mask->bytes, TRUE),
gimp_drawable_get_babl_format_with_alpha (drawable));
gimp_drawable_get_format_with_alpha (drawable));
/* put the source pixmap's pixels, plus the mask's alpha, into
* one line, so we can use one single call to babl_process() to
......@@ -1656,7 +1656,7 @@ gimp_brush_core_paint_line_pixmap_mask (GimpImage *dest,
gint i;
fish = babl_fish (gimp_bpp_to_babl_format (pixmap_mask->bytes, TRUE),
gimp_drawable_get_babl_format_with_alpha (drawable));
gimp_drawable_get_format_with_alpha (drawable));
/* put the source pixmap's pixels, into one line, so we can use
* one single call to babl_process() to convert the entire line
......
......@@ -174,8 +174,8 @@ gimp_clone_motion (GimpSourceCore *source_core,
PixelRegion destPR;
gpointer pr;
fish = babl_fish (gimp_pickable_get_babl_format_with_alpha (src_pickable),
gimp_drawable_get_babl_format_with_alpha (drawable));
fish = babl_fish (gimp_pickable_get_format_with_alpha (src_pickable),
gimp_drawable_get_format_with_alpha (drawable));
pixel_region_init_temp_buf (&destPR, paint_area,
paint_area_offset_x, paint_area_offset_y,
......@@ -208,7 +208,7 @@ gimp_clone_motion (GimpSourceCore *source_core,
gpointer pr;
fish = babl_fish (gimp_bpp_to_babl_format (pattern->mask->bytes, TRUE),
gimp_drawable_get_babl_format_with_alpha (drawable));
gimp_drawable_get_format_with_alpha (drawable));
pixel_region_init_temp_buf (&destPR, paint_area,
0, 0,
......
......@@ -685,7 +685,7 @@ gimp_text_layer_render_layout (GimpTextLayer *layer,
rowstride = cairo_image_surface_get_stride (surface);
buffer = gimp_drawable_get_write_buffer (drawable);
format = gimp_drawable_get_babl_format (drawable);
format = gimp_drawable_get_format (drawable);
fish = babl_fish (babl_format ("RGBA u8"), format);
bytes = babl_format_get_bytes_per_pixel (format);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment