Scroom  0.14
Source8Bpp Class Reference

#include <measure-framerate-stubs.hh>

Inheritance diagram for Source8Bpp:
Inheritance graph
Collaboration diagram for Source8Bpp:
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 = boost::shared_ptr< SourcePresentation >
 

Member Function Documentation

◆ done()

void Source8Bpp::done ( )
inlineoverridevirtual

Done reading bitmap data

Any open files can be closed now

Implements SourcePresentation.

99 {};

◆ fillTiles()

void Source8Bpp::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.

87 {
88  for(const Tile::Ptr& tile: tiles)
89  {
90  byte* data = tile->data.get();
91  for(int y = 0; y < lineCount; y++)
92  {
93  for(int x = 0; x < tileWidth; x++)
94  {
95  *data = (x + y) & 0xFF;
96  data++;
97  }
98  }
99  }
100 }

◆ getName()

std::string Source8Bpp::getName ( )
inlineoverridevirtual

Implements SourcePresentation.

100 { return "Source8Bpp"; }

The documentation for this class was generated from the following files:
Tile::Ptr
boost::shared_ptr< Tile > Ptr
Definition: tile.hh:21