Changeset 3342 for libpipi/trunk/pipi/codec/coreimage.m
- Timestamp:
- Jan 13, 2009, 12:51:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpipi/trunk/pipi/codec/coreimage.m
r3340 r3342 48 48 img = pipi_new(w, h); 49 49 50 img->p[PIPI_PIXELS_RGBA_ C].w = w;51 img->p[PIPI_PIXELS_RGBA_ C].h = h;52 img->p[PIPI_PIXELS_RGBA_ C].pitch = ([myImage bytesPerRow]/8) * img->w;53 img->p[PIPI_PIXELS_RGBA_ C].bpp = [myImage bitsPerPixel];54 img->p[PIPI_PIXELS_RGBA_ C].bytes = ([myImage bitsPerPixel]/8) * img->w * img->h;55 img->last_modified = PIPI_PIXELS_RGBA_ C;50 img->p[PIPI_PIXELS_RGBA_U8].w = w; 51 img->p[PIPI_PIXELS_RGBA_U8].h = h; 52 img->p[PIPI_PIXELS_RGBA_U8].pitch = ([myImage bytesPerRow]/8) * img->w; 53 img->p[PIPI_PIXELS_RGBA_U8].bpp = [myImage bitsPerPixel]; 54 img->p[PIPI_PIXELS_RGBA_U8].bytes = ([myImage bitsPerPixel]/8) * img->w * img->h; 55 img->last_modified = PIPI_PIXELS_RGBA_U8; 56 56 57 57 … … 60 60 */ 61 61 62 int pitch = (img->p[PIPI_PIXELS_RGBA_ C].bpp/8);62 int pitch = (img->p[PIPI_PIXELS_RGBA_U8].bpp/8); 63 63 unsigned char *tmp = (unsigned char*)malloc(h*w*pitch); 64 64 unsigned char *orig = (unsigned char*)[myImage bitmapData]; … … 88 88 o+=a; 89 89 } 90 img->p[PIPI_PIXELS_RGBA_ C].pixels = tmp;91 img->p[PIPI_PIXELS_RGBA_ C].pitch = w*([myImage bitsPerPixel]/8);90 img->p[PIPI_PIXELS_RGBA_U8].pixels = tmp; 91 img->p[PIPI_PIXELS_RGBA_U8].pitch = w*([myImage bitsPerPixel]/8); 92 92 93 93 … … 98 98 infos->format = [myImage bitmapFormat]; 99 99 100 pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_ C);100 pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_U8); 101 101 102 102 img->codec_free = pipi_free_coreimage; … … 110 110 { 111 111 NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; 112 pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_ C);112 pipi_pixels_t *p = pipi_get_pixels(img, PIPI_PIXELS_RGBA_U8); 113 113 114 114 int i;
Note: See TracChangeset
for help on using the changeset viewer.