#include <tiffsource.hh>
|
| bool | reset () |
| |
| void | fillTiles (int startLine, int lineCount, int tileWidth, int firstTile, std::vector< Tile::Ptr > &tiles) override |
| |
| void | done () override |
| |
| std::string | getName () override |
| |
◆ Ptr
◆ Source()
232 ,
bmd(std::move(bmd_))
◆ create()
◆ done()
| void Scroom::Tiff::Source::done |
( |
| ) |
|
|
overridevirtual |
◆ fillTiles()
| void Scroom::Tiff::Source::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
-
| startLine | y coordinate of the first line in the set of tiles |
| lineCount | The number of lines that are to be filled. This equals the height of the tiles |
| tileWidth | The width of one tile |
| firstTile | Index of the first tile provided. This means that the first x coordinate is firsttile * tileWidth |
| tiles | The tiles that are to be filled. |
Implements SourcePresentation.
270 const auto startLine_ =
static_cast<uint32_t
>(startLine);
271 const auto firstTile_ =
static_cast<size_t>(firstTile);
272 const auto scanLineSize =
static_cast<size_t>(TIFFScanlineSize(
tif.get()));
273 const auto tileStride =
static_cast<size_t>(tileWidth * spp * bps / 8);
274 std::vector<byte> row(scanLineSize);
276 const size_t tileCount = tiles.size();
277 auto dataPtr = std::vector<byte*>(tileCount);
278 for(
size_t tile = 0; tile < tileCount; tile++)
280 dataPtr[tile] = tiles[tile]->data.get();
283 for(
size_t i = 0; i < static_cast<size_t>(lineCount); i++)
285 TIFFReadScanline(
tif.get(), row.data(),
static_cast<uint32_t
>(i) + startLine_);
287 for(
size_t tile = 0; tile < tileCount - 1; tile++)
289 memcpy(dataPtr[tile], row.data() + (firstTile_ + tile) * tileStride, tileStride);
290 dataPtr[tile] += tileStride;
292 memcpy(dataPtr[tileCount - 1],
293 row.data() + (firstTile_ + tileCount - 1) * tileStride,
294 scanLineSize - (firstTile_ + tileCount - 1) * tileStride);
295 dataPtr[tileCount - 1] += tileStride;
◆ getName()
| std::string Scroom::Tiff::Source::getName |
( |
| ) |
|
|
inlineoverridevirtual |
◆ reset()
| bool Scroom::Tiff::Source::reset |
( |
| ) |
|
246 tif = std::get<1>(*r);
252 spdlog::error(
"Can't reload. Bitmap changed too much");
254 spdlog::info(
"Now: {}",
to_string(std::get<0>(*r)));
◆ bmd
◆ fileName
| std::string Scroom::Tiff::Source::fileName |
|
private |
◆ preOpenedTif
| TIFFPtr Scroom::Tiff::Source::preOpenedTif |
|
private |
◆ tif
The documentation for this class was generated from the following files: