MCPcopy Create free account
hub / github.com/Snapchat/Valdi / BitmapInfo

Class BitmapInfo

valdi_core/src/valdi_core/cpp/Interfaces/IBitmap.hpp:27–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25enum AlphaType { AlphaTypeOpaque = 0, AlphaTypePremul, AlphaTypeUnpremul };
26
27struct BitmapInfo {
28 int width;
29 int height;
30 ColorType colorType;
31 AlphaType alphaType;
32 size_t rowBytes;
33
34 BitmapInfo(int width, int height, ColorType colorType, AlphaType alphaType, size_t rowBytes)
35 : width(width), height(height), colorType(colorType), alphaType(alphaType), rowBytes(rowBytes) {}
36
37 bool operator==(const BitmapInfo& other) const {
38 return (this->width == other.width) && (this->height == other.height) && (this->colorType == other.colorType) &&
39 (this->alphaType == other.alphaType) && (this->rowBytes == other.rowBytes);
40 }
41
42 bool operator!=(const BitmapInfo& other) const {
43 return !(*this == other);
44 }
45
46 constexpr size_t bytesLength() const {
47 return height * rowBytes;
48 }
49
50 static size_t bytesPerPixelForColorType(ColorType colorType);
51};
52
53class IBitmap : public ValdiObject {
54public:

Callers 5

getInfoMethod · 0.50
createBitmapMethod · 0.50
snapshotViewMethod · 0.50
renderMethod · 0.50
clipImageToCircleFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected