TrinityCore
|
#include <ImageFormat.h>
Classes | |
class | BayerAlgorithm |
Public Member Functions | |
const std::string & | name () const |
bool | canInterpretAs (const ImageFormat *otherFormat) const |
bool | representableAsColor1unorm8 () const |
bool | representableAsColor2unorm8 () const |
bool | representableAsColor3unorm8 () const |
bool | representableAsColor4unorm8 () const |
Color4 | channelMask () const |
bool | isIntegerFormat () const |
bool | sameComponents (const ImageFormat *other) const |
Public Attributes | |
int | numComponents |
bool | compressed |
Code | code |
ColorSpace | colorSpace |
BayerPattern | bayerPattern |
int | openGLFormat |
int | openGLBaseFormat |
int | luminanceBits |
int | alphaBits |
int | redBits |
int | greenBits |
int | blueBits |
int | stencilBits |
int | depthBits |
int | cpuBitsPerPixel |
int | openGLBitsPerPixel |
int | openGLDataFormat |
bool | opaque |
bool | floatingPoint |
NumberFormat | numberFormat |
Private Member Functions | |
ImageFormat (int numComponents, bool compressed, int glFormat, int glBaseFormat, int luminanceBits, int alphaBits, int redBits, int greenBits, int blueBits, int depthBits, int stencilBits, int openGLBitsPerPixel, int cpuBitsPerPixel, int glDataFormat, bool opaque, NumberFormat numberFormat, Code code, ColorSpace colorSpace, BayerPattern bayerPattern=BAYER_PATTERN_NONE) | |
Information about common image formats. Don't construct these; use the methods provided to access the const instances.
For most formats, the number indicates the number of bits per channel and a suffix of "F" indicates floating point (following OpenGL conventions). This does not hold for the YUV and DXT formats.
|
private |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |
bool G3D::ImageFormat::canInterpretAs | ( | const ImageFormat * | otherFormat | ) | const |
True if data in otherFormat is binary compatible
Color4 G3D::ImageFormat::channelMask | ( | ) | const |
Returns a Color4 that masks off unused components in the format, given in RGBA For example, the mask for R32F is (1,0,0,0), for A32F is (0,0,0,1), for RGB32F is (1,1,1,0). (Note that luminance is interpreted as using only the R channel, even though RGB would make more sense to me...)
|
static |
Checks if a conversion between two formats is available.
|
static |
Converts between arbitrary formats on the CPU. Not all format conversions are supported or directly supported. Formats without direct conversions will attempt to convert through RGBA first.
A conversion routine might only support source or destination padding or y inversion or none. If support is needed and not available in any of the direct conversion routines, then no conversion is done.
YUV422 expects data in YUY2 format (Y, U, Y2, v). Most YUV formats require width and heights that are multiples of 2.
Returns true if a conversion was available, false if none occurred.
|
static |
Returns DEPTH16, DEPTH24, or DEPTH32 according to the bits specified. You can use "glGetInteger(GL_DEPTH_BITS)" to match the screen's format.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns the matching ImageFormat* identified by the Code. May return NULL if this format's code is reserved but not yet implemented by G3D.
|
static |
Takes the same values that name() returns
|
static |
Returns ImageFormat representing the same channels as otherFormat plus an alpha channel, all with at least the same precision as otherFormat, or returns NULL if an equivalent format is unavailable. Will return itself if already contains an alpha channel.
|
static |
|
inline |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const std::string & G3D::ImageFormat::name | ( | ) | const |
Human readable name of this format.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool G3D::ImageFormat::representableAsColor1unorm8 | ( | ) | const |
Does this contain exactly one unorm8 component?
bool G3D::ImageFormat::representableAsColor2unorm8 | ( | ) | const |
Does this contain exactly two unorm8 components?
bool G3D::ImageFormat::representableAsColor3unorm8 | ( | ) | const |
Does this contain exactly three unorm8 components?
bool G3D::ImageFormat::representableAsColor4unorm8 | ( | ) | const |
Does this contain exactly four unorm8 components?
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool G3D::ImageFormat::sameComponents | ( | const ImageFormat * | other | ) | const |
Returns true if these formats have the same components (possibly in different NumberFormats or sizes)
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns STENCIL1, STENCIL4, STENCIL8 or STENCIL16 according to the bits specified. You can use "glGetInteger(GL_STENCIL_BITS)" to match the screen's format.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int G3D::ImageFormat::alphaBits |
Number of bits per pixel storage for alpha values; Zero for compressed textures and non-RGB.
BayerPattern G3D::ImageFormat::bayerPattern |
If this is a Bayer format, what is the pattern.
int G3D::ImageFormat::blueBits |
Number of bits per pixel storage for blue values; Zero for compressed textures and non-RGB.
Code G3D::ImageFormat::code |
Useful for serializing.
ColorSpace G3D::ImageFormat::colorSpace |
bool G3D::ImageFormat::compressed |
int G3D::ImageFormat::cpuBitsPerPixel |
Amount of CPU memory per pixel when packed into an array, discounting any end-of-row padding.
int G3D::ImageFormat::depthBits |
Number of depth bits (for depth textures; e.g. shadow maps)
bool G3D::ImageFormat::floatingPoint |
True if the bit depths specified are for float formats. TODO: Remove, replace with function keying off numberFormat
int G3D::ImageFormat::greenBits |
Number of bits per pixel storage for green values; Zero for compressed textures and non-RGB.
int G3D::ImageFormat::luminanceBits |
NumberFormat G3D::ImageFormat::numberFormat |
Indicates whether this format treats numbers as integers, floating point, or normalized fixed point
int G3D::ImageFormat::numComponents |
Number of channels (1 for a depth texture).
bool G3D::ImageFormat::opaque |
True if there is no alpha channel for this texture.
int G3D::ImageFormat::openGLBaseFormat |
The OpenGL base format equivalent to this one (e.g., GL_RGB, GL_ALPHA). Zero if there is no equivalent.
int G3D::ImageFormat::openGLBitsPerPixel |
Amount of GPU memory per pixel on most graphics cards, for formats supported by OpenGL. This is only an estimate–the actual amount of memory may be different on your actual card.
This may be greater than the sum of the per-channel bits because graphics cards need to pad to the nearest 1, 2, or 4 bytes.
int G3D::ImageFormat::openGLDataFormat |
The OpenGL bytes (type) format of the data buffer used with this texture format, e.g., GL_UNSIGNED_BYTE
int G3D::ImageFormat::openGLFormat |
The OpenGL format equivalent to this one, e.g, GL_RGB8 Zero if there is no equivalent. This is actually a GLenum
int G3D::ImageFormat::redBits |
Number of bits per pixel storage for red values; Zero for compressed textures and non-RGB.
int G3D::ImageFormat::stencilBits |
Number of bits per pixel