darling-cocotron/QuartzCore/CIImage.m

48 lines
817 B
Mathematica
Raw Normal View History

2010-03-08 16:18:32 +00:00
#import <AppKit/NSRaise.h>
#import <QuartzCore/CIImage.h>
2010-03-08 16:18:32 +00:00
@implementation CIImage
+ (CIImage *) emptyImage {
return [[self alloc] initWithCGImage: NULL];
2010-03-08 16:18:32 +00:00
}
- initWithCGImage: (CGImageRef) cgImage {
_cgImage = CGImageRetain(cgImage);
_filter = nil;
return self;
2010-03-08 16:18:32 +00:00
}
- (void) dealloc {
CGImageRelease(_cgImage);
[_filter release];
[super dealloc];
2010-03-08 16:18:32 +00:00
}
- (CGRect) extent {
CGRect result;
result.origin.x = 0;
result.origin.y = 0;
result.size.width = CGImageGetWidth(_cgImage);
result.size.height = CGImageGetHeight(_cgImage);
2010-03-08 16:18:32 +00:00
return result;
2010-03-08 16:18:32 +00:00
}
- (CGImageRef) CGImage {
return _cgImage;
2010-03-08 16:18:32 +00:00
}
- (CIFilter *) filter {
return _filter;
2010-03-08 16:18:32 +00:00
}
- (void) setFilter: (CIFilter *) filter {
filter = [filter retain];
[_filter release];
_filter = filter;
2010-03-08 16:18:32 +00:00
}
@end