#include <mipmap.h>
Classes | |
struct | ResampleWeight |
Public Member Functions | |
MIPMapImpl (ImageTextureFilterType type, int xres, int yres, const U *data, float maxAniso=8.f, ImageWrap wrapMode=TEXTURE_REPEAT, float gain=1.f, float gamma=1.0f) | |
~MIPMapImpl () | |
T | Lookup (float s, float t, float width=0.f) const |
T | Lookup (float s, float t, float ds0, float dt0, float ds1, float dt1) const |
u_int | getMemoryUsed () const |
void | discardMipmaps (int n) |
Protected Member Functions | |
const U & | texelInternal (int level, int s, int t) const |
const T | texel (int level, int s, int t) const |
const U & | texelInternal (int s, int t) const |
const T | texel (int s, int t) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< unsigned char, 1 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< unsigned char, 3 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< unsigned char, 4 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< unsigned short, 1 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< unsigned short, 3 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< unsigned short, 4 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< float, 1 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< float, 3 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const TextureColor< float, 4 > &internalValue) const |
virtual void | convert (Spectrum &outputValue, const Spectrum &internalValue) const |
template<class V , int n> | |
void | convert (float &outputValue, const TextureColor< V, n > &internalValue) const |
virtual void | convert (float &outputValue, const float internalValue) const |
Static Protected Attributes | |
static float | invMaxUnsignedChar = 1.0f / (std::numeric_limits<unsigned char>::max() - 1) |
static float | invMaxUnsignedShort = 1.0f / (std::numeric_limits<unsigned short>::max() - 1) |
Private Member Functions | |
ResampleWeight * | resampleWeights (int oldres, int newres) |
int | uSize (int level) const |
int | vSize (int level) const |
T | triangle (int level, float s, float t) const |
T | triangle (float s, float t) const |
T | nearest (float s, float t) const |
T | EWA (float s, float t, float ds0, float dt0, float ds1, float dt1, int level) const |
float | clamp (float v) |
Spectrum | clamp (const Spectrum &v) |
TextureColor< unsigned char, 1 > | clamp (const TextureColor< unsigned char, 1 > &v) |
TextureColor< unsigned char, 3 > | clamp (const TextureColor< unsigned char, 3 > &v) |
TextureColor< unsigned char, 4 > | clamp (const TextureColor< unsigned char, 4 > &v) |
TextureColor< unsigned short, 1 > | clamp (const TextureColor< unsigned short, 1 > &v) |
TextureColor< unsigned short, 3 > | clamp (const TextureColor< unsigned short, 3 > &v) |
TextureColor< unsigned short, 4 > | clamp (const TextureColor< unsigned short, 4 > &v) |
TextureColor< float, 1 > | clamp (const TextureColor< float, 1 > &v) |
TextureColor< float, 3 > | clamp (const TextureColor< float, 3 > &v) |
TextureColor< float, 4 > | clamp (const TextureColor< float, 4 > &v) |
Private Attributes | |
ImageTextureFilterType | filterType |
float | maxAnisotropy |
float | gain |
float | gamma |
ImageWrap | wrapMode |
int | nLevels |
union { | |
BlockedArray< U > ** pyramid | |
BlockedArray< U > * singleMap | |
}; | |
Static Private Attributes | |
static float * | weightLut = NULL |
Definition at line 63 of file mipmap.h.
lux::MIPMapImpl< T, U >::MIPMapImpl | ( | ImageTextureFilterType | type, | |
int | xres, | |||
int | yres, | |||
const U * | data, | |||
float | maxAniso = 8.f , |
|||
ImageWrap | wrapMode = TEXTURE_REPEAT , |
|||
float | gain = 1.f , |
|||
float | gamma = 1.0f | |||
) | [inline] |
Definition at line 452 of file mipmap.h.
References lux::AllocAligned(), lux::BILINEAR, lux::MIPMapImpl< T, U >::clamp(), Clamp(), lux::MIPMapImpl< T, U >::filterType, lux::MIPMapImpl< T, U >::MIPMapImpl::ResampleWeight::firstTexel, lux::MIPMapImpl< T, U >::gain, lux::MIPMapImpl< T, U >::gamma, IsPowerOf2(), Log2Int(), LUX_ERROR, LUX_INFO, LUX_NOERROR, LUX_SYSTEM, luxError, cimg_library::max(), lux::MIPMapImpl< T, U >::maxAnisotropy, lux::MIPMAP_EWA, lux::MIPMAP_TRILINEAR, Mod(), lux::NEAREST, lux::MIPMapImpl< T, U >::nLevels, lux::MIPMapImpl< T, U >::pyramid, lux::MIPMapImpl< T, U >::resampleWeights(), RoundUpPow2(), lux::MIPMapImpl< T, U >::singleMap, lux::MIPMapImpl< T, U >::texelInternal(), lux::TEXTURE_CLAMP, lux::TEXTURE_REPEAT, lux::MIPMapImpl< T, U >::uSize(), lux::MIPMapImpl< T, U >::vSize(), lux::MIPMapImpl< T, U >::MIPMapImpl::ResampleWeight::weight, WEIGHT_LUT_SIZE, lux::MIPMapImpl< T, U >::weightLut, and lux::MIPMapImpl< T, U >::wrapMode.
lux::MIPMapImpl< T, U >::~MIPMapImpl | ( | ) | [inline] |
Definition at line 439 of file mipmap.h.
References lux::BILINEAR, LUX_ERROR, LUX_SYSTEM, luxError, lux::MIPMAP_EWA, lux::MIPMAP_TRILINEAR, and lux::NEAREST.
TextureColor<float, 4> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< float, 4 > & | v | ) | [inline, private] |
TextureColor<float, 3> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< float, 3 > & | v | ) | [inline, private] |
TextureColor<float, 1> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< float, 1 > & | v | ) | [inline, private] |
TextureColor<unsigned short, 4> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< unsigned short, 4 > & | v | ) | [inline, private] |
TextureColor<unsigned short, 3> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< unsigned short, 3 > & | v | ) | [inline, private] |
TextureColor<unsigned short, 1> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< unsigned short, 1 > & | v | ) | [inline, private] |
TextureColor<unsigned char, 4> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< unsigned char, 4 > & | v | ) | [inline, private] |
TextureColor<unsigned char, 3> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< unsigned char, 3 > & | v | ) | [inline, private] |
TextureColor<unsigned char, 1> lux::MIPMapImpl< T, U >::clamp | ( | const TextureColor< unsigned char, 1 > & | v | ) | [inline, private] |
Spectrum lux::MIPMapImpl< T, U >::clamp | ( | const Spectrum & | v | ) | [inline, private] |
float lux::MIPMapImpl< T, U >::clamp | ( | float | v | ) | [inline, private] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | float & | outputValue, | |
const float | internalValue | |||
) | const [inline, protected, virtual] |
void lux::MIPMapImpl< T, U >::convert | ( | float & | outputValue, | |
const TextureColor< V, n > & | internalValue | |||
) | const [inline, protected] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const Spectrum & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< float, 4 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< float, 3 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< float, 1 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< unsigned short, 4 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< unsigned short, 3 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< unsigned short, 1 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< unsigned char, 4 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< unsigned char, 3 > & | internalValue | |||
) | const [inline, protected, virtual] |
virtual void lux::MIPMapImpl< T, U >::convert | ( | Spectrum & | outputValue, | |
const TextureColor< unsigned char, 1 > & | internalValue | |||
) | const [inline, protected, virtual] |
Reimplemented in lux::MIPMapFastImpl< T, U >.
Definition at line 131 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::convert(), and lux::MIPMapImpl< T, U >::texel().
void lux::MIPMapImpl< T, U >::discardMipmaps | ( | int | n | ) | [inline, virtual] |
T lux::MIPMapImpl< T, U >::EWA | ( | float | s, | |
float | t, | |||
float | ds0, | |||
float | dt0, | |||
float | ds1, | |||
float | dt1, | |||
int | level | |||
) | const [inline, private] |
Definition at line 386 of file mipmap.h.
References Ceil2Int(), Float2Int(), Floor2Int(), cimg_library::min(), lux::MIPMapImpl< T, U >::nLevels, cimg_library::sqrt(), lux::MIPMapImpl< T, U >::texel(), lux::MIPMapImpl< T, U >::uSize(), lux::MIPMapImpl< T, U >::vSize(), WEIGHT_LUT_SIZE, and lux::MIPMapImpl< T, U >::weightLut.
u_int lux::MIPMapImpl< T, U >::getMemoryUsed | ( | ) | const [inline, virtual] |
T lux::MIPMapImpl< T, U >::Lookup | ( | float | s, | |
float | t, | |||
float | ds0, | |||
float | dt0, | |||
float | ds1, | |||
float | dt1 | |||
) | const [inline, virtual] |
Implements lux::MIPMap< T >.
Definition at line 345 of file mipmap.h.
References lux::BILINEAR, Floor2Int(), Log2(), LUX_ERROR, LUX_SYSTEM, luxError, cimg_library::max(), lux::MIPMAP_EWA, lux::MIPMAP_TRILINEAR, lux::NEAREST, and cimg_library::cimg::swap().
T lux::MIPMapImpl< T, U >::Lookup | ( | float | s, | |
float | t, | |||
float | width = 0.f | |||
) | const [inline, virtual] |
Implements lux::MIPMap< T >.
Definition at line 282 of file mipmap.h.
References lux::BILINEAR, Floor2Int(), Log2(), LUX_ERROR, LUX_SYSTEM, luxError, cimg_library::max(), lux::MIPMAP_EWA, lux::MIPMAP_TRILINEAR, and lux::NEAREST.
Referenced by lux::HighContrastOp::Map().
T lux::MIPMapImpl< T, U >::nearest | ( | float | s, | |
float | t | |||
) | const [inline, private] |
Definition at line 336 of file mipmap.h.
References Floor2Int(), lux::MIPMapImpl< T, U >::singleMap, lux::MIPMapImpl< T, U >::texel(), BlockedArray< T, logBlockSize >::uSize(), and BlockedArray< T, logBlockSize >::vSize().
ResampleWeight* lux::MIPMapImpl< T, U >::resampleWeights | ( | int | oldres, | |
int | newres | |||
) | [inline, private] |
const T lux::MIPMapImpl< T, U >::texel | ( | int | s, | |
int | t | |||
) | const [inline, protected] |
const T lux::MIPMapImpl< T, U >::texel | ( | int | level, | |
int | s, | |||
int | t | |||
) | const [inline, protected] |
Definition at line 113 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::EWA(), lux::MIPMapImpl< T, U >::nearest(), and lux::MIPMapImpl< T, U >::triangle().
const U & lux::MIPMapImpl< T, U >::texelInternal | ( | int | s, | |
int | t | |||
) | const [inline, protected] |
Definition at line 608 of file mipmap.h.
References Clamp(), Mod(), lux::MIPMapImpl< T, U >::singleMap, lux::TEXTURE_BLACK, lux::TEXTURE_CLAMP, lux::TEXTURE_REPEAT, BlockedArray< T, logBlockSize >::uSize(), BlockedArray< T, logBlockSize >::vSize(), and lux::MIPMapImpl< T, U >::wrapMode.
const U & lux::MIPMapImpl< T, U >::texelInternal | ( | int | level, | |
int | s, | |||
int | t | |||
) | const [inline, protected] |
Definition at line 584 of file mipmap.h.
References Clamp(), Mod(), lux::TEXTURE_BLACK, lux::TEXTURE_CLAMP, lux::TEXTURE_REPEAT, BlockedArray< T, logBlockSize >::uSize(), and BlockedArray< T, logBlockSize >::vSize().
Referenced by lux::MIPMapImpl< T, U >::MIPMapImpl(), and lux::MIPMapImpl< T, U >::texel().
T lux::MIPMapImpl< T, U >::triangle | ( | float | s, | |
float | t | |||
) | const [inline, private] |
T lux::MIPMapImpl< T, U >::triangle | ( | int | level, | |
float | s, | |||
float | t | |||
) | const [inline, private] |
Definition at line 311 of file mipmap.h.
References Clamp(), Floor2Int(), lux::MIPMapImpl< T, U >::nLevels, lux::MIPMapImpl< T, U >::texel(), lux::MIPMapImpl< T, U >::uSize(), and lux::MIPMapImpl< T, U >::vSize().
int lux::MIPMapImpl< T, U >::uSize | ( | int | level | ) | const [inline, private] |
Definition at line 238 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::EWA(), lux::MIPMapImpl< T, U >::getMemoryUsed(), lux::MIPMapImpl< T, U >::MIPMapImpl(), and lux::MIPMapImpl< T, U >::triangle().
int lux::MIPMapImpl< T, U >::vSize | ( | int | level | ) | const [inline, private] |
Definition at line 239 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::EWA(), lux::MIPMapImpl< T, U >::MIPMapImpl(), and lux::MIPMapImpl< T, U >::triangle().
union { ... } [private] |
ImageTextureFilterType lux::MIPMapImpl< T, U >::filterType [private] |
Definition at line 247 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::getMemoryUsed(), and lux::MIPMapImpl< T, U >::MIPMapImpl().
float lux::MIPMapImpl< T, U >::gain [private] |
Definition at line 249 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::convert(), and lux::MIPMapImpl< T, U >::MIPMapImpl().
float lux::MIPMapImpl< T, U >::gamma [private] |
Definition at line 250 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::convert(), and lux::MIPMapImpl< T, U >::MIPMapImpl().
float lux::MIPMapImpl< T, U >::invMaxUnsignedChar = 1.0f / (std::numeric_limits<unsigned char>::max() - 1) [inline, static, protected] |
float lux::MIPMapImpl< T, U >::invMaxUnsignedShort = 1.0f / (std::numeric_limits<unsigned short>::max() - 1) [inline, static, protected] |
float lux::MIPMapImpl< T, U >::maxAnisotropy [private] |
int lux::MIPMapImpl< T, U >::nLevels [private] |
Definition at line 252 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::discardMipmaps(), lux::MIPMapImpl< T, U >::EWA(), lux::MIPMapImpl< T, U >::getMemoryUsed(), lux::MIPMapImpl< T, U >::MIPMapImpl(), and lux::MIPMapImpl< T, U >::triangle().
BlockedArray<U>** lux::MIPMapImpl< T, U >::pyramid |
Definition at line 254 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::discardMipmaps(), lux::MIPMapImpl< T, U >::getMemoryUsed(), lux::MIPMapImpl< T, U >::MIPMapImpl(), lux::MIPMapImpl< T, U >::uSize(), and lux::MIPMapImpl< T, U >::vSize().
BlockedArray<U>* lux::MIPMapImpl< T, U >::singleMap |
Definition at line 255 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::getMemoryUsed(), lux::MIPMapImpl< T, U >::MIPMapImpl(), lux::MIPMapImpl< T, U >::nearest(), and lux::MIPMapImpl< T, U >::texelInternal().
float * lux::MIPMapImpl< T, U >::weightLut = NULL [inline, static, private] |
Definition at line 259 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::EWA(), and lux::MIPMapImpl< T, U >::MIPMapImpl().
ImageWrap lux::MIPMapImpl< T, U >::wrapMode [private] |
Definition at line 251 of file mipmap.h.
Referenced by lux::MIPMapImpl< T, U >::MIPMapImpl(), and lux::MIPMapImpl< T, U >::texelInternal().