15 #include <Ultralight/Defines.h> 26 enum UExport BitmapFormat {
37 #define GetBytesPerPixel(x) (x == kBitmapFormat_A8? 1 : 4) 61 static Ref<Bitmap> Create(uint32_t width, uint32_t height, BitmapFormat format);
86 static Ref<Bitmap> Create(uint32_t width, uint32_t height, BitmapFormat format,
87 uint32_t row_bytes,
const void* pixels,
size_t size,
bool should_copy =
true);
97 virtual uint32_t width()
const = 0;
102 virtual uint32_t height()
const = 0;
107 virtual IntRect bounds()
const = 0;
112 virtual BitmapFormat format()
const = 0;
117 virtual uint32_t bpp()
const = 0;
122 virtual uint32_t row_bytes()
const = 0;
127 virtual size_t size()
const = 0;
133 virtual bool owns_pixels()
const = 0;
140 virtual void* LockPixels() = 0;
145 virtual void UnlockPixels() = 0;
152 virtual const void* LockPixels()
const = 0;
157 virtual void UnlockPixels()
const = 0;
164 virtual void* raw_pixels() = 0;
169 virtual bool IsEmpty()
const = 0;
174 virtual void Erase() = 0;
213 virtual bool WritePNG(
const char* path) = 0;
219 void operator=(
const Bitmap&);
The header for various geometry definitions and helpers.
A non-nullable smart pointer.
Bitmap container with basic blitting and conversion routines.
This is a set of common JavaScriptCore Helper functions to simplify sample code.
The header for all ref-counting utilities.
Interface for all ref-counted objects that will be managed using the Ref<> and RefPtr<> smart pointer...
kBitmapFormat_A8
Alpha-channel only, 8-bits per channel (8-bits in total per pixel)
Integer Rectangle Helper.