8 #include "../iplatformbitmap.h" 11 #include "../../cpoint.h" 14 #include <CoreGraphics/CoreGraphics.h> 15 #include <ImageIO/ImageIO.h> 17 #include <ApplicationServices/ApplicationServices.h> 23 class CGBitmap :
public IPlatformBitmap
26 explicit CGBitmap (
const CPoint& size);
27 explicit CGBitmap (CGImageRef image);
29 ~CGBitmap () noexcept override;
31 bool load (const CResourceDescription& desc) override;
32 const CPoint& getSize ()
const override {
return size; }
33 SharedPointer<IPlatformBitmapPixelAccess> lockPixels (
bool alphaPremultiplied)
override;
34 void setScaleFactor (
double factor)
override { scaleFactor = factor; }
35 double getScaleFactor ()
const override {
return scaleFactor; }
37 CGImageRef getCGImage ();
38 CGContextRef createCGContext ();
39 bool loadFromImageSource (CGImageSourceRef source);
41 void setDirty () { dirty =
true; }
42 void* getBits ()
const {
return bits; }
43 uint32_t getBytesPerRow ()
const {
return bytesPerRow; }
45 CGLayerRef createCGLayer (CGContextRef context);
46 CGLayerRef getCGLayer ()
const {
return layer; }
54 CGImageSourceRef imageSource;
67 #endif // __cgbitmap__ Definition: customcontrols.cpp:8