#include <textureMemoryCounter.h>
Public Member Functions | |
TextureMemoryCounter () | |
void | reset () |
Resets the count to zero. | |
void | add_placement (TexturePlacement *placement) |
Adds the indicated TexturePlacement to the counter. | |
void | report (ostream &out, int indent_level) |
Reports the measured texture memory usage. | |
Private Types | |
typedef pmap< TextureImage *, int > | Textures |
typedef pset< PaletteImage * > | Palettes |
Private Member Functions | |
void | add_palette (PaletteImage *image) |
Adds the indicated PaletteImage to the count. | |
void | add_texture (TextureImage *texture, int bytes) |
Adds the given TextureImage to the counter. | |
int | count_bytes (ImageFile *image) |
Attempts to estimate the number of bytes the given image file will use in texture memory. | |
int | count_bytes (ImageFile *image, int x_size, int y_size) |
Attempts to estimate the number of bytes the given image file will use in texture memory. | |
Static Private Member Functions | |
ostream & | format_memory_fraction (ostream &out, int fraction_bytes, int palette_bytes) |
Writes to the indicated ostream an indication of the fraction of the total memory usage that is represented by fraction_bytes. | |
Private Attributes | |
int | _num_textures |
int | _num_placed |
int | _num_unplaced |
int | _num_palettes |
int | _bytes |
int | _unused_bytes |
int | _duplicate_bytes |
int | _coverage_bytes |
Textures | _textures |
Palettes | _palettes |
It adds up the total texture memory required by a number of image files, and reports it at the end.
Definition at line 49 of file textureMemoryCounter.h.
|
Definition at line 79 of file textureMemoryCounter.h. |
|
Definition at line 76 of file textureMemoryCounter.h. |
|
Definition at line 40 of file textureMemoryCounter.cxx. References _bytes, _num_palettes, _num_placed, _num_textures, _num_unplaced, and _unused_bytes. |
|
Adds the indicated PaletteImage to the count. If this is called twice for a given PaletteImage it does nothing. Definition at line 178 of file textureMemoryCounter.cxx. References _duplicate_bytes, _num_textures, and _textures. |
|
Adds the indicated TexturePlacement to the counter.
Definition at line 76 of file textureMemoryCounter.cxx. References _num_placed. Referenced by Palettizer::test_palette_group(). |
|
Adds the given TextureImage to the counter. If the texture image has already been added, this counts the smaller of the two as duplicate bytes. Definition at line 209 of file textureMemoryCounter.cxx. References TextureProperties::_format, EggTexture::F_rgb, EggTexture::F_rgb12, EggTexture::F_rgba, EggTexture::F_rgba12, EggTexture::F_rgba8, EggTexture::F_rgbm, and ImageFile::get_properties(). |
|
Attempts to estimate the number of bytes the given image file will use in texture memory.
Definition at line 251 of file textureMemoryCounter.cxx. References EggTexture::F_alpha, and EggTexture::F_luminance. |
|
Attempts to estimate the number of bytes the given image file will use in texture memory.
Definition at line 236 of file textureMemoryCounter.cxx. References EggTexture::F_blue, EggTexture::F_green, EggTexture::F_luminance_alpha, EggTexture::F_luminance_alphamask, EggTexture::F_red, EggTexture::F_rgb332, EggTexture::F_rgb5, EggTexture::F_rgb8, EggTexture::F_rgba4, and EggTexture::F_rgba5. |
|
Writes to the indicated ostream an indication of the fraction of the total memory usage that is represented by fraction_bytes.
Definition at line 159 of file textureMemoryCounter.cxx. |
|
Reports the measured texture memory usage.
Definition at line 111 of file textureMemoryCounter.cxx. Referenced by Palettizer::test_palette_group(). |
|
Resets the count to zero.
Definition at line 53 of file textureMemoryCounter.cxx. References _coverage_bytes, _duplicate_bytes, _palettes, and _textures. |
|
Definition at line 71 of file textureMemoryCounter.h. Referenced by TextureMemoryCounter(). |
|
Definition at line 74 of file textureMemoryCounter.h. Referenced by reset(). |
|
Definition at line 73 of file textureMemoryCounter.h. Referenced by add_palette(), and reset(). |
|
Definition at line 69 of file textureMemoryCounter.h. Referenced by TextureMemoryCounter(). |
|
Definition at line 67 of file textureMemoryCounter.h. Referenced by add_placement(), and TextureMemoryCounter(). |
|
Definition at line 66 of file textureMemoryCounter.h. Referenced by add_palette(), and TextureMemoryCounter(). |
|
Definition at line 68 of file textureMemoryCounter.h. Referenced by TextureMemoryCounter(). |
|
Definition at line 80 of file textureMemoryCounter.h. Referenced by reset(). |
|
Definition at line 77 of file textureMemoryCounter.h. Referenced by add_palette(), and reset(). |
|
Definition at line 72 of file textureMemoryCounter.h. Referenced by TextureMemoryCounter(). |