|
| using | const_iterator = T const * |
| | The type of a const iterator to an element.
|
| |
| using | const_pointer = T const * |
| | The type of a const pointer to an element.
|
| |
| using | const_reference = T const & |
| | The type of a const reference to an element.
|
| |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
| | The type of a const reverse iterator to an element.
|
| |
| using | difference_type = std::ptrdiff_t |
| | The type of the difference between two sizes.
|
| |
| using | iterator = T * |
| | The type of an iterator to an element.
|
| |
| using | pointer = T * |
| | The type of a pointer to an element.
|
| |
| using | reference = T & |
| | The type of a reference to an element.
|
| |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| | The type of a reverse iterator to an element.
|
| |
| using | size_type = std::size_t |
| | The type of the size of the image.
|
| |
| using | value_type = T |
| | The type of the elements stored in the image.
|
| |
|
|
| Image ()=default |
| | Constructs an empty image with no pixels (rows = cols = 0).
|
| |
| | Image (Image &&)=default |
| | Move-constructs an image, transferring ownership of pixel data.
|
| |
| | Image (Image const &other) |
| | Copy-constructs an image, performing a deep copy of all pixel data.
|
| |
| | Image (size_type rows, size_type cols, T const &value=T{}) |
| | Constructs an image with the given dimensions, filling every pixel with value.
|
| |
| auto & | at (this auto &self, size_type row, size_type col) |
| | Returns a (const) reference to the pixel at (row, col) with bounds checking.
|
| |
| auto | begin (this auto &self) noexcept |
| | Returns an iterator to the first pixel.
|
| |
| const_iterator | cbegin () const noexcept |
| | Returns a const iterator to the first pixel.
|
| |
| const_iterator | cend () const noexcept |
| | Returns a const iterator one past the last pixel.
|
| |
| void | clear () noexcept |
| | Clears the image, releasing all memory.
|
| |
| constexpr size_type | cols () const noexcept |
| | Returns the number of columns (width) in the image.
|
| |
| auto | column (this auto &self, size_type c) noexcept |
| | Returns a lazy view over all pixels in the given column.
|
| |
| const_reverse_iterator | crbegin () const noexcept |
| | Returns a const reverse iterator to the last pixel.
|
| |
| const_reverse_iterator | crend () const noexcept |
| | Returns a const reverse iterator to one before the first pixel.
|
| |
| auto | data (this auto &self) noexcept |
| | Returns a pointer to the underlying contiguous pixel array.
|
| |
| void | downscale (float factor) |
| | Downscales the image by the given factor.
|
| |
| bool | empty () const noexcept |
| | Returns true if the image has no pixels (i.e., size() == 0).
|
| |
| auto | end (this auto &self) noexcept |
| | Returns an iterator one past the last pixel.
|
| |
| void | fill (T const &value) |
| | Fills the image with the given value.
|
| |
| void | flipHorizontal () noexcept |
| | Flips the image horizontally in-place.
|
| |
| void | flipVertical () noexcept |
| | Flips the image vertically in-place.
|
| |
| constexpr size_type | index (size_type row, size_type col) const noexcept |
| | Computes the flat row-major index for position (row, col).
|
| |
| Image & | operator= (Image &&)=default |
| | Move-assigns from another image, transferring ownership of pixel data.
|
| |
| Image & | operator= (Image const &rhs) |
| | Copy-assigns from another image, performing a deep copy of all pixel data.
|
| |
| auto & | operator[] (this auto &self, size_type index) |
| | Returns a (const) reference to the pixel at the given flat index.
|
| |
| auto & | operator[] (this auto &self, size_type row, size_type col) |
| | Returns a (const) reference to the pixel at (row, col).
|
| |
| auto | rbegin (this auto &self) noexcept |
| | Returns a reverse iterator to the last pixel.
|
| |
| auto | rend (this auto &self) noexcept |
| | Returns a reverse iterator to one before the first pixel.
|
| |
| void | rescale (size_type rows, size_type cols) |
| | Rescales the image to the given dimensions using bilinear interpolation.
|
| |
| Image | rescaled (size_type rows, size_type cols) const |
| | Returns a rescaled copy of the image using bilinear interpolation.
|
| |
| void | resize (size_type rows, size_type cols) |
| | Resizes the image to the given dimensions.
|
| |
| Image | rotate90 (bool clockwise=true) const |
| | Returns a rotated copy of the image.
|
| |
| std::span< T const > | row (size_type r) const noexcept |
| | Returns a const span over all pixels in the given row.
|
| |
| std::span< T > | row (size_type r) noexcept |
| | Returns a span over all pixels in the given row.
|
| |
| constexpr size_type | rows () const noexcept |
| | Returns the number of rows (height) in the image.
|
| |
| T | sample (float r, float c) const |
| | Samples the image at (row, col) using bilinear interpolation.
|
| |
| T | samplePixel (float r, float c) const |
| | Samples the image at pixel (row, col) using bilinear interpolation.
|
| |
| constexpr size_type | size () const noexcept |
| | Returns the total number of pixels (rows() * cols()).
|
| |
| void | swap (Image &other) noexcept |
| | Swaps the contents of this image with other.
|
| |
| Image | transposed () const |
| | Returns a transposed copy of the image.
|
| |
| void | upscale (float factor) |
| | Upscales the image by the given factor.
|
| |
template<class T>
class ufo::Image< T >
Image class for storing and manipulating 2D pixel data.
- Template Parameters
-
Image owns its pixel data and provides both flat (single-index) and two-dimensional (row, col) element access. The storage layout is contiguous and row-major, meaning that pixels in the same row are adjacent in memory.
The class satisfies std::ranges::contiguous_range, so it can be used directly with range algorithms and range-based for loops.
Definition at line 77 of file image.hpp.