ACF $AcfVersion:0$
IBitmap.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <i2d/CRect.h>
7#include <iimg/IRasterImage.h>
8
9
10namespace iimg
11{
12
13
20class IBitmap: virtual public IRasterImage
21{
22public:
110
115 virtual PixelFormat GetPixelFormat() const = 0;
116
121 virtual bool IsFormatSupported(PixelFormat pixelFormat) const = 0;
122
130 virtual bool CreateBitmap(PixelFormat pixelFormat, const istd::CIndex2d& size, int pixelBitsCount = 0, int componentsCount = 0) = 0;
131
140 virtual bool CreateBitmap(PixelFormat pixelFormat, const istd::CIndex2d& size, void* dataPtr, bool releaseFlag, int linesDifference = 0) = 0;
141
145 virtual bool CreateImageFromRegion(const iimg::IBitmap& sourceImage, const i2d::CRect& region) = 0;
146
150 virtual int GetLineBytesCount() const = 0;
151
155 virtual int GetLinesDifference() const = 0;
156
160 virtual int GetPixelsDifference() const = 0;
161
165 virtual int GetComponentBitsCount(int componentIndex = 0) const = 0;
166
170 virtual int GetPixelBitsCount() const = 0;
171
176 virtual const void* GetLinePtr(int positionY) const = 0;
177
182 virtual void* GetLinePtr(int positionY) = 0;
183};
184
185
188
189
190} // namespace iimg
191
192
193
194
Simple rectangle with integer bounds.
Definition CRect.h:22
Definition of single plane bitmap.
Definition IBitmap.h:21
virtual int GetComponentBitsCount(int componentIndex=0) const =0
Get number of bits per single pixel component.
PixelFormat
Bitmap pixel format description.
Definition IBitmap.h:27
@ PF_GRAY32
32-bit grayscale bitmap.
Definition IBitmap.h:66
@ PF_XY32
Pixel value is a 32-bit floating 2D-coordinate (X,Y) In this mode the bitmap represents 2D calibratio...
Definition IBitmap.h:88
@ PF_RGB48
48-bit RGB-bitmap packed bitmap (16-16-16).
Definition IBitmap.h:93
@ PF_USER
First user defined pixel format.
Definition IBitmap.h:108
@ PF_CMYK
32-bit CMYK-bitmap.
Definition IBitmap.h:103
@ PF_RGB24
24-bit RGB-bitmap packed bitmap.
Definition IBitmap.h:56
@ PF_XYZ32
Pixel value is a 32-bit floating 3D-coordinate (X,Y,Z) In this mode the bitmap represents an organize...
Definition IBitmap.h:82
@ PF_RGBA
32-bit RGB bitmap with alpha channel.
Definition IBitmap.h:51
@ PF_FLOAT32
32-bit floating point coded bitmap (type float).
Definition IBitmap.h:71
@ PF_FLOAT64
64-bit floating point coded bitmap (type double).
Definition IBitmap.h:76
@ PF_GRAY16
16-bit grayscale bitmap.
Definition IBitmap.h:61
@ PF_GRAY
8-bit grayscale bitmap.
Definition IBitmap.h:41
@ PF_UNKNOWN
Unknown image format.
Definition IBitmap.h:31
@ PF_RGB
32-bit RGB-bitmap, alpha channel can be ignored.
Definition IBitmap.h:46
@ PF_RGBA64
64-bit RGBA-bitmap packed bitmap (16-16-16-16).
Definition IBitmap.h:98
@ PF_MONO
Monochrome bitmap.
Definition IBitmap.h:36
virtual int GetPixelBitsCount() const =0
Get total number of bits per single pixel.
virtual int GetLineBytesCount() const =0
Number of bytes per single line.
virtual bool CreateBitmap(PixelFormat pixelFormat, const istd::CIndex2d &size, void *dataPtr, bool releaseFlag, int linesDifference=0)=0
Create bitmap with specified size and format using external image data buffer.
virtual void * GetLinePtr(int positionY)=0
Get pointer to buffer for single line.
virtual bool CreateImageFromRegion(const iimg::IBitmap &sourceImage, const i2d::CRect &region)=0
Create image as a copy of rectangular region of some other image.
virtual int GetLinesDifference() const =0
Get address difference between next and previous line.
virtual int GetPixelsDifference() const =0
Get address difference between next and previous pixel.
virtual bool IsFormatSupported(PixelFormat pixelFormat) const =0
Get true if the pixel format is supported by the bitmap implementation.
virtual PixelFormat GetPixelFormat() const =0
Get the bitmap's pixel format.
virtual const void * GetLinePtr(int positionY) const =0
Get pointer to buffer for single line.
virtual bool CreateBitmap(PixelFormat pixelFormat, const istd::CIndex2d &size, int pixelBitsCount=0, int componentsCount=0)=0
Create bitmap with specified size and format.
General definition of image contains pixels in regular grid.
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:21
Shared ownership smart pointer for interface types.
Unique ownership smart pointer for interface types.
Contains the system indenendent definitions of image and related themes.
Definition CBitmap.h:17
istd::TSharedInterfacePtr< iimg::IBitmap > IBitmapSharedPtr
Definition IBitmap.h:187
istd::TUniqueInterfacePtr< iimg::IBitmap > IBitmapUniquePtr
Definition IBitmap.h:186