Scroom 0.14-48-ga0fee447
Loading...
Searching...
No Matches
layer.cc File Reference
#include <cstdio>
#include <utility>
#include <vector>
#include <spdlog/spdlog.h>
#include <scroom/impl/threadpoolimpl.hh>
#include <scroom/memoryblobs.hh>
#include <scroom/stuff.hh>
#include <scroom/threadpool.hh>
#include <scroom/tile.hh>
#include <scroom/tiledbitmapinterface.hh>
#include <scroom/tiledbitmaplayer.hh>
#include <scroom/viewinterface.hh>
#include "local.hh"
Include dependency graph for layer.cc:

Classes

class  DataFetcher
 

Functions

static Scroom::MemoryBlobs::PageProvider::Ptr createProvider (double width, double height, int bpp)
 

Function Documentation

◆ createProvider()

static Scroom::MemoryBlobs::PageProvider::Ptr createProvider ( double  width,
double  height,
int  bpp 
)
static
26{
27 const double tileCount = (width * height) / (TILESIZE * TILESIZE);
28 const double tileSize = (bpp / 8.0) * TILESIZE * TILESIZE;
29
30 const double guessedTileSizeAfterCompression = tileSize / 100;
31 const int pagesize = 4096;
32 const int pagesPerBlock = std::max(int(ceil(guessedTileSizeAfterCompression / 10 / pagesize)), 1);
33
34 const int blockSize = pagesPerBlock * pagesize;
35 const int blockCount = std::max(int(ceil(tileCount / 10)), 64);
36
38 logger->debug("Creating a PageProvider providing {} blocks of {} bytes", blockCount, blockSize);
40}
const size_t blockSize
Definition blob-tests.cc:24
const size_t blockCount
Definition blob-tests.cc:23
Definition logger.hh:49
static Ptr create(size_t blockCount, size_t blockSize)
Definition memoryblobs.cc:37
Point< T > ceil(Point< T > p)
Definition point.hh:228
Scroom::Logger logger
Definition callbacks.cc:54
#define TILESIZE
Definition tiledbitmaplayer.hh:27

Referenced by Layer::create().

Here is the call graph for this function:
Here is the caller graph for this function: