5 #ifndef __iplatformbitmap__ 6 #define __iplatformbitmap__ 10 #include "../vstguifwd.h" 14 using PNGBitmapBuffer = std::vector<uint8_t>;
15 class IPlatformBitmapPixelAccess;
18 class IPlatformBitmap :
public AtomicReferenceCounted
21 static SharedPointer<IPlatformBitmap> create (CPoint* size =
nullptr);
22 static SharedPointer<IPlatformBitmap> createFromPath (UTF8StringPtr absolutePath);
25 static SharedPointer<IPlatformBitmap> createFromMemory (
const void* ptr, uint32_t memSize);
28 static PNGBitmapBuffer createMemoryPNGRepresentation (
const SharedPointer<IPlatformBitmap>& bitmap);
30 virtual bool load (
const CResourceDescription& desc) = 0;
31 virtual const CPoint& getSize ()
const = 0;
33 virtual SharedPointer<IPlatformBitmapPixelAccess> lockPixels (
bool alphaPremultiplied) = 0;
35 virtual void setScaleFactor (
double factor) = 0;
36 virtual double getScaleFactor ()
const = 0;
40 class IPlatformBitmapPixelAccess :
public AtomicReferenceCounted
50 virtual uint8_t* getAddress ()
const = 0;
51 virtual uint32_t getBytesPerRow ()
const = 0;
52 virtual PixelFormat getPixelFormat ()
const = 0;
59 #endif // __iplatformbitmap__ Definition: customcontrols.cpp:8