Home | Download | Screen shots | Discussion | Documentation |
---|
Public Member Functions | |
img () | |
Construct. | |
~img () | |
Destroy. | |
bool | set_url (const char *url, const doc2 *relative=0) |
Load an image. | |
bool | try_urls (const std::vector< std::string > &urls, const doc2 *relative=0) |
Call img::set_url for each URI in urls until one successfully loads an image. | |
const char * | url () const |
The URI of the currently loaded image. | |
size_t | w () const |
Image width. | |
size_t | h () const |
Image height. | |
size_t | nc () const |
Number of components. | |
size_t | nframes () const |
Number of frames. | |
const unsigned char * | pixels () const |
Pixel data. | |
const unsigned char * | pixels (size_t frame) const |
The pixel data for a frrame of the currently loaded image. | |
Private Attributes | |
doc * | url_ |
Resource. | |
size_t | w_ |
Image width. | |
size_t | h_ |
Image height. | |
size_t | nc_ |
Number of components. | |
size_t | nframes_ |
Number of frames. | |
unsigned char * | pixels_ |
Pixel data. | |
unsigned char ** | frame_ |
Frame data for time-dependent images. |
openvrml::img::img | ( | ) |
Construct.
openvrml::img::~img | ( | ) |
Destroy.
bool openvrml::img::set_url | ( | const char * | url, | |
const doc2 * | relative = 0 | |||
) |
Load an image.
url | a URI. | |
relative | URI to which url is relative; or 0 if url is an absolute URI. |
true
if the image is loaded successfully; false
otherwise. bool openvrml::img::try_urls | ( | const std::vector< std::string > & | urls, | |
const doc2 * | relative = 0 | |||
) |
Call img::set_url for each URI in urls
until one successfully loads an image.
urls | URIs. | |
relative | URI to which the URIs in urls are relative; or 0 if all the URIs in urls are absolute. |
true
if an image is successfully loaded from any of the URIs in urls
; false
otherwise. const char * openvrml::img::url | ( | ) | const |
The URI of the currently loaded image.
size_t openvrml::img::w | ( | ) | const [inline] |
Image width.
size_t openvrml::img::h | ( | ) | const [inline] |
Image height.
size_t openvrml::img::nc | ( | ) | const [inline] |
Number of components.
size_t openvrml::img::nframes | ( | ) | const [inline] |
Number of frames.
const unsigned char * openvrml::img::pixels | ( | ) | const [inline] |
Pixel data.
const unsigned char * openvrml::img::pixels | ( | size_t | frame | ) | const |
The pixel data for a frrame of the currently loaded image.
frame | the frame of interest. |
frame
is not valid.
doc * openvrml::img::url_ [private] |
Resource.
size_t openvrml::img::w_ [private] |
Image width.
size_t openvrml::img::h_ [private] |
Image height.
size_t openvrml::img::nc_ [private] |
Number of components.
size_t openvrml::img::nframes_ [private] |
Number of frames.
unsigned char * openvrml::img::pixels_ [private] |
Pixel data.
unsigned char ** openvrml::img::frame_ [private] |
Frame data for time-dependent images.