ContRap-Libraries
|
Defines an interface for raw ContRap images. More...
#include <rawimage.h>
Public Member Functions | |
RawImage () | |
Empty constructor. | |
RawImage (int width, int height, int element_size=0, int codec=CODEC_UNDEFINED) | |
Constructs a new image. | |
RawImage (const RawImage &image) | |
Copy constructor. | |
virtual | ~RawImage () |
Destructor clears memory. | |
virtual Object * | clone () |
Returns a pointer to a semantical copy of the current object. | |
virtual std::string | get_type_name () const |
Returns the type name of the object. | |
void | resize (int width, int height, int element_size=1, int codec=CODEC_UNDEFINED) |
Resizes the image. | |
void | set_data (unsigned char *data, int width=-1, int height=-1, int element_size=1, int codec=CODEC_UNDEFINED) |
Set data. | |
int | get_element_size () const |
Returns the element size of the image data field. | |
unsigned char * | operator() (int x, int y) |
Accesses an element of the image. | |
RawPixel | get_pixel (int x, int y) |
Returns a raw pixel from the image. | |
void | set_codec (int codec) |
Sets the codec for this image. | |
int | get_codec () const |
Returns the codec for this image. | |
virtual std::string | to_string () const |
Converts the object to a non-formatted string. | |
Protected Attributes | |
int | element_size |
Element size of the data. | |
int | codec |
Codec. |
Defines an interface for raw ContRap images.
crp::RawImage::RawImage | ( | ) | [inline] |
Empty constructor.
crp::RawImage::RawImage | ( | int | width, |
int | height, | ||
int | element_size = 0 , |
||
int | codec = CODEC_UNDEFINED |
||
) | [inline] |
Constructs a new image.
width | Width of the image |
height | Height of the image |
element_size | Size of a single element |
codec | Codec of the image |
crp::RawImage::RawImage | ( | const RawImage & | image | ) | [inline] |
Copy constructor.
virtual crp::RawImage::~RawImage | ( | ) | [inline, virtual] |
Destructor clears memory.
virtual Object* crp::RawImage::clone | ( | ) | [inline, virtual] |
Returns a pointer to a semantical copy of the current object.
Reimplemented from crp::Array< unsigned char >.
int crp::RawImage::get_codec | ( | ) | const [inline] |
Returns the codec for this image.
int crp::RawImage::get_element_size | ( | ) | const [inline] |
Returns the element size of the image data field.
RawPixel crp::RawImage::get_pixel | ( | int | x, |
int | y | ||
) | [inline] |
virtual std::string crp::RawImage::get_type_name | ( | ) | const [inline, virtual] |
Returns the type name of the object.
unsigned char* crp::RawImage::operator() | ( | int | x, |
int | y | ||
) | [inline] |
Accesses an element of the image.
x | X-Coordinate of the pixel |
y | Y-Coordinate of the pixel |
Reimplemented from crp::Array< unsigned char >.
void crp::RawImage::resize | ( | int | width, |
int | height, | ||
int | element_size = 1 , |
||
int | codec = CODEC_UNDEFINED |
||
) | [inline] |
Resizes the image.
width | New image width |
height | New image height |
element_size | Size of one element |
codec | Codec for the image |
void crp::RawImage::set_codec | ( | int | codec | ) | [inline] |
Sets the codec for this image.
codec | New codec |
void crp::RawImage::set_data | ( | unsigned char * | data, |
int | width = -1 , |
||
int | height = -1 , |
||
int | element_size = 1 , |
||
int | codec = CODEC_UNDEFINED |
||
) | [inline] |
Set data.
data | New data |
width | New width (should match data) |
height | New height (should match data) |
element_size | Size of an element |
codec | Codec for the image |
virtual std::string crp::RawImage::to_string | ( | ) | const [inline, virtual] |
Converts the object to a non-formatted string.
This method is thought to be used for debugging purposes only.
Reimplemented from crp::Array< unsigned char >.
int crp::RawImage::codec [protected] |
Codec.
int crp::RawImage::element_size [protected] |
Element size of the data.