소스 검색

* Added free callback to CoreImage codec

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3019 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
jylam 16 년 전
부모
커밋
260a030eba
2개의 변경된 파일23개의 추가작업 그리고 4개의 파일을 삭제
  1. +6
    -0
      pipi/codec/coreimage.h
  2. +17
    -4
      pipi/codec/coreimage.m

+ 6
- 0
pipi/codec/coreimage.h 파일 보기

@@ -29,4 +29,10 @@
#include "pipi.h"
#include "pipi_internals.h"

struct pipi_codec_coreimage
{
NSBitmapFormat format;
};


#endif

+ 17
- 4
pipi/codec/coreimage.m 파일 보기

@@ -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

불러오는 중...
취소
저장