|
| | Image (int rows, int columns) |
| | Allocates an owned row-major image buffer.
|
| void | fill (PixelType value) |
| | Fills every pixel with value.
|
| bool | isEqual (const Ptr &other) const |
| | Returns true when shape and pixel values match other.
|
| Ptr | clone () const |
| | Returns a deep copy with its own owned buffer.
|
| std::shared_ptr< PixelType[]> | rawDataPtr () |
| | Returns the shared pointer that owns or wraps the raw buffer.
|
| PixelType * | rawData () |
| | Returns a mutable pointer to the contiguous row-major buffer.
|
| int | getNumRows () const |
| | Returns the number of image rows.
|
| int | getNumColumns () const |
| | Returns the number of image columns.
|
| int | getSize () const |
| | Returns the total number of pixels.
|
| PixelType & | operator[] (PixelId index) |
| | Returns mutable linear access to pixel index.
|
| const PixelType & | operator[] (PixelId index) const |
| | Returns immutable linear access to pixel index.
|
|
| static Ptr | create (int rows, int columns) |
| | Creates an owned image with uninitialised pixel values.
|
| static Ptr | create (int rows, int columns, PixelType initValue) |
| | Creates an owned image and fills every pixel with initValue.
|
| static Ptr | fromExternal (PixelType *rawPtr, int rows, int columns) |
| | Wraps external row-major memory without taking ownership.
|
| static Ptr | fromRaw (PixelType *rawPtr, int rows, int columns) |
| | Wraps row-major memory and takes ownership through delete[].
|
template<typename PixelType>
class mmcfilters::Image< PixelType >
Generic row-major 2D image with contiguous storage and shared ownership.
Image<PixelType> stores a rectangular image in a single contiguous row-major buffer. The class exposes simple factory helpers for owned and non-owned memory, deep copy support, linear access, and a few convenience operations used throughout the library.
Ownership semantics:
- create(rows, columns) allocates and owns a fresh buffer;
- create(rows, columns, initValue) allocates, owns, and fills the buffer;
- fromExternal(rawPtr, rows, columns) wraps external memory without taking ownership;
- fromRaw(rawPtr, rows, columns) wraps external memory and assumes ownership.
- Template Parameters
-
| PixelType | Pixel scalar type, such as uint8_t, int32_t, or float. |
Definition at line 39 of file Image.hpp.
template<typename PixelType>
Returns the shared pointer that owns or wraps the raw buffer.
The returned pointer shares the same ownership/lifetime policy as this image: either owning storage, externally wrapped storage, or adopted raw storage.
- Returns
- The shared pointer that owns or wraps the raw buffer.
Definition at line 196 of file Image.hpp.