2D array of RGB8 color pixels.
More...
#include <Frame.h>
|
| ImageArray & | operator= (const ImageArray &)=default |
| | Copies pixel data from another image array.
|
| ImageArray & | operator= (ImageArray &&)=default |
| | Moves pixel data from another image array.
|
| | ImageArray (const ImageArray &)=default |
| | Copies an existing image array.
|
| | ImageArray (ImageArray &&)=default |
| | Moves an existing image array.
|
| | ImageArray (int width, int height, Col bgCol) |
| | Construct array with dimensions.
|
| | ~ImageArray () |
| void | RedoColorAdjustment (Col bgCol) |
| | Reapplies background-color dependent adjustments after a color change.
|
| void | Resize () |
| | Resizes the backing pixel buffer to match current dimensions.
|
| void | Set (int x, int y, const Col &color) |
| | Sets a pixel color.
|
| Col | Get (int x, int y) const |
| | Returns a pixel color.
|
| int | Width () const |
| | Returns the image width in pixels.
|
| void | SetWidth (int width, bool clear=false) |
| | Sets the image width.
|
| int | Height () const |
| | Returns the image height in pixels.
|
| void | SetHeight (int height, bool clear=false) |
| | Sets the image height.
|
| void | SetData (const std::vector< Col > &data) |
| | Replaces the raw pixel buffer.
|
| const std::vector< Col > & | Data () const |
| | Returns the raw pixel buffer.
|
| Col | BgCol () const |
| | Returns the image background color.
|
| void | SetBG (const Col bgCol) |
| | Sets the background color.
|
2D array of RGB8 color pixels.
Stores a width x height grid of Col (RGB8) values in a flat vector. Used by Frame to store pixel data. Supports bounds-checked get/set.
- Invariant
- Width() > 0 && Height() > 0
-
m_Data.size() == Width() * Height()
- Note
- Thread-unsafe: no locking.
- Warning
- Accessing out of bounds is undefined behavior.
◆ ImageArray() [1/3]
| FuncDoodle::ImageArray::ImageArray |
( |
const ImageArray & | | ) |
|
|
default |
Copies an existing image array.
◆ ImageArray() [2/3]
| FuncDoodle::ImageArray::ImageArray |
( |
ImageArray && | | ) |
|
|
default |
Moves an existing image array.
◆ ImageArray() [3/3]
| FuncDoodle::ImageArray::ImageArray |
( |
int | width, |
|
|
int | height, |
|
|
Col | bgCol ) |
Construct array with dimensions.
- Parameters
-
| width | Must be > 0. |
| height | Must be > 0. |
| bgCol | Background color for unfilled pixels. |
- Precondition
- width > 0 && height > 0
◆ ~ImageArray()
| FuncDoodle::ImageArray::~ImageArray |
( |
| ) |
|
◆ BgCol()
| Col FuncDoodle::ImageArray::BgCol |
( |
| ) |
const |
|
inlinenodiscard |
Returns the image background color.
- Returns
- Background color.
◆ Data()
| const std::vector< Col > & FuncDoodle::ImageArray::Data |
( |
| ) |
const |
|
inlinenodiscard |
Returns the raw pixel buffer.
- Returns
- Const reference to pixel data.
◆ Get()
| Col FuncDoodle::ImageArray::Get |
( |
int | x, |
|
|
int | y ) const |
|
nodiscard |
Returns a pixel color.
- Parameters
-
| x | Pixel X coordinate. |
| y | Pixel Y coordinate. |
- Returns
- Pixel color at the requested coordinate.
◆ Height()
| int FuncDoodle::ImageArray::Height |
( |
| ) |
const |
|
inlinenodiscard |
Returns the image height in pixels.
- Returns
- Image height.
◆ operator=() [1/2]
Copies pixel data from another image array.
◆ operator=() [2/2]
Moves pixel data from another image array.
◆ RedoColorAdjustment()
| void FuncDoodle::ImageArray::RedoColorAdjustment |
( |
Col | bgCol | ) |
|
Reapplies background-color dependent adjustments after a color change.
- Parameters
-
| bgCol | New background color. |
◆ Resize()
| void FuncDoodle::ImageArray::Resize |
( |
| ) |
|
Resizes the backing pixel buffer to match current dimensions.
◆ Set()
| void FuncDoodle::ImageArray::Set |
( |
int | x, |
|
|
int | y, |
|
|
const Col & | color ) |
Sets a pixel color.
- Parameters
-
| x | Pixel X coordinate. |
| y | Pixel Y coordinate. |
| color | New pixel color. |
◆ SetBG()
| void FuncDoodle::ImageArray::SetBG |
( |
const Col | bgCol | ) |
|
|
inline |
Sets the background color.
- Parameters
-
| bgCol | New background color. |
◆ SetData()
| void FuncDoodle::ImageArray::SetData |
( |
const std::vector< Col > & | data | ) |
|
|
inline |
Replaces the raw pixel buffer.
- Parameters
-
◆ SetHeight()
| void FuncDoodle::ImageArray::SetHeight |
( |
int | height, |
|
|
bool | clear = false ) |
|
inline |
Sets the image height.
- Parameters
-
| height | New image height. |
| clear | Whether pixel contents should be cleared. |
◆ SetWidth()
| void FuncDoodle::ImageArray::SetWidth |
( |
int | width, |
|
|
bool | clear = false ) |
|
inline |
Sets the image width.
- Parameters
-
| width | New image width. |
| clear | Whether pixel contents should be cleared. |
◆ Width()
| int FuncDoodle::ImageArray::Width |
( |
| ) |
const |
|
inlinenodiscard |
Returns the image width in pixels.
- Returns
- Image width.
◆ m_BG
| Col FuncDoodle::ImageArray::m_BG |
|
private |
◆ m_Data
| std::vector<Col> FuncDoodle::ImageArray::m_Data |
|
private |
◆ m_Height
◆ m_Width
The documentation for this class was generated from the following files: