HDK
|
#include <Image.h>
Public Types | |
enum | BaseType { BaseType::UINT8, BaseType::INT8, BaseType::UINT16, BaseType::INT16, BaseType::HALF, BaseType::FLOAT } |
Public Member Functions | |
~Image () | |
IMFUTIL_EXPORT | Image () |
virtual IMFUTIL_EXPORT | ~Image () |
IMFUTIL_EXPORT LevelMode | levelMode () const |
IMFUTIL_EXPORT LevelRoundingMode | levelRoundingMode () const |
IMFUTIL_EXPORT int | numLevels () const |
IMFUTIL_EXPORT int | numXLevels () const |
IMFUTIL_EXPORT int | numYLevels () const |
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i & | dataWindow () const |
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i & | dataWindowForLevel (int l) const |
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i & | dataWindowForLevel (int lx, int ly) const |
IMFUTIL_EXPORT int | levelWidth (int lx) const |
IMFUTIL_EXPORT int | levelHeight (int ly) const |
IMFUTIL_EXPORT void | resize (const IMATH_NAMESPACE::Box2i &dataWindow) |
virtual IMFUTIL_EXPORT void | resize (const IMATH_NAMESPACE::Box2i &dataWindow, LevelMode levelMode, LevelRoundingMode levelRoundingMode) |
IMFUTIL_EXPORT void | shiftPixels (int dx, int dy) |
IMFUTIL_EXPORT void | insertChannel (const std::string &name, PixelType type, int xSampling=1, int ySampling=1, bool pLinear=false) |
IMFUTIL_EXPORT void | insertChannel (const std::string &name, const Channel &channel) |
IMFUTIL_EXPORT void | eraseChannel (const std::string &name) |
IMFUTIL_EXPORT void | clearChannels () |
IMFUTIL_EXPORT void | renameChannel (const std::string &oldName, const std::string &newName) |
IMFUTIL_EXPORT void | renameChannels (const RenamingMap &oldToNewNames) |
virtual IMFUTIL_EXPORT ImageLevel & | level (int l=0) |
virtual IMFUTIL_EXPORT const ImageLevel & | level (int l=0) const |
virtual IMFUTIL_EXPORT ImageLevel & | level (int lx, int ly) |
virtual IMFUTIL_EXPORT const ImageLevel & | level (int lx, int ly) const |
Property Accessors | |
unsigned int | getWidth () const |
Return the width of the image. More... | |
unsigned int | getHeight () const |
Return the height of the image. More... | |
unsigned int | getChannelCount () const |
Return the channel count of the image. More... | |
BaseType | getBaseType () const |
Return the base type of the image. More... | |
unsigned int | getBaseStride () const |
Return the stride of our base type in bytes. More... | |
unsigned int | getRowStride () const |
Return the stride of an image row in bytes. More... | |
unsigned int | getMaxMipCount () const |
Return the maximum number of mipmaps for this image. More... | |
Texel Accessors | |
void | setTexelColor (unsigned int x, unsigned int y, const Color4 &color) |
Color4 | getTexelColor (unsigned int x, unsigned int y) const |
Image Analysis | |
Color4 | getAverageColor () |
Compute the average color of the image. More... | |
bool | isUniformColor (Color4 *uniformColor=nullptr) |
Image Processing | |
void | setUniformColor (const Color4 &color) |
Set all texels of this image to a uniform color. More... | |
void | applyMatrixTransform (const Matrix33 &mat) |
Apply the given matrix transform to all texels of this image. More... | |
void | applyGammaTransform (float gamma) |
Apply the given gamma transform to all texels of this image. More... | |
ImagePtr | copy (unsigned int channelCount, BaseType baseType) const |
Create a copy of this image with the given channel count and base type. More... | |
ImagePtr | applyBoxBlur () |
Apply a 3x3 box blur to this image, returning a new blurred image. More... | |
ImagePtr | applyGaussianBlur () |
Apply a 7x7 Gaussian blur to this image, returning a new blurred image. More... | |
ImagePair | splitByLuminance (float luminance) |
void | writeTable (const FilePath &filePath, unsigned int channel) |
Resource Buffers | |
void | setResourceBuffer (void *buffer) |
Set the resource buffer for this image. More... | |
void * | getResourceBuffer () const |
Return the resource buffer for this image. More... | |
void | createResourceBuffer () |
Allocate a resource buffer for this image that matches its properties. More... | |
void | releaseResourceBuffer () |
Release the resource buffer for this image. More... | |
void | setResourceBufferDeallocator (ImageBufferDeallocator deallocator) |
Set the resource buffer deallocator for this image. More... | |
ImageBufferDeallocator | getResourceBufferDeallocator () const |
Return the resource buffer deallocator for this image. More... | |
Resource IDs | |
void | setResourceId (unsigned int id) |
Set the resource ID for this image. More... | |
unsigned int | getResourceId () const |
Return the resource ID for this image. More... | |
Static Public Member Functions | |
static ImagePtr | create (unsigned int width, unsigned int height, unsigned int channelCount, BaseType baseType=BaseType::UINT8) |
Create an empty image with the given properties. More... | |
Protected Member Functions | |
Image (unsigned int width, unsigned int height, unsigned int channelCount, BaseType baseType) | |
virtual ImageLevel * | newLevel (int lx, int ly, const IMATH_NAMESPACE::Box2i &dataWindow)=0 |
Protected Attributes | |
unsigned int | _width |
unsigned int | _height |
unsigned int | _channelCount |
BaseType | _baseType |
void * | _resourceBuffer |
ImageBufferDeallocator | _resourceBufferDeallocator |
unsigned int | _resourceId = 0 |
|
strong |
Image::~Image | ( | ) |
|
protected |
IMFUTIL_EXPORT Image::Image | ( | ) |
|
virtual |
ImagePtr Image::applyBoxBlur | ( | ) |
Apply a 3x3 box blur to this image, returning a new blurred image.
Apply the given gamma transform to all texels of this image.
ImagePtr Image::applyGaussianBlur | ( | ) |
Apply a 7x7 Gaussian blur to this image, returning a new blurred image.
Apply the given matrix transform to all texels of this image.
IMFUTIL_EXPORT void Image::clearChannels | ( | ) |
Create a copy of this image with the given channel count and base type.
void Image::createResourceBuffer | ( | ) |
Allocate a resource buffer for this image that matches its properties.
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i& Image::dataWindow | ( | ) | const |
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i& Image::dataWindowForLevel | ( | int | l | ) | const |
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i& Image::dataWindowForLevel | ( | int | lx, |
int | ly | ||
) | const |
IMFUTIL_EXPORT void Image::eraseChannel | ( | const std::string & | name | ) |
Color4 Image::getAverageColor | ( | ) |
Compute the average color of the image.
unsigned int Image::getBaseStride | ( | ) | const |
Return the stride of our base type in bytes.
|
inline |
|
inline |
|
inline |
unsigned int Image::getMaxMipCount | ( | ) | const |
Return the maximum number of mipmaps for this image.
|
inline |
|
inline |
|
inline |
|
inline |
Return the texel color at the given coordinates. If the coordinates or image resource buffer are invalid, then an exception is thrown.
|
inline |
IMFUTIL_EXPORT void Image::insertChannel | ( | const std::string & | name, |
PixelType | type, | ||
int | xSampling = 1 , |
||
int | ySampling = 1 , |
||
bool | pLinear = false |
||
) |
IMFUTIL_EXPORT void Image::insertChannel | ( | const std::string & | name, |
const Channel & | channel | ||
) |
bool Image::isUniformColor | ( | Color4 * | uniformColor = nullptr | ) |
Return true if all texels of this image are identical in color.
uniformColor | Return the uniform color of the image, if any. |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
IMFUTIL_EXPORT int Image::levelHeight | ( | int | ly | ) | const |
IMFUTIL_EXPORT LevelMode Image::levelMode | ( | ) | const |
IMFUTIL_EXPORT LevelRoundingMode Image::levelRoundingMode | ( | ) | const |
IMFUTIL_EXPORT int Image::levelWidth | ( | int | lx | ) | const |
|
protectedpure virtual |
IMFUTIL_EXPORT int Image::numLevels | ( | ) | const |
IMFUTIL_EXPORT int Image::numXLevels | ( | ) | const |
IMFUTIL_EXPORT int Image::numYLevels | ( | ) | const |
void Image::releaseResourceBuffer | ( | ) |
Release the resource buffer for this image.
IMFUTIL_EXPORT void Image::renameChannel | ( | const std::string & | oldName, |
const std::string & | newName | ||
) |
IMFUTIL_EXPORT void Image::renameChannels | ( | const RenamingMap & | oldToNewNames | ) |
IMFUTIL_EXPORT void Image::resize | ( | const IMATH_NAMESPACE::Box2i & | dataWindow | ) |
|
virtual |
|
inline |
Set the texel color at the given coordinates. If the coordinates or image resource buffer are invalid, then an exception is thrown.
Set all texels of this image to a uniform color.
IMFUTIL_EXPORT void Image::shiftPixels | ( | int | dx, |
int | dy | ||
) |
Split this image by the given luminance threshold, returning the resulting underflow and overflow images.
Save a channel of this image to disk as a text table, in a format that can be used for curve and surface fitting.
|
protected |