Scroom  0.14
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 
37  spdlog::debug("Creating a PageProvider providing {} blocks of {} bytes", blockCount, blockSize);
38  return Scroom::MemoryBlobs::PageProvider::create(blockCount, blockSize);
39 }

Referenced by Layer::create().

Here is the call graph for this function:
Here is the caller graph for this function:
Scroom::MemoryBlobs::PageProvider::create
static Ptr create(size_t blockCount, size_t blockSize)
Definition: memoryblobs.cc:37
Scroom::Utils::ceil
Point< T > ceil(Point< T > p)
Definition: point.hh:228
TILESIZE
#define TILESIZE
Definition: tiledbitmaplayer.hh:28