diff options
Diffstat (limited to 'libart_lgpl/art_pixbuf.c')
-rw-r--r-- | libart_lgpl/art_pixbuf.c | 172 |
1 files changed, 0 insertions, 172 deletions
diff --git a/libart_lgpl/art_pixbuf.c b/libart_lgpl/art_pixbuf.c index e99375392e..c624c7dd7d 100644 --- a/libart_lgpl/art_pixbuf.c +++ b/libart_lgpl/art_pixbuf.c @@ -111,175 +111,3 @@ art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstrid return pixbuf; } -/** - * art_pixbuf_new_const_rgb: Create a new RGB #ArtPixBuf with constant pixel data. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGB - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * No action is taken when the #ArtPixBuf is destroyed. Thus, this - * function is useful when the pixel data is constant or statically - * allocated. - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgb_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL); -} - -/** - * art_pixbuf_new_const_rgba: Create a new RGBA #ArtPixBuf with constant pixel data. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGBA - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * No action is taken when the #ArtPixBuf is destroyed. Thus, this - * function is suitable when the pixel data is constant or statically - * allocated. - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgba_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL); -} - -static void -art_pixel_destroy (void *func_data, void *data) -{ - art_free (data); -} - -/** - * art_pixbuf_new_rgb: Create a new RGB #ArtPixBuf. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGB - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * The @pixels buffer is freed with art_free() when the #ArtPixBuf is - * destroyed. Thus, this function is suitable when the pixel data is - * allocated with art_alloc(). - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgb_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy); -} - -/** - * art_pixbuf_new_rgba: Create a new RGBA #ArtPixBuf. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGBA - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * The @pixels buffer is freed with art_free() when the #ArtPixBuf is - * destroyed. Thus, this function is suitable when the pixel data is - * allocated with art_alloc(). - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgba_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy); -} - -/** - * art_pixbuf_free: Destroy an #ArtPixBuf. - * @pixbuf: The #ArtPixBuf to be destroyed. - * - * Destroys the #ArtPixBuf, calling the destroy notification function - * (if non-NULL) so that the memory for the pixel buffer can be - * properly reclaimed. - **/ -void -art_pixbuf_free (ArtPixBuf *pixbuf) -{ - ArtDestroyNotify destroy = pixbuf->destroy; - void *destroy_data = pixbuf->destroy_data; - art_u8 *pixels = pixbuf->pixels; - - pixbuf->pixels = NULL; - pixbuf->destroy = NULL; - pixbuf->destroy_data = NULL; - - if (destroy) - destroy (destroy_data, pixels); - - art_free (pixbuf); -} - -/** - * art_pixbuf_free_shallow: - * @pixbuf: The #ArtPixBuf to be destroyed. - * - * Destroys the #ArtPixBuf without calling the destroy notification function. - * - * This function is deprecated. Use the _dnotify variants for - * allocation instead. - **/ -void -art_pixbuf_free_shallow (ArtPixBuf *pixbuf) -{ - art_free (pixbuf); -} - -/** - * art_pixbuf_duplicate: Duplicate a pixbuf. - * @pixbuf: The #ArtPixBuf to duplicate. - * - * Duplicates a pixbuf, including duplicating the buffer. - * - * Return value: The duplicated pixbuf. - **/ -ArtPixBuf * -art_pixbuf_duplicate (const ArtPixBuf *pixbuf) -{ - ArtPixBuf *result; - int size; - - result = art_new (ArtPixBuf, 1); - - result->format = pixbuf->format; - result->n_channels = pixbuf->n_channels; - result->has_alpha = pixbuf->has_alpha; - result->bits_per_sample = pixbuf->bits_per_sample; - - size = (pixbuf->height - 1) * pixbuf->rowstride + - pixbuf->width * ((pixbuf->n_channels * pixbuf->bits_per_sample + 7) >> 3); - result->pixels = art_alloc (size); - memcpy (result->pixels, pixbuf->pixels, size); - - result->width = pixbuf->width; - result->height = pixbuf->height; - result->rowstride = pixbuf->rowstride; - result->destroy_data = NULL; - result->destroy = art_pixel_destroy; - - return result; -} |