Mipmap

Mipmapped images. Supports non power-of-two textures. Size of the i+1-th mipmap is { (width)/2, (height)/2 } The mipmap owns each of its levels.

Constructors

this
this()

Creates empty

this
this(int maxLevel, int w, int h)

Set number of levels and size maxLevel = 0 => only one image maxLevel = 1 => one image + one 2x downsampled mipmap etc...

this
this(int maxLevel, OwnedImage!COLOR level0)

Creates a Mipmap out of a flat OwnedImage. This takes ownership of the given image, which is now owned by the Mipmap.

Destructor

~this
~this()
Undocumented in source.

Members

Enums

Quality
enum Quality
Undocumented in source.

Functions

cubicSample
auto cubicSample(int level, float x, float y)

Cubic filtering mode, using a Catmull-Rom bicubic filter. Integer level, spatial linear interpolation. x and y are in base level coordinates (top-left pixel is on (0.5, 0.5) coordinates). Clamped to borders. Reference: https://registry.khronos.org/OpenGL/extensions/IMG/IMG_texture_filter_cubic.txt

generateLevel
void generateLevel(int level, Quality quality, box2i updateRect)

Regenerates one level updateRect expressed in level i-th coordinates

generateMipmaps
void generateMipmaps(Quality quality)

Regenerates the whole upper levels.

generateNextLevel
box2i generateNextLevel(Quality quality, box2i updateRectPreviousLevel, int level)

Regenerates a single mipmap level based on changes in the provided rectangle (expressed in level 0 coordinates). updateRect expressed in level 0 coordinates In general if you have several subparts of mipmaps to update, make sure a level is fully completed before computing the next one.

height
int height()
linearMipmapSample
auto linearMipmapSample(float level, float x, float y)

Interpolates a color between mipmap levels. Floating-point level, spatial linear interpolation. x and y are in base level coordinates (top-left pixel is on (0.5, 0.5) coordinates). Clamped to borders.

linearSample
auto linearSample(int level, float x, float y)

Interpolates a color. Integer level, spatial linear interpolation. x and y are in base level coordinates (top-left pixel is on (0.5, 0.5) coordinates). Clamped to borders.

numLevels
int numLevels()
size
void size(int maxLevel, int w, int h)
Undocumented in source. Be warned that the author may not have intended to support it.
width
int width()

Variables

levels
Vec!(OwnedImage!COLOR) levels;
Undocumented in source.

Meta