|
MorphologicalAttributeFilters
Public API documentation
|
Generic row-major 2D image with contiguous storage and shared ownership. More...
#include <Image.hpp>
Public Types | |
| using | Type = PixelType |
| Pixel scalar type stored by this image. | |
Public Member Functions | |
| Image (int rows, int cols) | |
| 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 | getNumCols () const |
| Returns the number of image columns. | |
| int | getSize () const |
| Returns the total number of pixels. | |
| PixelType & | operator[] (int index) |
Returns mutable linear access to pixel index. | |
| const PixelType & | operator[] (int index) const |
Returns immutable linear access to pixel index. | |
Static Public Member Functions | |
| static Ptr | create (int rows, int cols) |
| Creates an owned image with uninitialised pixel values. | |
| static Ptr | create (int rows, int cols, PixelType initValue) |
Creates an owned image and fills every pixel with initValue. | |
| static Ptr | fromExternal (PixelType *rawPtr, int rows, int cols) |
| Wraps external row-major memory without taking ownership. | |
| static Ptr | fromRaw (PixelType *rawPtr, int rows, int cols) |
Wraps row-major memory and takes ownership through delete[]. | |
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, cols) allocates and owns a fresh buffer;create(rows, cols, initValue) allocates, owns, and fills the buffer;fromExternal(rawPtr, rows, cols) wraps external memory without taking ownership;fromRaw(rawPtr, rows, cols) wraps external memory and assumes ownership.| PixelType | Pixel scalar type, such as uint8_t, int32_t, or float. |
|
inline |
|
inlinestatic |
Creates an owned image with uninitialised pixel values.
| rows | Number of image rows. |
| cols | Number of image columns. |
| std::invalid_argument | If either dimension is not positive. |
| std::overflow_error | If rows * cols exceeds the supported size. |
|
inlinestatic |
Creates an owned image and fills every pixel with initValue.
| rows | Number of image rows. |
| cols | Number of image columns. |
| initValue | Value assigned to every pixel. |
| std::invalid_argument | If either dimension is not positive. |
| std::overflow_error | If rows * cols exceeds the supported size. |
|
inlinestatic |
Wraps external row-major memory without taking ownership.
The caller remains responsible for keeping rawPtr alive while the image wrapper is used.
| rawPtr | Pointer to rows * cols row-major pixels. |
| rows | Number of image rows. |
| cols | Number of image columns. |
| std::invalid_argument | If rawPtr is null or dimensions are invalid. |
| std::overflow_error | If rows * cols exceeds the supported size. |
|
inlinestatic |
Wraps row-major memory and takes ownership through delete[].
| rawPtr | Pointer allocated with new PixelType[]. |
| rows | Number of image rows. |
| cols | Number of image columns. |
| std::invalid_argument | If rawPtr is null or dimensions are invalid. |
| std::overflow_error | If rows * cols exceeds the supported size. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns mutable linear access to pixel index.
index is interpreted in row-major order as row * getNumCols() + col. The operator does not perform bounds checking.
|
inline |
Returns immutable linear access to pixel index.
index is interpreted in row-major order as row * getNumCols() + col. The operator does not perform bounds checking.
|
inline |
|
inline |