|
HDK
|
#include <image.h>
Classes | |
| class | StorageSpec |
Public Types | |
| enum | ImageOriginLocation { OriginUpperLeft, OriginLowerLeft } |
| enum | SourceColorSpace { Raw, SRGB, Auto } |
Public Member Functions | |
| HioImage ()=default | |
| virtual HIO_API | ~HioImage () |
| HioImage (const HioImage &)=delete | |
| HioImage & | operator= (const HioImage &)=delete |
Static Public Member Functions | |
| static HIO_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 HIO_API HioImageSharedPtr | OpenForReading (std::string const &filename, int subimage=0, int mip=0, SourceColorSpace sourceColorSpace=SourceColorSpace::Auto, bool suppressErrors=false) |
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 HioFormat | GetFormat () const =0 |
| Returns the destination HioFormat. 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 image is in the sRGB color space. More... | |
| static HIO_API HioImageSharedPtr | 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 |
| }@ More... | |
| virtual bool | GetMetadata (TfToken const &key, VtValue *value) const =0 |
| }@ More... | |
| virtual bool | GetSamplerMetadata (HioAddressDimension dim, HioAddressMode *param) const =0 |
| }@ More... | |
| virtual bool | _OpenForReading (std::string const &filename, int subimage, int mip, SourceColorSpace sourceColorSpace, bool suppressErrors)=0 |
| }@ More... | |
| virtual bool | _OpenForWriting (std::string const &filename)=0 |
| }@ More... | |
A base class for reading and writing texture image data.
The class allows basic access to texture image file data.
Texture paths are UTF-8 strings, resolvable by AR. Texture system dispatch is driven by extension, with [A-Z] (and no other characters) case folded.
|
default |
|
virtual |
|
delete |
|
protectedpure virtual |
}@
|
protectedpure virtual |
}@
|
pure virtual |
Returns the number of bytes per pixel.
|
pure virtual |
}@
Returns the image filename.
|
pure virtual |
Returns the destination HioFormat.
|
pure virtual |
Returns the image height.
|
pure virtual |
Returns the number of mips available.
|
pure virtual |
}@
|
pure virtual |
Returns the image width.
|
pure virtual |
Returns whether the image is in the sRGB color space.
|
static |
Returns whether filename opened as a texture image.
|
static |
Opens filename for reading from the given subimage at mip level mip, using sourceColorSpace to help determine the color space with which to interpret the texture
|
static |
Opens filename for writing from the given storage.
|
pure virtual |
Reads the image file into storage.
|
pure virtual |
Reads the cropped sub-image into storage.
|
pure virtual |
Writes the image with metadata.