Changeset 2605 for libpipi/trunk/pipi/codec/imlib.c
- Timestamp:
- Jul 29, 2008, 1:01:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpipi/trunk/pipi/codec/imlib.c
r2261 r2605 38 38 39 39 img = (pipi_image_t *)malloc(sizeof(pipi_image_t)); 40 memset(img, 0, sizeof(pipi_image_t)); 41 40 42 imlib_context_set_image(priv); 41 img->width = imlib_image_get_width(); 42 img->height = imlib_image_get_height(); 43 img->pitch = 4 * imlib_image_get_width(); 44 img->channels = 4; 45 img->pixels = (char *)imlib_image_get_data(); 46 img->priv = (void *)priv; 43 img->w = imlib_image_get_width(); 44 img->h = imlib_image_get_height(); 45 46 img->p[PIPI_PIXELS_RGBA32].pixels = imlib_image_get_data(); 47 img->p[PIPI_PIXELS_RGBA32].w = imlib_image_get_width(); 48 img->p[PIPI_PIXELS_RGBA32].h = imlib_image_get_height(); 49 img->p[PIPI_PIXELS_RGBA32].pitch = 4 * imlib_image_get_width(); 50 img->last_modified = PIPI_PIXELS_RGBA32; 51 52 img->codec_priv = (void *)priv; 53 img->codec_format = PIPI_PIXELS_RGBA32; 47 54 48 55 return img; … … 58 65 59 66 img = (pipi_image_t *)malloc(sizeof(pipi_image_t)); 67 memset(img, 0, sizeof(pipi_image_t)); 68 60 69 imlib_context_set_image(priv); 61 img->width = imlib_image_get_width(); 62 img->height = imlib_image_get_height(); 63 img->pitch = 4 * imlib_image_get_width(); 64 img->channels = 4; 65 img->pixels = (char *)imlib_image_get_data(); 66 img->priv = (void *)priv; 70 img->w = imlib_image_get_width(); 71 img->h = imlib_image_get_height(); 72 73 img->p[PIPI_PIXELS_RGBA32].pixels = imlib_image_get_data(); 74 img->p[PIPI_PIXELS_RGBA32].w = imlib_image_get_width(); 75 img->p[PIPI_PIXELS_RGBA32].h = imlib_image_get_height(); 76 img->p[PIPI_PIXELS_RGBA32].pitch = 4 * imlib_image_get_width(); 77 img->last_modified = PIPI_PIXELS_RGBA32; 78 79 img->codec_priv = (void *)priv; 80 img->codec_format = PIPI_PIXELS_RGBA32; 67 81 68 82 return img; … … 71 85 void pipi_free_imlib2(pipi_image_t *img) 72 86 { 73 imlib_context_set_image(img-> priv);87 imlib_context_set_image(img->codec_priv); 74 88 imlib_free_image(); 75 89 … … 79 93 void pipi_save_imlib2(pipi_image_t *img, const char *name) 80 94 { 81 imlib_context_set_image(img->priv); 95 pipi_getpixels(img, img->codec_format); 96 imlib_context_set_image(img->codec_priv); 82 97 imlib_save_image(name); 83 98 }
Note: See TracChangeset
for help on using the changeset viewer.