Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
Source4Bpp Class Reference

#include <measure-framerate-stubs.hh>

Inheritance diagram for Source4Bpp:
Inheritance graph
Collaboration diagram for Source4Bpp:
Collaboration graph

Public Member Functions

void fillTiles (int startLine, int lineCount, int tileWidth, int firstTile, std::vector< Tile::Ptr > &tiles) override
 
void done () override
 
std::string getName () override
 

Additional Inherited Members

- Public Types inherited from SourcePresentation
using Ptr = std::shared_ptr< SourcePresentation >
 

Member Function Documentation

◆ done()

void Source4Bpp::done ( )
inlineoverridevirtual

Done reading bitmap data

Any open files can be closed now

Implements SourcePresentation.

91{};

◆ fillTiles()

void Source4Bpp::fillTiles ( int  startLine,
int  lineCount,
int  tileWidth,
int  firstTile,
std::vector< Tile::Ptr > &  tiles 
)
overridevirtual

Provide bitmap data

While the TiledBitmap is loaded, this function will be called several times. Each time, this function has to fill the provided tiles with bitmap data.

The given tiles are horizontally adjacent.

Parameters
startLiney coordinate of the first line in the set of tiles
lineCountThe number of lines that are to be filled. This equals the height of the tiles
tileWidthThe width of one tile
firstTileIndex of the first tile provided. This means that the first x coordinate is firsttile * tileWidth
tilesThe tiles that are to be filled.

Implements SourcePresentation.

69{
70 for(const Tile::Ptr& tile: tiles)
71 {
72 byte* data = tile->data.get();
73 for(int y = 0; y < lineCount; y++)
74 {
75 for(int x = 0; x < tileWidth / 2; x++)
76 {
77 byte const v = 2 * x + y;
78
79 *data = ((v & 0xF) << 4) | ((v + 1) & 0xF);
80 data++;
81 }
82 }
83 }
84}
uint8_t data
Definition blob-tests.cc:36
std::shared_ptr< Tile > Ptr
Definition tile.hh:19

◆ getName()

std::string Source4Bpp::getName ( )
inlineoverridevirtual

Implements SourcePresentation.

92{ return "Source4Bpp"; }

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