From: Charlie Brej Date: Sat, 21 Nov 2009 14:10:23 +0000 (+0000) Subject: [image] Allow converting an image to a pixel buffer X-Git-Tag: 0.8.0~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1056a62695ebd69456cf8a6c657b303fb3444bae;p=thirdparty%2Fplymouth.git [image] Allow converting an image to a pixel buffer A pixel buffer is a much more useful object to manipulate. The image should only be used when loading from files and never manipulating. --- diff --git a/src/libplybootsplash/ply-image.c b/src/libplybootsplash/ply-image.c index c73b7feb..42f17197 100644 --- a/src/libplybootsplash/ply-image.c +++ b/src/libplybootsplash/ply-image.c @@ -360,4 +360,16 @@ ply_image_rotate (ply_image_t *image, return new_image; } +ply_pixel_buffer_t * +ply_image_convert_to_pixel_buffer (ply_image_t *image) +{ + ply_pixel_buffer_t *buffer; + + buffer = image->buffer; + image->buffer = NULL; + ply_image_free (image); + + return buffer; +} + /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ diff --git a/src/libplybootsplash/ply-image.h b/src/libplybootsplash/ply-image.h index 3a9a4980..a5fa33b7 100644 --- a/src/libplybootsplash/ply-image.h +++ b/src/libplybootsplash/ply-image.h @@ -22,6 +22,8 @@ #ifndef PLY_IMAGE_H #define PLY_IMAGE_H +#include "ply-pixel-buffer.h" + #include #include #include @@ -37,6 +39,7 @@ long ply_image_get_width (ply_image_t *image); long ply_image_get_height (ply_image_t *image); ply_image_t *ply_image_resize (ply_image_t *image, long width, long height); ply_image_t *ply_image_rotate (ply_image_t *oldimage, long center_x, long center_y, double theta_offset); +ply_pixel_buffer_t *ply_image_convert_to_pixel_buffer (ply_image_t *image); #endif