Solar
|
A 2D image.. More...
#include <Image.h>
Public Types | |
enum | DataType { TYPE_8U , TYPE_16U , TYPE_32U , TYPE_64U } |
enum | ImageLayout { LAYOUT_RGB =0 , LAYOUT_BGR , LAYOUT_GREY , LAYOUT_RGBA , LAYOUT_RGBX , LAYOUT_UNDEFINED } |
enum | ColorSpace { SPACE_RGB_709 =0 , SPACE_GREY , SPACE_UNDEFINED } |
enum | PixelOrder { INTERLEAVED =0 , PER_CHANNEL } |
enum | ImageEncoding { ENCODING_NONE =0 , ENCODING_JPEG , ENCODING_PNG } |
Public Member Functions | |
Image (enum ImageLayout pixLayout, enum PixelOrder pixOrder, DataType type) | |
Image. More... | |
Image (uint32_t width, uint32_t height, enum ImageLayout pixLayout, enum PixelOrder pixOrder, DataType type) | |
Image. More... | |
Image (void *imageData, uint32_t width, uint32_t height, enum ImageLayout pixLayout, enum PixelOrder pixOrder, DataType type, ImageEncoding encoding=ENCODING_NONE) | |
Image built from a raw data pointer. More... | |
~Image ()=default | |
~Image | |
SRef< Image > | copy () const |
copy the current Image More... | |
void | setSize (uint32_t width, uint32_t height) |
reserves new space depending on the image layers and bitspercomponent infos More... | |
void | setSize (Sizei size) |
reserves new space depending on the image layers and bitspercomponent infos More... | |
uint32_t | getBufferSize () |
get bytes size of underlying storage | |
void * | data () |
never use this accessor to delete the underlying data ! | |
const void * | data () const |
never use this accessor to delete the underlying data ! | |
SRef< Image > | extractRegion (Rectanglei region) |
extracts a subregion for tiling for interleaved data representation only More... | |
SRef< Image > | extractRegion (Rectanglei region, uint32_t channel) |
extracts a subregion for tiling for a single plane inside a multiplanar image More... | |
enum ImageLayout | getImageLayout () const |
returns the image layout | |
enum PixelOrder | getPixelOrder () const |
returns the pixel order | |
enum DataType | getDataType () const |
returns the dataType | |
uint32_t | getNbChannels () const |
returns the number of channels | |
uint32_t | getNbBitsPerComponent () const |
returns the amount of bit per component | |
Sizei | getSize () const |
returns the size of the image | |
uint32_t | getWidth () const |
returns height of the image | |
uint32_t | getHeight () const |
returns height of the image | |
uint32_t | getStep () const |
void | setImageEncoding (enum ImageEncoding encoding) |
set encoding for the image | |
enum ImageEncoding | getImageEncoding () const |
returns encoding of the image | |
void | setImageEncodingQuality (uint8_t encodingQuality) |
set encoding quality for the image Must be set between 100 and 0: 100 for loseless compression, 0 to low quality and high compression rate | |
uint8_t | getImageEncodingQuality () const |
returns encoding quality of the image | |
template<typename T > | |
T & | getPixel (int row, int col) |
Get pixel value. More... | |
template<typename T > | |
const T & | getPixel (int row, int col) const |
Get pixel value. More... | |
FrameworkReturnCode | save (std::string imagePath) const |
Save the image in a file. More... | |
FrameworkReturnCode | load (std::string imagePath) |
Load an image from a file. More... | |
Protected Member Functions | |
template<class Archive > | |
void | save (Archive &ar, const unsigned int version) const |
template<class Archive > | |
void | load (Archive &ar, const unsigned int version) |
Friends | |
class | boost::serialization::access |
A 2D image..
This class provides an image abstraction for SolAR
SolAR::datastructure::Image::Image | ( | enum ImageLayout | pixLayout, |
enum PixelOrder | pixOrder, | ||
DataType | type | ||
) |
pixLayout | defined by ImageLayout |
pixOrder | defined if the data are stored interleaved RGB,RGB or as a planar representation RRR,GGG,BBB |
type | defined by DataType |
SolAR::datastructure::Image::Image | ( | uint32_t | width, |
uint32_t | height, | ||
enum ImageLayout | pixLayout, | ||
enum PixelOrder | pixOrder, | ||
DataType | type | ||
) |
width | width of the image |
height | height of the image |
pixLayout | defined by ImageLayout |
pixOrder | defined if the data are stored interleaved RGB,RGB or as a planar representation RRR,GGG,BBB |
type | defined by DataType |
SolAR::datastructure::Image::Image | ( | void * | imageData, |
uint32_t | width, | ||
uint32_t | height, | ||
enum ImageLayout | pixLayout, | ||
enum PixelOrder | pixOrder, | ||
DataType | type, | ||
ImageEncoding | encoding = ENCODING_NONE |
||
) |
Image built from a raw data pointer.
imageData | pointer to the raw data |
width | width of the image |
height | height of the image |
pixLayout | defined by ImageLayout |
pixOrder | defined if the data are stored interleaved RGB,RGB or as a planar representation RRR,GGG,BBB |
type | defined by DataType |
encoding | image encoding (PNG, JPG or NONE by default) |
SRef< Image > SolAR::datastructure::Image::copy | ( | ) | const |
SRef< Image > SolAR::datastructure::Image::extractRegion | ( | Rectanglei | region | ) |
extracts a subregion for tiling for interleaved data representation only
region | defines the region to extract as a rectangle |
channel | assumes planar representation of the image |
SRef< Image > SolAR::datastructure::Image::extractRegion | ( | Rectanglei | region, |
uint32_t | channel | ||
) |
extracts a subregion for tiling for a single plane inside a multiplanar image
region | defines the regoion to extract as a rectangle |
channel | assumes planar representation of the image |
|
inline |
Get pixel value.
[in] | row | row index. |
[in] | col | column index. |
|
inline |
Get pixel value.
[in] | row | row index. |
[in] | col | column index. |
FrameworkReturnCode SolAR::datastructure::Image::load | ( | std::string | imagePath | ) |
Load an image from a file.
[in] | imagePath | path to the file with suffix .jpg, .jpeg or .png. |
FrameworkReturnCode SolAR::datastructure::Image::save | ( | std::string | imagePath | ) | const |
Save the image in a file.
[in] | imagePath | path to the file with suffix .jpg, .jpeg or .png. |
void SolAR::datastructure::Image::setSize | ( | Sizei | size | ) |
reserves new space depending on the image layers and bitspercomponent infos
Size | size of the image |
void SolAR::datastructure::Image::setSize | ( | uint32_t | width, |
uint32_t | height | ||
) |
reserves new space depending on the image layers and bitspercomponent infos
width | width of the image |
height | height of the image |