ACF $AcfVersion:0$
CBitmapBase.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/CObject2dBase.h>
7#include <iimg/IBitmap.h>
8
9
10namespace iimg
11{
12
13
21 public i2d::CObject2dBase,
22 virtual public IBitmap
23{
24public:
26
27 // reimplemented (i2d::IObject2d)
28 virtual i2d::CVector2d GetCenter() const override;
29 virtual void MoveCenterTo(const i2d::CVector2d& position) override;
30 virtual i2d::CRectangle GetBoundingBox() const override;
31
32 // reimplemented (iimg::IBitmap)
33 virtual bool CreateImageFromRegion(const iimg::IBitmap& sourceBitmap, const i2d::CRect& region) override;
34 virtual int GetLineBytesCount() const override;
35 virtual int GetComponentBitsCount(int componentIndex = 0) const override;
36 virtual int GetPixelBitsCount() const override;
37
38 // reimplemented (iimg::IRasterImage)
39 virtual bool IsEmpty() const override;
40 virtual int GetComponentsCount() const override;
41 virtual icmm::CVarColor GetColorAt(const istd::CIndex2d& position) const override;
42 virtual bool SetColorAt(const istd::CIndex2d& position, const icmm::CVarColor& color) override;
43 virtual const icmm::IColorModel* GetColorModel() const override;
44
45 // reimplemented (iser::ISerializable)
46 virtual bool Serialize(iser::IArchive& archive) override;
47
48protected:
50 static int GetComponentBitsCount(IBitmap::PixelFormat format, int componentIndex);
52};
53
54
55} // namespace iimg
56
57
58
59
Base class for 2D-objects implementing interface i2d::IObject2d.
Simple rectangle with integer bounds.
Definition CRect.h:22
Definition of rectangle area orthogonal to axis of coordination system.
Definition CRectangle.h:27
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Generic color implementation with variable number of color components.
Definition CVarColor.h:176
Common interface for color model definitions in the ACF color management system.
Base implementation of some iimg::IBitmap methods.
Definition CBitmapBase.h:23
static int GetPixelBitsCount(IBitmap::PixelFormat format)
static int GetComponentBitsCount(IBitmap::PixelFormat format, int componentIndex)
virtual int GetLineBytesCount() const override
Number of bytes per single line.
static int GetComponentsCount(IBitmap::PixelFormat format)
virtual int GetComponentBitsCount(int componentIndex=0) const override
Get number of bits per single pixel component.
virtual void MoveCenterTo(const i2d::CVector2d &position) override
Move object to position position.
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
i2d::CObject2dBase BaseClass
Definition CBitmapBase.h:25
virtual i2d::CVector2d GetCenter() const override
Returns center of this 2D-object.
virtual bool CreateImageFromRegion(const iimg::IBitmap &sourceBitmap, const i2d::CRect &region) override
Create image as a copy of rectangular region of some other image.
virtual const icmm::IColorModel * GetColorModel() const override
Get the color model related to the image.
virtual bool SetColorAt(const istd::CIndex2d &position, const icmm::CVarColor &color) override
Set color at specified pixel.
virtual icmm::CVarColor GetColorAt(const istd::CIndex2d &position) const override
Get color at specified pixel.
virtual i2d::CRectangle GetBoundingBox() const override
Get bounding box of this shape.
virtual int GetComponentsCount() const override
Get number of color components.
virtual int GetPixelBitsCount() const override
Get total number of bits per single pixel.
virtual bool IsEmpty() const override
Return true if this image is empty.
Definition of single plane bitmap.
Definition IBitmap.h:21
PixelFormat
Bitmap pixel format description.
Definition IBitmap.h:27
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:21
Contains the system indenendent definitions of image and related themes.
Definition CBitmap.h:17