All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GlfImage Class Referenceabstract

A base class for reading and writing texture image data. More...

Inherits noncopyable.

Classes

class  StorageSpec
 Describes the memory layout and storage of a texture image. More...
 

Public Types

enum  ImageOriginLocation { OriginUpperLeft, OriginLowerLeft }
 Specifies whether to treat the image origin as the upper-left corner or the lower left. More...
 

Static Public Member Functions

static GLF_API bool IsSupportedImageFile (std::string const &filename)
 Returns whether filename opened as a texture image. More...
 

Reading

{@

virtual bool Read (StorageSpec const &storage)=0
 Reads the image file into storage. More...
 
virtual bool ReadCropped (int const cropTop, int const cropBottom, int const cropLeft, int const cropRight, StorageSpec const &storage)=0
 Reads the cropped sub-image into storage. More...
 
static GLF_API GlfImageSharedPtr OpenForReading (std::string const &filename, int subimage=0, int mip=0, bool suppressErrors=false)
 Opens filename for reading from the given subimage. More...
 

Writing

}@

{@

virtual bool Write (StorageSpec const &storage, VtDictionary const &metadata=VtDictionary())=0
 Writes the image with metadata. More...
 
virtual std::string const & GetFilename () const =0
 }@ More...
 
virtual int GetWidth () const =0
 Returns the image width. More...
 
virtual int GetHeight () const =0
 Returns the image height. More...
 
virtual GLenum GetFormat () const =0
 Returns the image format. More...
 
virtual GLenum GetType () const =0
 Returns the image type. More...
 
virtual int GetBytesPerPixel () const =0
 Returns the number of bytes per pixel. More...
 
virtual int GetNumMipLevels () const =0
 Returns the number of mips available. More...
 
virtual bool IsColorSpaceSRGB () const =0
 Returns whether the iamge is in the sRGB color space. More...
 
static GLF_API GlfImageSharedPtr OpenForWriting (std::string const &filename)
 Opens filename for writing from the given storage. More...
 

Metadata

{@

template<typename T >
bool GetMetadata (TfToken const &key, T *value) const
 
virtual bool GetMetadata (TfToken const &key, VtValue *value) const =0
 
template<typename T >
bool GetSamplerMetadata (GLenum pname, T *param) const
 
virtual bool GetSamplerMetadata (GLenum pname, VtValue *param) const =0
 
virtual bool _OpenForReading (std::string const &filename, int subimage, int mip, bool suppressErrors)=0
 }@ More...
 
virtual bool _OpenForWriting (std::string const &filename)=0
 

Detailed Description

A base class for reading and writing texture image data.

The class allows basic access to texture image file data.

Definition at line 54 of file image.h.

Member Enumeration Documentation

Specifies whether to treat the image origin as the upper-left corner or the lower left.

Definition at line 60 of file image.h.

Member Function Documentation

virtual bool _OpenForReading ( std::string const &  filename,
int  subimage,
int  mip,
bool  suppressErrors 
)
protectedpure virtual

}@

virtual int GetBytesPerPixel ( ) const
pure virtual

Returns the number of bytes per pixel.

virtual std::string const& GetFilename ( ) const
pure virtual

}@

Returns the image filename.

virtual GLenum GetFormat ( ) const
pure virtual

Returns the image format.

virtual int GetHeight ( ) const
pure virtual

Returns the image height.

virtual int GetNumMipLevels ( ) const
pure virtual

Returns the number of mips available.

virtual GLenum GetType ( ) const
pure virtual

Returns the image type.

virtual int GetWidth ( ) const
pure virtual

Returns the image width.

virtual bool IsColorSpaceSRGB ( ) const
pure virtual

Returns whether the iamge is in the sRGB color space.

static GLF_API bool IsSupportedImageFile ( std::string const &  filename)
static

Returns whether filename opened as a texture image.

static GLF_API GlfImageSharedPtr OpenForReading ( std::string const &  filename,
int  subimage = 0,
int  mip = 0,
bool  suppressErrors = false 
)
static

Opens filename for reading from the given subimage.

static GLF_API GlfImageSharedPtr OpenForWriting ( std::string const &  filename)
static

Opens filename for writing from the given storage.

virtual bool Read ( StorageSpec const &  storage)
pure virtual

Reads the image file into storage.

virtual bool ReadCropped ( int const  cropTop,
int const  cropBottom,
int const  cropLeft,
int const  cropRight,
StorageSpec const &  storage 
)
pure virtual

Reads the cropped sub-image into storage.

virtual bool Write ( StorageSpec const &  storage,
VtDictionary const &  metadata = VtDictionary() 
)
pure virtual

Writes the image with metadata.


The documentation for this class was generated from the following file: