ソースを参照

* 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

読み込み中…
キャンセル
保存