Generic image template. More...
#include <image.h>
Public Member Functions | |
image (uint32_t width, uint32_t height, uint32_t channels=1, const T *buf=NULL) | |
size_t | get_index (uint32_t x, uint32_t y) const |
Get the index of a pixel. | |
const T * | get_pixel (uint32_t x, uint32_t y) const |
Get address of a pixel. This returns NULL if coordinates are invalid. | |
const T * | get_constrained_pixel (uint32_t x, uint32_t y, bool wrap_x=false, bool wrap_y=false) const |
T * | get_buffer (void) const |
Get pointer to image buffer. | |
uint32_t | get_width (void) const |
Get image width. | |
uint32_t | get_height (void) const |
Get image height. | |
uint32_t | get_channels (void) const |
Get number of channels. | |
void | set_pixel (uint32_t x, uint32_t y, const T *pixel) |
Copy data to a pixel, provided that coordinates are valid. |
Generic image template.
const T* spectral::image< T >::get_constrained_pixel | ( | uint32_t | x, | |
uint32_t | y, | |||
bool | wrap_x = false , |
|||
bool | wrap_y = false | |||
) | const [inline] |
Get address of a pixel. If coordinates are out of range then a point within the image will be selected according to wrapping rules.