Missing CGImageSourceCreateWithURL API

This commit is contained in:
Airy ANDRE 2011-05-28 20:31:35 +02:00
parent 6a432cf763
commit 8301661482
5 changed files with 11 additions and 4 deletions

View File

@ -8,12 +8,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import "CoreGraphicsExport.h"
#import <CoreFoundation/CFDictionary.h>
#import <CoreFoundation/CFURL.h>
typedef struct _O2ImageSource *CGImageSourceRef;
#import "CGImage.h"
COREGRAPHICS_EXPORT CGImageSourceRef CGImageSourceCreateWithData(CFDataRef data,CFDictionaryRef options);
COREGRAPHICS_EXPORT CGImageSourceRef CGImageSourceCreateWithURL(CFURLRef url,CFDictionaryRef options);
COREGRAPHICS_EXPORT size_t CGImageSourceGetCount(CGImageSourceRef self);

View File

@ -5,7 +5,11 @@
@end
CGImageSourceRef CGImageSourceCreateWithData(CFDataRef data,CFDictionaryRef options) {
return (CGImageSourceRef)[O2ImageSource newImageSourceWithData:data options:options];
return (CGImageSourceRef)[O2ImageSource newImageSourceWithData:data options:options];
}
CGImageSourceRef CGImageSourceCreateWithURL(CFURLRef url,CFDictionaryRef options) {
return (CGImageSourceRef)[O2ImageSource newImageSourceWithURL:url options:options];
}
size_t CGImageSourceGetCount(CGImageSourceRef self) {

View File

@ -176,9 +176,10 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self,int fillRuleMask);
O2Size size=[self size];
if (O2ContextCurrentGState(self)->_shadowKernel) {
O2Surface *shadow=[self createSurfaceWithWidth:O2ImageGetWidth(_surface) height:O2ImageGetHeight(_surface)];
O2Surface *shadow=[self createSurfaceWithWidth:O2ImageGetWidth(_surface)+O2ContextCurrentGState(self)->_shadowOffset.width*2 height:O2ImageGetHeight(_surface)+O2ContextCurrentGState(self)->_shadowOffset.height*2];
O2SurfaceGaussianBlur(shadow,O2LayerGetSurface(layer),O2ContextCurrentGState(self)->_shadowKernel,O2ContextCurrentGState(self)->_shadowColor);
NSLog(@"Drawing shadow");
O2ContextDrawImage(self,O2RectMake(O2ContextCurrentGState(self)->_shadowOffset.width,O2ContextCurrentGState(self)->_shadowOffset.height,size.width,size.height),shadow);
}

View File

@ -23,7 +23,7 @@ extern NSString *kO2ImagePropertyDPIHeight;
+(O2ImageSourceRef)newImageSourceWithDataProvider:(O2DataProvider *)provider options:(CFDictionaryRef)options;
+(O2ImageSourceRef)newImageSourceWithData:(CFDataRef)data options:(CFDictionaryRef)options;
+(O2ImageSourceRef)newImageSourceWitURL:(NSURL *)url options:(CFDictionaryRef)options;
+(O2ImageSourceRef)newImageSourceWithURL:(NSURL *)url options:(CFDictionaryRef)options;
+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider;

View File

@ -50,7 +50,7 @@ NSString *kO2ImagePropertyDPIHeight=@"kCGImagePropertyDPIHeight";
return result;
}
+(O2ImageSourceRef)newImageSourceWitURL:(NSURL *)url options:(CFDictionaryRef)options {
+(O2ImageSourceRef)newImageSourceWithURL:(NSURL *)url options:(CFDictionaryRef)options {
O2DataProviderRef provider=[[O2DataProvider alloc] initWithURL:url];
O2ImageSourceRef result=[self newImageSourceWithDataProvider:provider options:options];
O2DataProviderRelease(provider);