| 25 | enum AlphaType { AlphaTypeOpaque = 0, AlphaTypePremul, AlphaTypeUnpremul }; |
| 26 | |
| 27 | struct 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 | |
| 53 | class IBitmap : public ValdiObject { |
| 54 | public: |
no outgoing calls
no test coverage detected