Changeset 2903
- Timestamp:
- 10/08/08 10:56:51 (5 years ago)
- Location:
- libpipi/trunk/pipi/codec
- Files:
-
- 2 edited
-
coreimage.h (modified) (1 diff)
-
coreimage.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libpipi/trunk/pipi/codec/coreimage.h
r2902 r2903 1 1 /* 2 * libpipi P roper image processing implementationlibrary2 * libpipi Pathetic image processing interface library 3 3 * Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org> 4 4 * 2008 Jean-Yves Lamoureux <jylam@lnxscene.org> -
libpipi/trunk/pipi/codec/coreimage.m
r2897 r2903 1 1 /* 2 * libpipi P roper image processing implementationlibrary2 * libpipi Pathetic image processing interface library 3 3 * Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org> 4 4 * 2008 Jean-Yves Lamoureux <jylam@lnxscene.org> … … 38 38 NSBitmapImageRep * myImage; 39 39 myImage = [[NSBitmapImageRep alloc] initWithCIImage:source]; 40 40 41 41 pipi_image_t *img; 42 42 img = pipi_new(w, h); … … 50 50 51 51 img->codec_priv = (void*)[myImage bitmapFormat]; 52 53 52 53 54 54 pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); 55 56 [autoreleasepool release]; 55 56 [autoreleasepool release]; 57 57 return img; 58 58 } … … 64 64 printf("%d\n", img->last_modified); 65 65 pipi_pixels_t *p = pipi_getpixels(img, PIPI_PIXELS_RGBA_C); 66 66 67 67 NSString *n = [NSString stringWithCString: name]; 68 68 NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] … … 81 81 if(bitmap == nil) return -1; 82 82 memcpy([bitmap bitmapData], p->pixels, p->w*p->h*4); 83 84 [[bitmap representationUsingType:NSPNGFileType properties:nil] writeToFile:n atomically:YES]; 85 [autoreleasepool release]; 83 84 [[bitmap representationUsingType:NSPNGFileType properties:nil] writeToFile:n atomically:YES]; 85 [autoreleasepool release]; 86 86 87 87 return 1;
Note: See TracChangeset
for help on using the changeset viewer.
