Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

openvrml::img Class Reference

Image data. More...

Collaboration diagram for openvrml::img:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 img ()
 Construct.

 ~img ()
 Destroy.

bool set_url (const char *url, const doc2 *relative=0)
bool try_urls (const std::vector< std::string > &urls, const doc2 *relative=0)
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.

unsigned char * pixels () const
 Pixel data.

unsigned char * pixels (size_t frame) const
 The pixel data for a frrame of the currently loaded image.

void resize (size_t w, size_t h)
 Resize the image.


Private Attributes

docurl_
 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.


Detailed Description

Image data.


Member Function Documentation

size_t openvrml::img::h  )  const [inline]
 

Image height.

Returns:
the image height.

size_t openvrml::img::nc  )  const [inline]
 

Number of components.

Returns:
the number of components.

size_t openvrml::img::nframes  )  const [inline]
 

Number of frames.

Returns:
the number of frames.

unsigned char * openvrml::img::pixels size_t  frame  )  const
 

The pixel data for a frrame of the currently loaded image.

Parameters:
frame the frame of interest.
Returns:
the pixel data for a frame of the currently loaded image; or 0 if frame is not valid.

unsigned char * openvrml::img::pixels  )  const [inline]
 

Pixel data.

Returns:
the pixel data.

void openvrml::img::resize size_t  w,
size_t  h
[inline]
 

Resize the image.

This method simply resets the width and height attributes. It does not rescale the image or even reallocate the pixel data.

Parameters:
w new width.
h new height.

const char * openvrml::img::url  )  const
 

The URI of the currently loaded image.

Returns:
the URI of the currently loaded image; or 0 if no image is loaded.

size_t openvrml::img::w  )  const [inline]
 

Image width.

Returns:
the image width.