buffer: Babl's have been constified

parent ff9d9de5
......@@ -52,7 +52,7 @@ gegl_buffer_pixel_set (GeglBuffer *buffer,
gint tile_height = buffer->tile_storage->tile_width;
gint px_size = gegl_buffer_px_size (buffer);
gint bpx_size = babl_format_get_bytes_per_pixel (format);
Babl *fish = NULL;
const Babl *fish = NULL;
gint abyss_x_total = buffer->abyss.x + buffer->abyss.width;
gint abyss_y_total = buffer->abyss.y + buffer->abyss.height;
......@@ -133,11 +133,11 @@ gegl_buffer_set_pixel (GeglBuffer *buffer,
const Babl *format,
gpointer data)
{
guchar *buf = data;
gint tile_width = buffer->tile_storage->tile_width;
gint tile_height = buffer->tile_storage->tile_height;
gint bpx_size = babl_format_get_bytes_per_pixel (format);
Babl *fish = NULL;
guchar *buf = data;
gint tile_width = buffer->tile_storage->tile_width;
gint tile_height = buffer->tile_storage->tile_height;
gint bpx_size = babl_format_get_bytes_per_pixel (format);
const Babl *fish = NULL;
gint buffer_shift_x = buffer->shift_x;
gint buffer_shift_y = buffer->shift_y;
......@@ -210,11 +210,11 @@ gegl_buffer_get_pixel (GeglBuffer *buffer,
const Babl *format,
gpointer data)
{
guchar *buf = data;
gint tile_width = buffer->tile_storage->tile_width;
gint tile_height = buffer->tile_storage->tile_height;
gint bpx_size = babl_format_get_bytes_per_pixel (format);
Babl *fish = NULL;
guchar *buf = data;
gint tile_width = buffer->tile_storage->tile_width;
gint tile_height = buffer->tile_storage->tile_height;
gint bpx_size = babl_format_get_bytes_per_pixel (format);
const Babl *fish = NULL;
gint buffer_shift_x = buffer->shift_x;
gint buffer_shift_y = buffer->shift_y;
......@@ -325,7 +325,6 @@ gegl_buffer_iterate (GeglBuffer *buffer,
gint tile_stride = px_size * tile_width;
gint buf_stride;
gint bufy = 0;
Babl *fish;
gint buffer_shift_x = buffer->shift_x;
gint buffer_shift_y = buffer->shift_y;
......@@ -340,6 +339,7 @@ gegl_buffer_iterate (GeglBuffer *buffer,
gint abyss_x_total = buffer_abyss_x + buffer->abyss.width;
gint abyss_y_total = buffer_abyss_y + buffer->abyss.height;
gint factor = 1<<level;
const Babl *fish;
/* roi specified, override buffers extent */
if (roi)
......@@ -1130,7 +1130,7 @@ gegl_buffer_copy (GeglBuffer *src,
GeglBuffer *dst,
const GeglRectangle *dst_rect)
{
Babl *fish;
const Babl *fish;
g_return_if_fail (GEGL_IS_BUFFER (src));
g_return_if_fail (GEGL_IS_BUFFER (dst));
......
......@@ -55,7 +55,7 @@ typedef struct
gchar *path;
int i;
gint tile_size;
Babl *format;
const Babl *format;
goffset offset;
goffset next_block;
gboolean got_header;
......
......@@ -32,17 +32,17 @@ typedef struct _GeglTileClass GeglTileClass;
struct _GeglTileBackendPrivate
{
gint tile_width;
gint tile_height;
Babl *format; /* defaults to the babl format "R'G'B'A u8" */
gint px_size; /* size of a single pixel in bytes */
gint tile_size; /* size of an entire tile in bytes */
gint tile_width;
gint tile_height;
const Babl *format; /* defaults to the babl format "R'G'B'A u8" */
gint px_size; /* size of a single pixel in bytes */
gint tile_size; /* size of an entire tile in bytes */
GeglRectangle extent;
gpointer header;
gpointer storage;
gboolean shared;
gpointer header;
gpointer storage;
gboolean shared;
};
......
......@@ -1031,7 +1031,7 @@ gegl_buffer_new_for_backend (const GeglRectangle *extent,
void *backend)
{
GeglRectangle rect={0,0,0,0};
Babl *format;
const Babl *format;
/* if no extent is passed in inherit from backend */
if (extent==NULL)
......
......@@ -404,7 +404,7 @@ GeglSamplerType gegl_sampler_type_from_string (const gchar *string);
* it.
*/
GeglSampler * gegl_buffer_sampler_new (GeglBuffer *buffer,
Babl *format,
const Babl *format,
GeglSamplerType sampler_type);
/**
......
......@@ -478,7 +478,7 @@ get_property (GObject *object,
break;
case PROP_FORMAT:
g_value_set_pointer (value, self->format);
g_value_set_pointer (value, (void*)self->format);
break;
default:
......@@ -568,7 +568,7 @@ gegl_sampler_gtype_from_enum (GeglSamplerType sampler_type)
GeglSampler *
gegl_buffer_sampler_new (GeglBuffer *buffer,
Babl *format,
const Babl *format,
GeglSamplerType sampler_type)
{
GeglSampler *sampler;
......
......@@ -50,9 +50,9 @@ struct _GeglSampler
/*< private >*/
GeglBuffer *buffer;
Babl *format;
Babl *interpolate_format;
Babl *fish;
const Babl *format;
const Babl *interpolate_format;
const Babl *fish;
GeglRectangle context_rect[GEGL_SAMPLER_MIPMAP_LEVELS];
gpointer sampler_buffer[GEGL_SAMPLER_MIPMAP_LEVELS];
GeglRectangle sampler_rectangle[GEGL_SAMPLER_MIPMAP_LEVELS];
......
......@@ -66,7 +66,7 @@ get_property (GObject *gobject,
break;
case PROP_FORMAT:
g_value_set_pointer (value, backend->priv->format);
g_value_set_pointer (value, (void*)backend->priv->format);
break;
default:
......@@ -178,7 +178,7 @@ gint gegl_tile_backend_get_tile_size (GeglTileBackend *tile_backend)
}
Babl *gegl_tile_backend_get_format (GeglTileBackend *tile_backend)
const Babl *gegl_tile_backend_get_format (GeglTileBackend *tile_backend)
{
return tile_backend->priv->format;
}
......
......@@ -51,8 +51,8 @@ struct _GeglTileBackendClass
gpointer padding4;
};
gint gegl_tile_backend_get_tile_size (GeglTileBackend *tile_backend);
Babl *gegl_tile_backend_get_format (GeglTileBackend *tile_backend);
gint gegl_tile_backend_get_tile_size (GeglTileBackend *tile_backend);
const Babl *gegl_tile_backend_get_format (GeglTileBackend *tile_backend);
/* gets a pointer to the GeglTileStorage that uses the backend */
GeglTileSource *gegl_tile_backend_peek_storage (GeglTileBackend *backend);
......
......@@ -40,12 +40,12 @@ void gegl_tile_handler_cache_insert (GeglTileHandlerCache *cache,
gint x,
gint y,
gint z);
static inline void set_blank (GeglTile *dst_tile,
gint width,
gint height,
Babl *format,
gint i,
gint j)
static inline void set_blank (GeglTile *dst_tile,
gint width,
gint height,
const Babl *format,
gint i,
gint j)
{
guchar *dst_data = gegl_tile_get_data (dst_tile);
gint bpp = babl_format_get_bytes_per_pixel (format);
......@@ -64,13 +64,13 @@ static inline void set_blank (GeglTile *dst_tile,
/* fixme: make the api of this, as well as blank be the
* same as the downscale functions */
static inline void set_half_nearest (GeglTile *dst_tile,
GeglTile *src_tile,
gint width,
gint height,
Babl *format,
gint i,
gint j)
static inline void set_half_nearest (GeglTile *dst_tile,
GeglTile *src_tile,
gint width,
gint height,
const Babl *format,
gint i,
gint j)
{
guchar *dst_data = gegl_tile_get_data (dst_tile);
guchar *src_data = gegl_tile_get_data (src_tile);
......@@ -165,11 +165,11 @@ downscale_u8 (gint components,
}
}
static inline void set_half (GeglTile * dst_tile,
GeglTile * src_tile,
gint width,
gint height,
Babl * format,
static inline void set_half (GeglTile * dst_tile,
GeglTile * src_tile,
gint width,
gint height,
const Babl * format,
gint i,
gint j)
{
......@@ -204,7 +204,7 @@ get_tile (GeglTileSource *gegl_tile_source,
GeglTileSource *source = ((GeglTileHandler*)(gegl_tile_source))->source;
GeglTileHandlerZoom *zoom = (GeglTileHandlerZoom*)(gegl_tile_source);
GeglTile *tile = NULL;
Babl *format = gegl_tile_backend_get_format (zoom->backend);
const Babl *format = gegl_tile_backend_get_format (zoom->backend);
gint tile_width;
gint tile_height;
gint tile_size;
......
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