DSC Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DSC::Measure Class Reference

Helper class to deal with graphics size computations. More...

#include <measure.hpp>

Public Member Functions

Measure_4bpp ()
 chain function to set color depth to 4 bpp More...
 
Measure_8bpp ()
 chain function to set color depth to 8 bpp More...
 
Measure_16bpp ()
 chain function to set color depth to 16 bpp More...
 
Measurebpp (int color_depth)
 alternative to _4bpp(), _8bpp() or _16bpp() with dynamic parameter More...
 
Measuremetatile (int tw, int th)
 chain function to set meta tile size More...
 
Measuretext ()
 chain function to set map type as text (tiles)
 
Measurebitmap ()
 chain function to set map type as bitmap
 
MeasureValue tiles (int count) const
 computes the size of a number of tiles given the measure settings More...
 
MeasureValue tiles (int rows_count, int cols_count) const
 computes the size of a matrix of tiles given the measure settings More...
 
MeasureValue bitmap (int width, int height) const
 computes the size of a bitmap given the measure settings More...
 
int tiles_count (int size) const
 finds how many tiles can fit in memory block of a certain size, given the measure settings More...
 
MeasureValue map_size (int width, int height) const
 
int bytes_per_map_entry () const
 
int tile_id (void *address, void *base, int mapping_step) const
 

Detailed Description

Helper class to deal with graphics size computations.

Member Function Documentation

◆ _16bpp()

Measure & DSC::Measure::_16bpp ( )

chain function to set color depth to 16 bpp

Returns
the current instance with modified settings
Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

◆ _4bpp()

Measure & DSC::Measure::_4bpp ( )

chain function to set color depth to 4 bpp

Returns
the current instance with modified settings
Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

◆ _8bpp()

Measure & DSC::Measure::_8bpp ( )

chain function to set color depth to 8 bpp

Returns
the current instance with modified settings
Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

◆ bitmap()

MeasureValue DSC::Measure::bitmap ( int  width,
int  height 
) const

computes the size of a bitmap given the measure settings

Parameters
widthbitmap's width in pixels
heightbitmap's height in pixels
Returns
size of a bitmap with the given size and the defined color depth

◆ bpp()

Measure & DSC::Measure::bpp ( int  color_depth)

alternative to _4bpp(), _8bpp() or _16bpp() with dynamic parameter

Returns
the current instance with modified settings
Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

◆ metatile()

Measure & DSC::Measure::metatile ( int  tw,
int  th 
)

chain function to set meta tile size

Parameters
twmeta tile width (e.g. for 32x16px tiles, tw equals 4)
thmeta tile height (e.g. for 32x16px tiles, th equals 2)
Returns
the current instance with modified settings
Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

◆ tiles() [1/2]

MeasureValue DSC::Measure::tiles ( int  count) const

computes the size of a number of tiles given the measure settings

Parameters
countthe number of tiles
Returns
size of a graphics with the given number of tiles and the defined settings

In computing the tiles size, the color depth and metatile data are taken into account. By default, tiles are 8x8px with 4bpp color-depth

Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

◆ tiles() [2/2]

MeasureValue DSC::Measure::tiles ( int  rows_count,
int  cols_count 
) const

computes the size of a matrix of tiles given the measure settings

Parameters
rows_countnumber of rows in the tiles matrix
cols_countnumber of columns in the tiles matrix
Returns
size of a graphics with the given number of tiles and the defined settings

In computing the tiles size, the color depth and metatile data are taken into account. By default, tiles are 8x8px with 4bpp color-depth

◆ tiles_count()

int DSC::Measure::tiles_count ( int  size) const

finds how many tiles can fit in memory block of a certain size, given the measure settings

Parameters
sizethe memory block size
Returns
maximum number of tiles whose size are at most the specified size
Examples
D:/Users/NotImpLife/Projects/DS-Creator-Dev/DSCEngine/include/DSCEngine/video/measure.hpp.

The documentation for this class was generated from the following file: