|
Graphite Version 3
An experimental 3D geometry processing program
|
An image. More...
#include <geogram/image/image.h>
Public Types | |
| enum | ColorEncoding { GRAY , INDEXED , RGB , BGR , RGBA , YUV } |
| Indicates how colors are encoded within the image. More... | |
| enum | ComponentEncoding { BYTE , INT16 , INT32 , FLOAT32 , FLOAT64 } |
| Indicates the datatype used to encode each component of the colors. More... | |
Public Member Functions | |
| Image () | |
| Image constructor. | |
| Image (ColorEncoding color_rep, ComponentEncoding component_rep, index_t width, index_t height=1, index_t depth=1) | |
| Image constructor. | |
| ~Image () override | |
| Image destructor. | |
| virtual void | acquire () |
| Some implementations get the image from some sources. Default implementation does nothing. | |
| index_t | dimension () const |
| Gets the dimension of the image. | |
| index_t | size (index_t axis) const |
| Gets the size of the image along one of the axes. | |
| index_t | width () const |
| Gets the width of the image. | |
| index_t | height () const |
| Gets the height of the image. | |
| index_t | depth () const |
| Gets the depth of the image. | |
| size_t | bytes_per_pixel () const |
| Gets the number of bytes per pixel. | |
| size_t | components_per_pixel () const |
| Gets the number of components per pixel. | |
| size_t | nb_pixels () const |
| Gets the number of pixels. | |
| size_t | bytes () const |
| Gets the number of bytes. | |
| ComponentEncoding | component_encoding () const |
| Gets the ComponentEncoding. | |
| ColorEncoding | color_encoding () const |
| Gets the ColorEncoding. | |
| const Colormap * | colormap () const |
| Gets the Colormap. | |
| Colormap * | colormap () |
| Gets the Colormap. | |
| void | set_colormap (Colormap *colormap) |
| Sets the Colormap. | |
| Memory::pointer | base_mem () const |
| Gets the base memory. | |
| Memory::byte * | base_mem_byte_ptr () const |
| Gets the base memory as a byte pointer. | |
| Numeric::int16 * | base_mem_int16_ptr () const |
| Gets the base memory as a 16 bits integer pointer. | |
| Numeric::int32 * | base_mem_int32_ptr () const |
| Gets the base memory as a 32 bits integer pointer. | |
| Numeric::float32 * | base_mem_float32_ptr () const |
| Gets the base memory as a 32 bits floating point pointer. | |
| Numeric::float64 * | base_mem_float64_ptr () const |
| Gets the base memory as a 64 bits floating point pointer. | |
| Memory::pointer | pixel_base (index_t x) |
| Gets the address of a pixel in a 1D image. | |
| Memory::byte * | pixel_base_byte_ptr (index_t x) |
| Gets the address of a pixel in a 1D image as a byte pointer. | |
| Numeric::int16 * | pixel_base_int16_ptr (index_t x) |
| Gets the address of a pixel in a 1D image as a int16 pointer. | |
| Numeric::int32 * | pixel_base_int32_ptr (index_t x) |
| Gets the address of a pixel in a 1D image as a int32 pointer. | |
| Numeric::float32 * | pixel_base_float32_ptr (index_t x) |
| Gets the address of a pixel in a 1D image as a float32 pointer. | |
| Numeric::float64 * | pixel_base_float64_ptr (index_t x) |
| Gets the address of a pixel in a 1D image as a float64 pointer. | |
| Memory::pointer | pixel_base (index_t x, index_t y) |
| Gets the address of a pixel in a 2D image. | |
| Memory::byte * | pixel_base_byte_ptr (index_t x, index_t y) |
| Gets the address of a pixel in a 2D image as a byte pointer. | |
| Numeric::int16 * | pixel_base_int16_ptr (index_t x, index_t y) |
| Gets the address of a pixel in a 2D image as an int16 pointer. | |
| Numeric::int32 * | pixel_base_int32_ptr (index_t x, index_t y) |
| Gets the address of a pixel in a 2D image as an int32 pointer. | |
| Numeric::float32 * | pixel_base_float32_ptr (index_t x, index_t y) |
| Gets the address of a pixel in a 2D image as a float32 pointer. | |
| Numeric::float64 * | pixel_base_float64_ptr (index_t x, index_t y) |
| Gets the address of a pixel in a 2D image as a float64 pointer. | |
| Memory::pointer | pixel_base (index_t x, index_t y, index_t z) |
| Gets the address of a pixel in a 3D image. | |
| Memory::byte * | pixel_base_byte_ptr (index_t x, index_t y, index_t z) |
| Gets the address of a pixel in a 3D image as a byte pointer. | |
| Numeric::int16 * | pixel_base_int16_ptr (index_t x, index_t y, index_t z) |
| Gets the address of a pixel in a 3D image as an int16 pointer. | |
| Numeric::int32 * | pixel_base_int32_ptr (index_t x, index_t y, index_t z) |
| Gets the address of a pixel in a 3D image as an int32 pointer. | |
| Numeric::float32 * | pixel_base_float32_ptr (index_t x, index_t y, index_t z) |
| Gets the address of a pixel in a 3D image as a float32 pointer. | |
| Numeric::float64 * | pixel_base_float64_ptr (index_t x, index_t y, index_t z) |
| Gets the address of a pixel in a 3D image as a float64 pointer. | |
| Memory::byte * | byte_ptr (Memory::pointer ptr) const |
| Converts an untyped pointer into a byte pointer. | |
| Numeric::int16 * | int16_ptr (Memory::pointer ptr) const |
| Converts an untyped pointer into a 16 bits integer pointer. | |
| Numeric::int32 * | int32_ptr (Memory::pointer ptr) const |
| Converts an untyped pointer into a 32 bits integer pointer. | |
| Numeric::float32 * | float32_ptr (Memory::pointer ptr) const |
| Converts an untyped pointer into a 32 bits floating point pointer. | |
| Numeric::float64 * | float64_ptr (Memory::pointer ptr) const |
| Converts an untyped pointer into a 64 bits floating point pointer. | |
| void | flip_vertically () |
| Flips this image along the y axis. | |
| void | swap_components (index_t channel1, index_t channel2) |
| Swaps two color components of this image. | |
| void | initialize (ColorEncoding color_rep, ComponentEncoding component_rep, index_t size_x, index_t size_y=1, index_t size_z=1) |
| Creates storage for the specified encoding and image dimensions. | |
Public Member Functions inherited from GEO::Counted | |
| void | ref () const |
| Increments the reference count. | |
| void | unref () const |
| Decrements the reference count. | |
| bool | is_shared () const |
| Check if the object is shared. | |
| int | nb_refs () const |
| Gets the number of references that point to this object. | |
Static Public Member Functions | |
| static size_t | nb_components (ColorEncoding color_rep) |
| Gets the number of components associated with a ColorEncoding. | |
| static size_t | bytes_per_component (ComponentEncoding component_rep) |
| Gets the number of bytes used by a ComponentEncoding. | |
Static Public Member Functions inherited from GEO::Counted | |
| static void | ref (const Counted *counted) |
| Increments the reference count. | |
| static void | unref (const Counted *counted) |
| Decrements the reference count. | |
Protected Attributes | |
| ColorEncoding | color_encoding_ |
| ComponentEncoding | component_encoding_ |
| Colormap_var | colormap_ |
| size_t | factor_ [3] |
| Memory::pointer | base_mem_ |
| index_t | dimension_ |
| index_t | size_ [3] |
| size_t | bytes_per_pixel_ |
Additional Inherited Members | |
Protected Member Functions inherited from GEO::Counted | |
| Counted () | |
| Creates a reference counted object. | |
| virtual | ~Counted () |
| Destroys a reference counted object. | |
|
inline |
|
virtual |
Some implementations get the image from some sources. Default implementation does nothing.
There is a derived class to access the webcam for instance.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Converts an untyped pointer into a byte pointer.
| [in] | ptr | the pointer to be converted |
ptr converted to a byte pointer
|
inline |
|
static |
Gets the number of bytes used by a ComponentEncoding.
| [in] | component_rep | the ComponentEncoding |
component_rep
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Converts an untyped pointer into a 32 bits floating point pointer.
| [in] | ptr | the pointer to be converted |
ptr converted to a 32 bits floating point pointer
|
inline |
Converts an untyped pointer into a 64 bits floating point pointer.
| [in] | ptr | the pointer to be converted |
ptr converted to a 64 bits floating point pointer
|
inline |
| void GEO::Image::initialize | ( | ColorEncoding | color_rep, |
| ComponentEncoding | component_rep, | ||
| index_t | size_x, | ||
| index_t | size_y = 1, |
||
| index_t | size_z = 1 |
||
| ) |
Creates storage for the specified encoding and image dimensions.
| [in] | color_rep | the ColorEncoding |
| [in] | component_rep | the ComponentEncoding |
| [in] | size_x | the image width |
| [in] | size_y | the image height, or 1 for 1D images |
| [in] | size_z | the image depth for 3D images, or 1 for 1D and 2D images |
|
inline |
Converts an untyped pointer into a 16 bits integer pointer.
| [in] | ptr | the pointer to be converted |
ptr converted to a 16 bits integer pointer
|
inline |
Converts an untyped pointer into a 32 bits integer pointer.
| [in] | ptr | the pointer to be converted |
ptr converted to a 32 bits integer pointer
|
static |
Gets the number of components associated with a ColorEncoding.
| [in] | color_rep | the ColorEncoding |
color_rep
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Gets the address of a pixel in a 2D image as a byte pointer.
| [in] | x,y | the coordinates of the pixel |
|
inline |
Gets the address of a pixel in a 3D image as a byte pointer.
| [in] | x,y,z | the coordinates of the pixel |
|
inline |
|
inline |
Gets the address of a pixel in a 2D image as a float32 pointer.
| [in] | x,y | the coordinates of the pixel |
|
inline |
Gets the address of a pixel in a 3D image as a float32 pointer.
| [in] | x,y,z | the coordinates of the pixel |
|
inline |
|
inline |
Gets the address of a pixel in a 2D image as a float64 pointer.
| [in] | x,y | the coordinates of the pixel |
|
inline |
Gets the address of a pixel in a 3D image as a float64 pointer.
| [in] | x,y,z | the coordinates of the pixel |
|
inline |
|
inline |
Gets the address of a pixel in a 2D image as an int16 pointer.
| [in] | x,y | the coordinates of the pixel |
|
inline |
Gets the address of a pixel in a 3D image as an int16 pointer.
| [in] | x,y,z | the coordinates of the pixel |
|
inline |
|
inline |
Gets the address of a pixel in a 2D image as an int32 pointer.
| [in] | x,y | the coordinates of the pixel |
|
inline |
Gets the address of a pixel in a 3D image as an int32 pointer.
| [in] | x,y,z | the coordinates of the pixel |
|
inline |
Swaps two color components of this image.
| [in] | channel1,channel2 | the two channels to be swapped |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |