|
| const std::string | RGB = "RGB" |
| |
| const std::string | CMYK = "CMYK" |
| |
| const std::string | Greyscale = "Greyscale" |
| |
| const std::string | Colormapped = "Colormapped" |
| |
◆ LayerSpecForBitmapFunc
◆ LayerSpecResult
◆ ReloadFunction
Function type for starting the loading of the bottom Layer of a bitmap.
This function is called on the UI thread. You cannot do a significant amount of work in this function, or you'll block the UI. Typical implementations will schedule work on the Sequentially() ThreadPool, such that bitmaps will be loaded sequentially.
- Parameters
-
| progressInterface | call setProgress(0) on this once the work actually starts |
- Returns
- a shared pointer. Typically a ThreadPool::Queue or similar. The expectation is that when this object is destroyed by the caller, the loading is cancelled.
- See also
- Layer
-
OpenTiledBitmapInterface::open()
-
Sequentially()
-
scheduleLoadingBitmap() for an example implementation
◆ CMYKBitmap()
◆ ColormappedBitmap()
◆ GreyscaleBitmap()
173 require(bmd.samplesPerPixel == 1);
175 if(bmd.bitsPerSample != 1 && bmd.bitsPerSample != 2 && bmd.bitsPerSample != 4 && bmd.bitsPerSample != 8)
177 spdlog::error(
"Greyscale bitmaps with {} bits per pixel are not supported (yet)", bmd.bitsPerSample);
188 if(bmd.bitsPerSample == 2 || bmd.bitsPerSample == 4)
195 if(bmd.bitsPerSample == 1)
Referenced by Scroom::TiledBitmap::LayerSpecForBitmapper::LayerSpecForBitmapper().
◆ LayerSpecForBitmap()
◆ RGBBitmap()
◆ scheduleLoadingBitmap()
37 auto wait_until_done = boost::make_shared<Scroom::Semaphore>();
39 auto weakQueue = queue->getWeak();
40 auto abort = [wait_until_done, queue]()
mutable
46 auto on_finished = [wait_until_done] { wait_until_done->V(); };
47 progress->setWaiting();
50 [progress, layer, sp, weakQueue, on_finished, wait_until_done]
53 layer->fetchData(sp, weakQueue, on_finished);
Referenced by Tiff::open(), and TiledBitmap::setSource().
◆ to_metadata()
40 std::string aspect_ratio_text = fmt::format(
"{:.2f} : {:.2f}", aspectRatio.
x, aspectRatio.
y);
43 {
"Color representation", bmd.type},
46 {
"Aspect ratio", aspect_ratio_text},
◆ to_stream()
| std::ostream & Scroom::TiledBitmap::to_stream |
( |
std::ostream & |
os, |
|
|
const BitmapMetaData & |
bmd |
|
) |
| |
24 os <<
"Type=\"" << bmd.type <<
"\", rect=" << bmd.rect <<
", spp=" << bmd.samplesPerPixel <<
", bps=" << bmd.bitsPerSample
25 <<
", colormapped=" <<
to_string(
static_cast<bool>(bmd.colormapHelper));
Referenced by to_string().
◆ to_string()
| std::string Scroom::TiledBitmap::to_string |
( |
const BitmapMetaData & |
bmd | ) |
|
◆ ToOpenPresentationInterface()
◆ CMYK
| const std::string Scroom::TiledBitmap::CMYK = "CMYK" |
◆ Colormapped
| const std::string Scroom::TiledBitmap::Colormapped = "Colormapped" |
◆ Greyscale
| const std::string Scroom::TiledBitmap::Greyscale = "Greyscale" |
◆ RGB
| const std::string Scroom::TiledBitmap::RGB = "RGB" |
static Ptr create()
Definition: layeroperations.cc:498
static Ptr create(int numberOfColors)
Definition: colormap-helpers.cc:72
static Ptr create()
Definition: cmyklayeroperations.cc:123
static Ptr create(ColormapProvider::Ptr colormapProvider)
Definition: layeroperations.cc:378
std::tuple< LayerSpec, ColormapHelperBase::Ptr > LayerSpecResult
Definition: opentiledbitmapinterface.hh:75
static Ptr createAsync()
Definition: threadpoolimpl.cc:379
const std::string Colormapped
Definition: layerspecforbitmap.cc:56
static Ptr create(ColormapProvider::Ptr colormapProvider)
Definition: layeroperations.cc:262
ThreadPool::Ptr Sequentially()
Definition: threadpoolimpl.cc:459
void abort() __attribute__((noreturn))
Definition: assertions.cc:126
std::vector< LayerOperations::Ptr > LayerSpec
Definition: tiledbitmapinterface.hh:190
const char * to_string(bool b)
Definition: layerspecforbitmap.cc:19
#define require(expr)
Definition: assertions.hh:28
value_type x
Definition: point.hh:111
void sync_on_ui_thread(T f)
Definition: gtk-helpers.hh:59
static Ptr create()
Definition: cmyklayeroperations.cc:306
static Ptr create()
Definition: cmyklayeroperations.cc:30
boost::shared_ptr< void > on_destruction(F f)
Definition: utilities.hh:75
boost::shared_ptr< ColormapHelperBase > Ptr
Definition: colormappable.hh:160
static Ptr create(ColormapProvider::Ptr colormapProvider, int bpp)
Definition: layeroperations.cc:574
ProgressBarPulser::Ptr instance()
Definition: progressbarmanager.cc:43
const std::string CMYK
Definition: layerspecforbitmap.cc:54
static Ptr create(ColormapProvider::Ptr colormapProvider, int bpp)
Definition: layeroperations.cc:723
std::ostream & to_stream(std::ostream &os, const BitmapMetaData &bmd)
Definition: layerspecforbitmap.cc:22
void create(NewPresentationInterface *interface)
Definition: loader.cc:175
value_type y
Definition: point.hh:112
static Ptr create()
Definition: cmyklayeroperations.cc:216
const std::string Greyscale
Definition: layerspecforbitmap.cc:55
const std::string RGB
Definition: layerspecforbitmap.cc:53