|
|
@@ -20,9 +20,11 @@ |
|
|
|
#import "coreimage.h" |
|
|
|
|
|
|
|
#ifdef USE_COCOA |
|
|
|
|
|
|
|
#import <CIImage.h> |
|
|
|
|
|
|
|
|
|
|
|
static int pipi_free_coreimage(pipi_image_t *img); |
|
|
|
|
|
|
|
pipi_image_t *pipi_load_coreimage(const char *name) |
|
|
|
{ |
|
|
|
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; |
|
|
@@ -48,11 +50,14 @@ pipi_image_t *pipi_load_coreimage(const char *name) |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].bytes = ([myImage bitsPerPixel]/8) * img->w * img->h; |
|
|
|
img->last_modified = PIPI_PIXELS_RGBA_C; |
|
|
|
|
|
|
|
img->codec_priv = (void*)[myImage bitmapFormat]; |
|
|
|
|
|
|
|
img->codec_priv = (struct pipi_codec_coreimage *) malloc(sizeof(struct pipi_codec_coreimage *)); |
|
|
|
struct pipi_codec_coreimage *infos = (struct pipi_codec_coreimage *) img->codec_priv; |
|
|
|
infos->format = [myImage bitmapFormat]; |
|
|
|
|
|
|
|
pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); |
|
|
|
|
|
|
|
|
|
|
|
img->codec_free = pipi_free_coreimage; |
|
|
|
|
|
|
|
[autoreleasepool release]; |
|
|
|
return img; |
|
|
|
} |
|
|
@@ -87,5 +92,13 @@ int pipi_save_coreimage(pipi_image_t *img, const char *name) |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* XXX: The following functions are local. |
|
|
|
*/ |
|
|
|
|
|
|
|
static int pipi_free_coreimage(pipi_image_t *img) |
|
|
|
{ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
#endif |