SVGKExporterNSImage.h 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. General-purpose exporter from loaded-SVGKImage object into a new, rasterised NSImage.
  3. Uses the default color format from UIGraphicsBeginImageContextWithOptions(...)
  4. */
  5. #import <Foundation/Foundation.h>
  6. #import "SVGKImage.h"
  7. @interface SVGKExporterNSImage : NSObject
  8. /**
  9. Higher-performance version of .NSImage property (the property uses this method, but you can tweak the parameters for better performance / worse accuracy)
  10. NB: you can get BETTER performance using the exportNSDataAntiAliased: version of this method, becuase you bypass Apple's slow code for making NSImage objects
  11. Delegates to exportAsNSImage:... antiAliased:TRUE curveFlatnessFactor:1.0 interpolationQuality:kCGInterpolationDefault]
  12. */
  13. +(NSImage*) exportAsNSImage:(SVGKImage*) image;
  14. /**
  15. Higher-performance version of .NSImage property (the property uses this method, but you can tweak the parameters for better performance / worse accuracy)
  16. NB: you can get BETTER performance using the exportNSDataAntiAliased: version of this method, becuase you bypass Apple's slow code for making NSImage objects
  17. @param shouldAntialias = Apple defaults to TRUE, but turn it off for small speed boost
  18. @param multiplyFlatness = how many pixels a curve can be flattened by (Apple's internal setting) to make it faster to render but less accurate
  19. @param interpolationQuality = Apple internal setting, c.f. Apple docs for CGInterpolationQuality
  20. */
  21. +(NSImage*) exportAsNSImage:(SVGKImage*) image antiAliased:(BOOL) shouldAntialias curveFlatnessFactor:(CGFloat) multiplyFlatness interpolationQuality:(CGInterpolationQuality) interpolationQuality;
  22. @end