|
|
@@ -31,7 +31,11 @@ pipi_image_t *pipi_load_coreimage(const char *name) |
|
|
|
NSString *n = [NSString stringWithCString: name]; |
|
|
|
CIImage *source; |
|
|
|
NSURL *url = [NSURL fileURLWithPath:n]; |
|
|
|
|
|
|
|
source = [CIImage imageWithContentsOfURL:url]; |
|
|
|
|
|
|
|
if(source == NULL) return NULL; |
|
|
|
|
|
|
|
CGRect extent = [source extent]; |
|
|
|
size_t w = (size_t)extent.size.width; |
|
|
|
size_t h = (size_t)extent.size.height; |
|
|
@@ -43,12 +47,12 @@ pipi_image_t *pipi_load_coreimage(const char *name) |
|
|
|
pipi_image_t *img; |
|
|
|
img = pipi_new(w, h); |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].pixels = [myImage bitmapData]; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].w = w; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].h = h; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].pitch = ([myImage bytesPerRow]/8) * img->w; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].bpp = [myImage bitsPerPixel]; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].bytes = ([myImage bitsPerPixel]/8) * img->w * img->h; |
|
|
|
img->last_modified = PIPI_PIXELS_RGBA_C; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].w = w; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].h = h; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].pitch = ([myImage bytesPerRow]/8) * img->w; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].bpp = [myImage bitsPerPixel]; |
|
|
|
img->p[PIPI_PIXELS_RGBA_C].bytes = ([myImage bitsPerPixel]/8) * img->w * img->h; |
|
|
|
img->last_modified = PIPI_PIXELS_RGBA_C; |
|
|
|
|
|
|
|
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; |
|
|
|