Scroom  0.14
queue.hh
Go to the documentation of this file.
1 /*
2  * Scroom - Generic viewer for 2D data
3  * Copyright (C) 2009-2022 Kees-Jan Dijkzeul
4  *
5  * SPDX-License-Identifier: LGPL-2.1
6  */
7 
8 #pragma once
9 
10 #include <scroom/threadpool.hh>
11 
13 {
22  class QueueImpl
23  {
24  public:
25  using Ptr = boost::shared_ptr<QueueImpl>;
26 
27  static Ptr create();
28 
35  bool jobStarted();
36 
38  void jobFinished();
39 
45  void deletingQueue();
46 
48  int getCount();
49 
50  private:
51  boost::mutex mut;
52  boost::condition_variable cond;
53  unsigned int count{0};
54  bool isDeleted{false};
56  private:
57  QueueImpl() = default;
58  };
59 
63  class QueueLock
64  {
66  bool isValid;
68  public:
69  explicit QueueLock(QueueImpl::Ptr queue);
70  QueueLock(const QueueLock&) = delete;
71  QueueLock(QueueLock&&) = delete;
72  QueueLock& operator=(const QueueLock&) = delete;
73  QueueLock& operator=(QueueLock&&) = delete;
74  ~QueueLock();
75 
77  [[nodiscard]] bool queueExists() const;
78  };
79 
80 } // namespace Scroom::Detail::ThreadPool
TransformPresentation::disableTransparentBackground
void disableTransparentBackground() override
Definition: transformpresentation.cc:136
TransformationData::Ptr
boost::shared_ptr< TransformationData > Ptr
Definition: transformpresentation.hh:26
ColormapHelperBase::ColormapHelperBase
ColormapHelperBase(Colormap::Ptr const &colormap)
Definition: colormap-helpers.cc:18
Scroom::Detail::ThreadPool::FunctionAdditor::addAfter
void addAfter(boost::function< void()> const &fn)
Definition: function-additor.cc:12
Colormap::createDefault
static Colormap::Ptr createDefault(int n)
Definition: colormappable.hh:51
Detail::ViewData::weakParent
ViewInterface::WeakPtr weakParent
Definition: transformpresentation.hh:51
TransformPresentation::setMonochromeColor
void setMonochromeColor(const Color &c) override
Definition: transformpresentation.cc:132
Scroom::Metadata::showMetaData
void showMetaData(GtkWindow *parent, std::string title, Metadata data)
Definition: showmetadata.cc:68
Scroom::Detail::ThreadPool::QueueImpl::jobStarted
bool jobStarted()
Definition: queue.cc:30
Colors::OUT_OF_BOUNDS
const Color OUT_OF_BOUNDS
UNUSED
#define UNUSED(x)
Definition: unused.hh:10
TransformPresentation::isPropertyDefined
bool isPropertyDefined(const std::string &name) override
Definition: transformpresentation.cc:120
Scroom::Detail::ThreadPool::QueueLock::q
QueueImpl::Ptr q
Definition: queue.hh:65
ColormapHelperBase::getOriginalColormap
Colormap::Ptr getOriginalColormap() override
Definition: colormap-helpers.cc:28
Scroom::MemoryBlobs::PageProvider::PageProvider
PageProvider(size_t blockCount, size_t blockSize)
Definition: memoryblobs.cc:30
Scroom::Utils::Rectangle::getTopLeft
xy_type getTopLeft() const
Definition: rectangle.hh:133
TransformationData::aspectRatio
Scroom::Utils::Point< double > aspectRatio
Definition: transformpresentation.hh:23
Scroom::MemoryBlobs::PageProvider::Ptr
boost::shared_ptr< PageProvider > Ptr
Definition: memoryblobs.hh:41
PresentationBase::getViews
virtual std::set< ViewInterface::WeakPtr > getViews()=0
TransformPresentation::setColormap
void setColormap(Colormap::Ptr colormap) override
Definition: transformpresentation.cc:124
ThreadPool::Ptr
boost::shared_ptr< ThreadPool > Ptr
Definition: threadpool.hh:169
Scroom::MemoryBlobs::PageProvider::freePages
std::list< Scroom::MemoryBlocks::Page * > freePages
Definition: memoryblobs.hh:48
Scroom::Detail::ThreadPool::QueueImpl
Definition: queue.hh:22
operator+
Scroom::Detail::ThreadPool::FunctionAdditor operator+(boost::function< void()> const &f1, boost::function< void()> const &f2)
Definition: function-additor.cc:62
Scroom::Utils::Rectangle::x
value_type x() const
Definition: rectangle.hh:125
assertions.hh
MonochromeColormapHelper::blackish
Color blackish
Definition: colormappable.hh:235
Scroom::MemoryBlobs::RawPageData::ConstPtr
boost::shared_ptr< const uint8_t > ConstPtr
Definition: memoryblobs.hh:28
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::SwapBasedBlockAllocator
SwapBasedBlockAllocator(size_t count, size_t size)
Definition: swapbasedblockallocator.cc:52
TransformPresentation::getNumberOfColors
int getNumberOfColors() override
Definition: transformpresentation.cc:128
Scroom::MemoryBlocks::Page
Definition: blockallocator.hh:29
PipetteLayerOperations::PipetteColor
std::vector< std::pair< std::string, double > > PipetteColor
Definition: pipettelayeroperations.hh:22
Scroom::Detail::ThreadPool::FunctionMultiplier::FunctionMultiplier
FunctionMultiplier(boost::function< void()> f_, unsigned int i_)
Definition: function-additor.cc:40
ColormapHelper::getProperties
std::map< std::string, std::string > getProperties() override
Definition: colormap-helpers.cc:67
Scroom::Detail::ThreadPool::QueueImpl::getCount
int getCount()
Definition: queue.cc:45
Scroom::MemoryBlocks::BlockInterface
Definition: blockallocator.hh:43
MonochromeColormapHelper::disableTransparentBackground
void disableTransparentBackground() override
Definition: colormap-helpers.cc:141
threadpool.hh
Scroom::Utils::Rectangle::rightOf
Rectangle< value_type > rightOf(value_type v) const
Definition: rectangle.hh:148
Scroom::Detail::ThreadPool::QueueImpl::cond
boost::condition_variable cond
Definition: queue.hh:52
Scroom::MemoryBlobs::PageProvider::allPages
Scroom::MemoryBlocks::PageList allPages
Definition: memoryblobs.hh:47
Scroom::MemoryBlobs::Blob::Ptr
boost::shared_ptr< Blob > Ptr
Definition: memoryblobs.hh:78
Scroom::MemoryBlobs::Detail
Definition: blob-compression.cc:28
Scroom::MemoryBlobs::Blob::refcount
int refcount
Definition: memoryblobs.hh:110
ColormapHelperBase::originalColormap
Colormap::Ptr originalColormap
Definition: colormappable.hh:164
Scroom::Detail::ThreadPool::FunctionMultiplier::operator()
void operator()()
Definition: function-additor.cc:52
MonochromeColormapHelper::create
static Ptr create(int numberOfColors)
Definition: colormap-helpers.cc:72
ColormapHelperBase::OperationNotSupported
static void OperationNotSupported()
Definition: colormap-helpers.cc:48
Scroom::Utils::Rectangle::width
value_type width() const
Definition: rectangle.hh:129
operator==
bool operator==(ViewInterface::WeakPtr const &a, ViewInterface::WeakPtr const &b)
Definition: transformpresentation_test.cc:39
operator*
Scroom::Detail::ThreadPool::FunctionMultiplier & operator*(unsigned int i, Scroom::Detail::ThreadPool::FunctionMultiplier &m)
Definition: function-additor.cc:75
ColormapHelperBase::setMonochromeColor
void setMonochromeColor(const Color &c) override
Definition: colormap-helpers.cc:34
Scroom::Utils::Observable::getObservers
std::list< Observer > getObservers()
Definition: observable.hh:197
Scroom::MemoryBlobs::Blob::initialize
RawPageData::Ptr initialize(uint8_t value)
Definition: memoryblobs.cc:159
MonochromeColormapHelper::whitish
Color whitish
Definition: colormappable.hh:236
Scroom::MemoryBlobs::Blob::provider
PageProvider::Ptr provider
Definition: memoryblobs.hh:102
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::addKeyAndValueToSizeGroup
void addKeyAndValueToSizeGroup(GtkWidget *key, GtkWidget *value)
Definition: showmetadata.cc:54
Color::setColor
void setColor(cairo_t *cr) const
Definition: color.hh:117
ColormapHelperBase
Definition: colormappable.hh:155
drawOutOfBoundsWithoutBackground
void drawOutOfBoundsWithoutBackground(cairo_t *cr, Rectangle< double > const &requestedPresentationArea, Rectangle< double > const &actualPresentationArea, double pixelSize)
Definition: cairo-helpers.cc:93
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(weak_pointer_equality)
Definition: basic-assumptions.cc:16
anonymous_namespace{boost-smart-pointers.cc}::A::WeakPtr
boost::weak_ptr< A > WeakPtr
Definition: boost-smart-pointers.cc:26
MONOCHROME_COLORMAPPABLE_PROPERTY_NAME
const std::string MONOCHROME_COLORMAPPABLE_PROPERTY_NAME
Definition: colormappable.hh:22
drawRectangleContour
void drawRectangleContour(cairo_t *cr, Rectangle< double > const &viewArea)
Definition: cairo-helpers.cc:31
Scroom::Detail::ThreadPool::getDeleter
::ThreadPool::Ptr getDeleter()
Definition: async-deleter.cc:13
point.hh
functions
std::vector< boost::function< bool()> > functions
Definition: measure-framerate-callbacks.cc:16
Scroom::MemoryBlobs::PageProvider::MarkPageFree
Definition: memoryblobs.hh:52
Detail::ViewData::ViewData
ViewData(ViewInterface::WeakPtr parent_)
Definition: transformpresentation.cc:153
Scroom::Detail::ThreadPool::FunctionAdditor::operator+
FunctionAdditor & operator+(boost::function< void()> const &fn)
Definition: function-additor.cc:15
Scroom::Detail::ThreadPool::FunctionAdditor
Definition: function-additor.hh:16
Scroom::MemoryBlobs::Blob::weakData
RawPageData::WeakPtr weakData
Definition: memoryblobs.hh:107
presentationinterface.hh
TransformPresentation::getRect
Scroom::Utils::Rectangle< double > getRect() override
Definition: transformpresentation.cc:57
TransformPresentation::getTitle
std::string getTitle() override
Definition: transformpresentation.cc:122
Scroom::MemoryBlobs::PageList
std::list< Page::Ptr > PageList
Definition: memoryblobs.hh:36
Scroom::MemoryBlocks::RawPageData::Ptr
boost::shared_ptr< uint8_t > Ptr
Definition: blockallocator.hh:23
TransformPresentation::setTransparentBackground
void setTransparentBackground() override
Definition: transformpresentation.cc:134
Scroom::Detail::ThreadPool
Definition: async-deleter.hh:21
utilities.hh
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::count
size_t count
Definition: swapbasedblockallocator.cc:37
Scroom::Utils::Rectangle::getBottom
value_type getBottom() const
Definition: rectangle.hh:112
showmetadata.hh
Scroom::MemoryBlocks::RawPageData::WeakPtr
boost::weak_ptr< uint8_t > WeakPtr
Definition: blockallocator.hh:24
Scroom::Bitmap::BitmapSurface::data
const boost::shared_ptr< unsigned char > data
Definition: bitmap-helpers.hh:29
anonymous_namespace{colormaphelpers_test.cc}::operator<<
std::ostream & operator<<(std::ostream &os, const Data &)
Definition: colormaphelpers_test.cc:39
Scroom::Detail::ThreadPool::QueueLock::queueExists
bool queueExists() const
Definition: queue.cc:61
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(sample.expectedColors, originalColormap->colors.size())
Scroom::Detail::ThreadPool::QueueImpl::deletingQueue
void deletingQueue()
Definition: queue.cc:20
Scroom::Bitmap::BitmapSurface::Ptr
boost::shared_ptr< BitmapSurface > Ptr
Definition: bitmap-helpers.hh:25
Scroom::Detail::ThreadPool::QueueImpl::isDeleted
bool isDeleted
Definition: queue.hh:54
pipettelayeroperations.hh
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::data
boost::movelib::unique_ptr< uint8_t[]> data
Definition: swapbasedblockallocator.cc:39
Scroom::MemoryBlobs::Blob::UnloadData
friend class UnloadData
Definition: memoryblobs.hh:99
ProgressInterface::Ptr
boost::shared_ptr< ProgressInterface > Ptr
Definition: progressinterface.hh:20
ViewInterface::Ptr
boost::shared_ptr< ViewInterface > Ptr
Definition: viewinterface.hh:193
TransformPresentation::getPixelAverages
PipetteLayerOperations::PipetteColor getPixelAverages(Scroom::Utils::Rectangle< double > area) override
Definition: transformpresentation.cc:142
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocatorFactory::create
static Ptr create()
Definition: swapbasedblockallocator.cc:99
TransformPresentation::getTransparentBackground
bool getTransparentBackground() override
Definition: transformpresentation.cc:138
blockallocator.hh
Scroom::MemoryBlobs::Blob::UNINITIALIZED
@ UNINITIALIZED
Definition: memoryblobs.hh:83
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocatorFactory
Definition: swapbasedblockallocator.cc:89
colormappable.hh
Scroom::MemoryBlobs::Blob::load
RawPageData::Ptr load()
Definition: memoryblobs.cc:81
pipetteviewinterface.hh
pixelSizeFromZoom
double pixelSizeFromZoom(int zoom)
Definition: cairo-helpers.cc:112
Scroom::MemoryBlocks::BlockInterface::Ptr
boost::shared_ptr< BlockInterface > Ptr
Definition: blockallocator.hh:46
PresentationBase::viewRemoved
virtual void viewRemoved(ViewInterface::WeakPtr vi)=0
Scroom::Metadata
Definition: showmetadata.hh:13
Scroom::MemoryBlobs::PageProvider::create
static Ptr create(size_t blockCount, size_t blockSize)
Definition: memoryblobs.cc:37
Scroom::Detail::ThreadPool::QueueImpl::mut
boost::mutex mut
Definition: queue.hh:51
Scroom::Utils::make_rect
Rectangle< T > make_rect(T x, T y, T width, T height)
Definition: rectangle.hh:284
require
#define require(expr)
Definition: assertions.hh:28
Detail::ViewData::setStatusMessage
void setStatusMessage(const std::string &string) override
Definition: transformpresentation.cc:173
Scroom::Detail::ThreadPool::FunctionAdditor::functions
std::list< boost::function< void()> > functions
Definition: function-additor.hh:19
TransformPresentation::getAspectRatio
Scroom::Utils::Point< double > getAspectRatio() const override
Definition: transformpresentation.cc:149
Scroom::MemoryBlobs::PageProvider::getPageSize
size_t getPageSize() const
Definition: memoryblobs.cc:61
Scroom::MemoryBlobs::PageProvider::mut
boost::mutex mut
Definition: memoryblobs.hh:49
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(Provider_provides_any_number_of_independent_blocks_of_a_given_size)
Definition: pageprovider-tests.cc:20
Scroom::Utils::Rectangle::getHeight
value_type getHeight() const
Definition: rectangle.hh:123
Scroom::Utils::Point::x
value_type x
Definition: point.hh:111
anonymous_namespace{boost-smart-pointers.cc}::A::Ptr
boost::shared_ptr< A > Ptr
Definition: boost-smart-pointers.cc:25
anonymous_namespace{colormaphelpers_test.cc}::helpers
std::list< Data > helpers
Definition: colormaphelpers_test.cc:41
Scroom::Detail::ThreadPool::QueueImpl::QueueImpl
QueueImpl()=default
TEST
TEST(TransformPresentation_Tests, TransformationData_supports_aspect_ratio)
Definition: transformpresentation_test.cc:41
Scroom::MemoryBlobs::Detail::compressBlob
PageList compressBlob(const uint8_t *in, size_t size, const PageProvider::Ptr &provider)
Definition: blob-compression.cc:30
Scroom::Utils::make_point
Point< T > make_point(T x, T y)
Definition: point.hh:116
Scroom::Bitmap::BitmapSurface::create
static Ptr create(int width, int height, cairo_format_t format)
Definition: bitmap-helpers.cc:13
Scroom::MemoryBlobs::Blob::size
size_t size
Definition: memoryblobs.hh:103
anonymous_namespace{boost-smart-pointers.cc}::A::create
static Ptr create()
Definition: boost-smart-pointers.cc:30
DontDelete
Definition: dont-delete.hh:25
Color::blue
double blue
Definition: color.hh:42
ColormapHelperBase::getColormap
Colormap::Ptr getColormap() override
Definition: colormap-helpers.cc:46
MonochromeColormapHelper::generateInitialColormap
static Colormap::Ptr generateInitialColormap(int numberOfColors, bool inverted)
Definition: colormap-helpers.cc:130
A::set
void set(int v)
Definition: boost-bind.cc:34
Detail::ViewData::addSideWidget
void addSideWidget(std::string title, GtkWidget *w) override
Definition: transformpresentation.cc:167
mix
Color mix(const Color &a, const Color &b, double alpha)
Definition: color.hh:133
Scroom::MemoryBlocks::PageList
std::list< Page > PageList
Definition: blockallocator.hh:41
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::size
size_t size
Definition: swapbasedblockallocator.cc:38
TransformationData::getAspectRatio
Scroom::Utils::Point< double > getAspectRatio() const
Definition: transformpresentation.cc:38
drawOutOfBoundsWithBackground
void drawOutOfBoundsWithBackground(cairo_t *cr, Rectangle< double > const &requestedPresentationArea, Rectangle< double > const &actualPresentationArea, double pixelSize)
Definition: cairo-helpers.cc:74
Detail::ViewData::addToToolbar
void addToToolbar(GtkToolItem *ti) override
Definition: transformpresentation.cc:169
bitmap-helpers.hh
PipetteViewInterface::Ptr
boost::shared_ptr< PipetteViewInterface > Ptr
Definition: pipetteviewinterface.hh:21
Scroom::Detail::ThreadPool::FunctionAdditor::operator()
void operator()()
Definition: function-additor.cc:30
Scroom::MemoryBlobs::RawPageData::Ptr
boost::shared_ptr< uint8_t > Ptr
Definition: memoryblobs.hh:27
TransformationData::create
static Ptr create()
Definition: transformpresentation.cc:28
TransformationData::setAspectRatio
void setAspectRatio(double x, double y)
Definition: transformpresentation.cc:35
Scroom::MemoryBlobs::Page::Ptr
boost::shared_ptr< Scroom::MemoryBlocks::Page > Ptr
Definition: memoryblobs.hh:34
Scroom::Utils::ceil
Point< T > ceil(Point< T > p)
Definition: point.hh:228
anonymous_namespace{boost-smart-pointers.cc}::A::whatever
void whatever()
Definition: boost-smart-pointers.cc:28
Colors::IN_BOUNDS
const Color IN_BOUNDS(1, 1, 1)
SelectionListener::Ptr
boost::shared_ptr< SelectionListener > Ptr
Definition: viewinterface.hh:118
Scroom::MemoryBlocks::getBlockFactoryInterface
BlockFactoryInterface::Ptr getBlockFactoryInterface()
Definition: swapbasedblockallocator.cc:112
Detail::ViewData::getProgressInterface
ProgressInterface::Ptr getProgressInterface() override
Definition: transformpresentation.cc:166
COMPRESS_PRIO
#define COMPRESS_PRIO
Definition: memoryblobs.cc:26
Detail::ViewData::getCurrentPresentation
boost::shared_ptr< PresentationInterface > getCurrentPresentation() override
Definition: transformpresentation.cc:174
MonochromeColormapHelper::inverted
bool inverted
Definition: colormappable.hh:234
MonochromeColormapHelper::transparentBackground
bool transparentBackground
Definition: colormappable.hh:237
Scroom::MemoryBlobs::Blob::mut
boost::mutex mut
Definition: memoryblobs.hh:106
Scroom::MemoryBlobs::Blob::CLEAN
@ CLEAN
Definition: memoryblobs.hh:84
PresentationBase::observerAdded
void observerAdded(Viewable::Ptr const &viewable, Scroom::Bookkeeping::Token const &t) override
Definition: presentationinterface.cc:35
Detail::ViewData::addToolButton
void addToolButton(GtkToggleButton *button, ToolStateListener::Ptr ptr) override
Definition: transformpresentation.cc:175
ColormappablePresentationMock::create
static Ptr create()
Definition: presentationinterface.hh:39
anonymous_namespace{boost-smart-pointers.cc}::A
Definition: boost-smart-pointers.cc:22
TransformPresentation::getProperty
bool getProperty(const std::string &name, std::string &value) override
Definition: transformpresentation.cc:115
drawRectangle
void drawRectangle(cairo_t *cr, Color const &c, Rectangle< double > const &viewArea)
Definition: cairo-helpers.cc:62
MonochromeColormapHelper::createInverted
static Ptr createInverted(int numberOfColors)
Definition: colormap-helpers.cc:77
Color::red
double red
Definition: color.hh:40
Scroom::Utils::Rectangle::moveTo
Rectangle moveTo(xy_type const &other) const
Definition: rectangle.hh:67
Scroom::MemoryBlocks::Detail::anonymous_namespace{swapbasedblockallocator.cc}::DontDelete
Definition: swapbasedblockallocator.cc:25
ColormapHelper::ColormapHelper
ColormapHelper(Colormap::Ptr const &colormap)
Definition: colormap-helpers.cc:62
ColormapHelperBase::colormap
Colormap::Ptr colormap
Definition: colormappable.hh:163
A::Ptr
boost::shared_ptr< A > Ptr
Definition: boost-bind.cc:27
TransformPresentation::Ptr
boost::shared_ptr< TransformPresentation > Ptr
Definition: transformpresentation.hh:83
Colormappable
Definition: colormappable.hh:113
CpuBound
ThreadPool::Ptr CpuBound()
Definition: threadpoolimpl.cc:452
Detail::ViewData::registerSelectionListener
void registerSelectionListener(SelectionListener::Ptr ptr) override
Definition: transformpresentation.cc:171
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::getPages
PageList getPages() override
Definition: swapbasedblockallocator.cc:74
ColormapHelperBase::setOriginalColormap
virtual void setOriginalColormap(Colormap::Ptr colormap)
Definition: colormap-helpers.cc:26
Detail::ViewData::registerPostRenderer
void registerPostRenderer(PostRenderer::Ptr ptr) override
Definition: transformpresentation.cc:172
Scroom::Utils::Rectangle::getBottomRight
xy_type getBottomRight() const
Definition: rectangle.hh:139
Scroom::Bitmap::BitmapSurface::surface
cairo_surface_t *const surface
Definition: bitmap-helpers.hh:28
memoryblobs.hh
PresentationInterface::Ptr
boost::shared_ptr< PresentationInterface > Ptr
Definition: presentationinterface.hh:74
ViewInterface::WeakPtr
boost::weak_ptr< ViewInterface > WeakPtr
Definition: viewinterface.hh:194
A::get
int get() const
Definition: boost-bind.cc:36
ColormapHelperBase::getNumberOfColors
int getNumberOfColors() override
Definition: colormap-helpers.cc:30
async-deleter.hh
Scroom::Utils::Rectangle::below
Rectangle< value_type > below(value_type v) const
Definition: rectangle.hh:158
Scroom::MemoryBlobs::Blob::COMPRESSING
@ COMPRESSING
Definition: memoryblobs.hh:86
Colormap::Ptr
boost::shared_ptr< Colormap > Ptr
Definition: colormappable.hh:31
COLORMAPPABLE_PROPERTY_NAME
const std::string COLORMAPPABLE_PROPERTY_NAME
Definition: colormappable.hh:21
Scroom::Detail::ThreadPool::QueueLock
Definition: queue.hh:63
colormap
const Colormap::Ptr colormap
Definition: colormaphelpers_test.cc:54
color.hh
Scroom::Utils::Rectangle::getWidth
value_type getWidth() const
Definition: rectangle.hh:121
Scroom::Detail::ThreadPool::QueueLock::QueueLock
QueueLock(QueueImpl::Ptr queue)
QueueLock.
Definition: queue.cc:55
TransformPresentation::showMetaDataInterface
ShowMetadataInterface::Ptr showMetaDataInterface
Definition: transformpresentation.hh:89
Scroom::Utils::Rectangle::getRight
value_type getRight() const
Definition: rectangle.hh:114
TransformPresentation::getMonochromeColor
Color getMonochromeColor() override
Definition: transformpresentation.cc:130
anonymous_namespace{colormaphelpers_test.cc}::Data::helper
ColormapHelper::Ptr helper
Definition: colormaphelpers_test.cc:29
Scroom::Detail::ThreadPool::FunctionAdditor::operator+=
FunctionAdditor & operator+=(boost::function< void()> const &fn)
Definition: function-additor.cc:23
Scroom::Detail::ThreadPool::QueueImpl::Ptr
boost::shared_ptr< QueueImpl > Ptr
Definition: queue.hh:25
Colormap::createDefaultInverted
static Colormap::Ptr createDefaultInverted(int n)
Definition: colormappable.hh:67
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::on_metadata_destroyed
void on_metadata_destroyed(GtkWidget *, gpointer user_data)
Definition: showmetadata.cc:62
Scroom::Utils::Base
Definition: utilities.hh:30
PresentationBase::open
void open(ViewInterface::WeakPtr vi) override
Definition: presentationinterface.cc:11
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::MetaDataWindowData::data
Metadata data
Definition: showmetadata.cc:23
Scroom::MemoryBlocks
Definition: blockallocator.hh:19
Scroom::Bitmap::BitmapSurface::get
cairo_surface_t * get()
Definition: bitmap-helpers.cc:26
ColormapHelperBase::Ptr
boost::shared_ptr< ColormapHelperBase > Ptr
Definition: colormappable.hh:160
MonochromeColormapHelper::setMonochromeColor
void setMonochromeColor(const Color &c) override
Definition: colormap-helpers.cc:92
MonochromeColormapHelper::numberOfColors
int numberOfColors
Definition: colormappable.hh:233
blob-compression.hh
ColormappablePresentationMock::Ptr
boost::shared_ptr< ColormappablePresentationMock > Ptr
Definition: presentationinterface.hh:37
anonymous_namespace{progressbarmanager.cc}::instance
ProgressBarPulser::Ptr instance()
Definition: progressbarmanager.cc:43
PresentationBase::viewAdded
virtual void viewAdded(ViewInterface::WeakPtr vi)=0
TransformPresentation::create
static Ptr create(PresentationInterface::Ptr const &presentation, TransformationData::Ptr const &transformationData)
Definition: transformpresentation.cc:51
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::create
static BlockInterface::Ptr create(size_t count, size_t size)
Definition: swapbasedblockallocator.cc:69
BOOST_REQUIRE
BOOST_REQUIRE(originalColormap)
Scroom::MemoryBlobs::Blob::compress
void compress()
Definition: memoryblobs.cc:136
Scroom::MemoryBlobs::PageProvider::blockSize
size_t blockSize
Definition: memoryblobs.hh:45
framework
This tests some features of the underlying framework
Definition: README.txt:1
Colors
Definition: cairo-helpers.hh:19
TransformPresentation::getOriginalColormap
Colormap::Ptr getOriginalColormap() override
Definition: transformpresentation.cc:126
ColormapHelperBase::getMonochromeColor
Color getMonochromeColor() override
Definition: colormap-helpers.cc:32
Scroom::Detail::ThreadPool::QueueImpl::count
unsigned int count
Definition: queue.hh:53
Scroom::Bitmap::BitmapSurface::~BitmapSurface
~BitmapSurface()
Definition: bitmap-helpers.cc:24
views
static Views views
Definition: callbacks.cc:56
Detail::ViewData::Ptr
boost::shared_ptr< ViewData > Ptr
Definition: transformpresentation.hh:45
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::addNewValueToGrid
GtkWidget * addNewValueToGrid(const GtkWidget *grid, const std::string &valueText, GtkWidget *key)
Definition: showmetadata.cc:47
Scroom::Detail::ThreadPool::QueueImpl::create
static Ptr create()
QueueImpl.
Definition: queue.cc:18
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::addNewKeyToGrid
GtkWidget * addNewKeyToGrid(const GtkWidget *grid, GtkWidget *previousKey, const std::string &keyText)
Definition: showmetadata.cc:33
A::create
static Ptr create(int &i)
Definition: boost-bind.cc:38
Detail::ViewData::image
Scroom::Bitmap::BitmapSurface::Ptr image
Definition: transformpresentation.hh:50
Scroom::MemoryBlobs::Blob::getConst
RawPageData::ConstPtr getConst()
Definition: memoryblobs.cc:168
TransformPresentation::presentation
PresentationInterface::Ptr presentation
Definition: transformpresentation.hh:87
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::gtk_label_with_markup
GtkWidget * gtk_label_with_markup(const char *text)
Definition: showmetadata.cc:26
Scroom::Detail::ThreadPool::QueueLock::~QueueLock
~QueueLock()
Definition: queue.cc:63
Scroom::MemoryBlobs
Definition: memoryblobs.hh:23
viewinterface.hh
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator
Definition: swapbasedblockallocator.cc:32
Scroom::Utils::Rectangle::getLeft
value_type getLeft() const
Definition: rectangle.hh:110
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(allocator_provides_a_number_of_independent_blocks_of_a_given_size)
Definition: swap-block-allocator-tests.cc:20
points_are_close
bool points_are_close(Scroom::Utils::Point< double > const &a, Scroom::Utils::Point< double > const &b)
Definition: transformpresentation_test.cc:29
TransformPresentation::redraw
void redraw(ViewInterface::Ptr const &vi, cairo_t *cr, Scroom::Utils::Rectangle< double > presentationArea, int zoom) override
Definition: transformpresentation.cc:81
Scroom::MemoryBlobs::PageProvider::blockFactoryInterface
Scroom::MemoryBlocks::BlockFactoryInterface::Ptr blockFactoryInterface
Definition: memoryblobs.hh:46
Detail::ViewData::invalidate
void invalidate() override
Definition: transformpresentation.cc:160
PresentationBase::close
void close(ViewInterface::WeakPtr vi) override
Definition: presentationinterface.cc:23
pixelSizeFromZoom
double pixelSizeFromZoom(int zoom)
Definition: cairo-helpers.cc:112
TransformPresentation::colormappable
Colormappable::Ptr colormappable
Definition: transformpresentation.hh:88
MonochromeColormapHelper::setTransparentBackground
void setTransparentBackground() override
Definition: colormap-helpers.cc:135
Scroom::Utils::Rectangle::height
value_type height() const
Definition: rectangle.hh:131
A::A
A(int &i_)
Definition: boost-bind.cc:29
Scroom::MemoryBlobs::Blob::create
static Ptr create(PageProvider::Ptr provider, size_t size)
Definition: memoryblobs.cc:71
Scroom::MemoryBlobs::PageProvider::markPageFree
void markPageFree(Scroom::MemoryBlocks::Page *page)
Definition: memoryblobs.cc:63
Detail::ViewData::create
static ViewData::Ptr create(const ViewInterface::WeakPtr &parent)
Definition: transformpresentation.cc:176
dont-delete.hh
Colormappable::Ptr
boost::shared_ptr< Colormappable > Ptr
Definition: colormappable.hh:116
Scroom::MemoryBlobs::PageProvider::blockCount
size_t blockCount
Definition: memoryblobs.hh:44
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocator::get
RawPageData::Ptr get(size_t id) override
Definition: swapbasedblockallocator.cc:59
Scroom::Utils::Rectangle::above
Rectangle< value_type > above(value_type v) const
Definition: rectangle.hh:153
A
Definition: boost-bind.cc:21
Scroom::Detail::ThreadPool::FunctionMultiplier
Definition: function-additor.hh:30
b
static void b(const B::Ptr &)
Definition: gtkhelper-tests.cc:32
ColormapHelper::create
static Ptr create(int numberOfColors)
Definition: colormap-helpers.cc:55
ColormapHelperBase::setColormap
void setColormap(Colormap::Ptr colormap) override
Definition: colormap-helpers.cc:24
function-additor.hh
anonymous_namespace{colormaphelpers_test.cc}::accuracy
const double accuracy
Definition: colormaphelpers_test.cc:25
presentationinterface.hh
anonymous_namespace{colormaphelpers_test.cc}::Data::expectedColors
int expectedColors
Definition: colormaphelpers_test.cc:30
A::i
int & i
Definition: boost-bind.cc:24
Scroom::MemoryBlocks::Detail::anonymous_namespace{swapbasedblockallocator.cc}::DontDelete::operator()
void operator()(T *)
Definition: swapbasedblockallocator.cc:28
traceRectangleContour
void traceRectangleContour(cairo_t *cr, Rectangle< double > const &viewArea)
Definition: cairo-helpers.cc:22
Scroom::Detail::ThreadPool::FunctionAdditor::addBefore
void addBefore(boost::function< void()> const &fn)
Definition: function-additor.cc:10
Scroom::Bitmap::BitmapSurface
Definition: bitmap-helpers.hh:22
TransformPresentation::open
void open(ViewInterface::WeakPtr vi) override
Definition: transformpresentation.cc:62
Scroom::Bitmap
Definition: bitmap-helpers.hh:20
setClip
void setClip(cairo_t *cr, double x, double y, double width, double height)
Definition: cairo-helpers.cc:47
Scroom::Metadata::Metadata
std::vector< std::pair< std::string, std::string > > Metadata
Definition: showmetadata.hh:15
MonochromeColormapHelper::regenerateColormap
void regenerateColormap()
Definition: colormap-helpers.cc:108
ColormapHelperBase::setTransparentBackground
void setTransparentBackground() override
Definition: colormap-helpers.cc:40
defect_message
#define defect_message(m)
Definition: assertions.hh:43
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::MetaDataWindowData::title
std::string title
Definition: showmetadata.cc:22
Scroom::MemoryBlocks::BlockFactoryInterface::Ptr
boost::shared_ptr< BlockFactoryInterface > Ptr
Definition: blockallocator.hh:61
Scroom::Detail::ThreadPool::QueueLock::operator=
QueueLock & operator=(const QueueLock &)=delete
Detail
Definition: async-deleter.hh:12
Scroom::MemoryBlocks::Detail::SwapBasedBlockAllocatorFactory::SwapBasedBlockAllocatorFactory
SwapBasedBlockAllocatorFactory()=default
Scroom::MemoryBlobs::Detail::decompressBlob
void decompressBlob(uint8_t *out, size_t size, PageList list, const PageProvider::Ptr &provider)
Definition: blob-compression.cc:70
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(regular_colormaps_cant_have_their_colors_set)
Definition: colormaphelpers_test.cc:60
drawOutOfBoundsWithBackgroundColor
void drawOutOfBoundsWithBackgroundColor(cairo_t *cr, const Color &background, Rectangle< double > const &requestedPresentationArea, Rectangle< double > const &actualPresentationArea, double pixelSize)
Definition: cairo-helpers.cc:83
Scroom::Utils::Rectangle::y
value_type y() const
Definition: rectangle.hh:127
Scroom::Tiff::open
boost::optional< std::tuple< Scroom::TiledBitmap::BitmapMetaData, TIFFPtr > > open(const std::string &fileName)
Definition: tiffsource.cc:119
Detail::ViewData::removeSideWidget
void removeSideWidget(GtkWidget *w) override
Definition: transformpresentation.cc:168
Scroom::MemoryBlobs::Blob::data
uint8_t * data
Definition: memoryblobs.hh:104
ColormapHelperBase::disableTransparentBackground
void disableTransparentBackground() override
Definition: colormap-helpers.cc:42
queue.hh
transformpresentation.hh
MonochromeColormapHelper::getProperties
std::map< std::string, std::string > getProperties() override
Definition: colormap-helpers.cc:149
Color::setAlpha
Color & setAlpha(double alpha_)
Definition: color.hh:128
TransformPresentation::close
void close(ViewInterface::WeakPtr vi) override
Definition: transformpresentation.cc:72
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(blobs_retain_their_data)
Definition: blob-tests.cc:21
out
SampleIterator< uint8_t > out(output, 0, bps)
Scroom::Detail::ThreadPool::FunctionMultiplier::operator*
FunctionMultiplier & operator*(unsigned int i)
Definition: function-additor.cc:46
Scroom::Detail::ThreadPool::QueueLock::isValid
bool isValid
Definition: queue.hh:66
Scroom::Bookkeeping::Token
Definition: bookkeeping.hh:37
Scroom::MemoryBlobs::Blob::DIRTY
@ DIRTY
Definition: memoryblobs.hh:85
unused.hh
MonochromeColormapHelper::getTransparentBackground
bool getTransparentBackground() override
Definition: colormap-helpers.cc:147
Scroom::Utils::Rectangle
Definition: rectangle.hh:22
Scroom::Metadata::anonymous_namespace{showmetadata.cc}::MetaDataWindowData
Definition: showmetadata.cc:20
ShowMetadataInterface
Definition: showmetadatainterface.hh:18
Scroom::Bitmap::BitmapSurface::BitmapSurface
BitmapSurface(const BitmapSurface &)=delete
Detail::ViewData::parent
ViewInterface::Ptr parent() const
Definition: transformpresentation.cc:158
MonochromeColormapHelper::MonochromeColormapHelper
MonochromeColormapHelper(int numberOfColors, bool inverted)
Definition: colormap-helpers.cc:82
Viewable::Ptr
boost::shared_ptr< Viewable > Ptr
Definition: presentationinterface.hh:35
Scroom::MemoryBlocks::BlockFactoryInterface
Definition: blockallocator.hh:58
ColormapHelper::createInverted
static Ptr createInverted(int numberOfColors)
Definition: colormap-helpers.cc:57
Color
Definition: color.hh:34
TransformPresentation::viewData
std::map< ViewInterface::WeakPtr, Detail::ViewData::Ptr > viewData
Definition: transformpresentation.hh:90
cairo-helpers.hh
Scroom::MemoryBlobs::Blob::pages
PageList pages
Definition: memoryblobs.hh:108
rectangle.hh
Scroom::Detail::ThreadPool::QueueImpl::jobFinished
void jobFinished()
Definition: queue.cc:38
ToolStateListener::Ptr
boost::shared_ptr< ToolStateListener > Ptr
Definition: viewinterface.hh:164
Scroom::Utils::Rectangle::getTop
value_type getTop() const
Definition: rectangle.hh:108
BOOST_DATA_TEST_CASE
BOOST_DATA_TEST_CASE(arithmetic, data::make(bit_depths) *data::make(initial_offsets) *data::make(deltas), bps, initial_offset, delta)
Definition: sampleiterator-tests.cc:69
ViewInterface
Definition: viewinterface.hh:190
Color::green
double green
Definition: color.hh:41
Scroom::Utils::Rectangle::leftOf
Rectangle< value_type > leftOf(value_type v) const
Definition: rectangle.hh:143
create
void create(NewPresentationInterface *interface)
Definition: loader.cc:175
anonymous_namespace{colormaphelpers_test.cc}::Blue
const Color Blue(0, 0, 1)
TransformPresentation::TransformPresentation
TransformPresentation(PresentationInterface::Ptr const &presentation, TransformationData::Ptr transformationData)
Definition: transformpresentation.cc:42
Scroom::Utils::Point::y
value_type y
Definition: point.hh:112
TransformPresentation::showMetadata
void showMetadata(GtkWindow *parent) override
Definition: transformpresentation.cc:140
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(bind_copies_smart_pointer)
Definition: boost-smart-pointers.cc:38
TransformPresentation::transformationData
TransformationData::Ptr transformationData
Definition: transformpresentation.hh:86
Scroom::MemoryBlobs::Blob::unload
void unload()
Definition: memoryblobs.cc:117
Scroom::MemoryBlobs::Blob::Blob
Blob(PageProvider::Ptr provider, size_t size)
Definition: memoryblobs.cc:73
Scroom::MemoryBlobs::PageProvider::getFreePage
Page::Ptr getFreePage()
Definition: memoryblobs.cc:42
anonymous_namespace{colormaphelpers_test.cc}::Data::Data
Data(int expectedColors_, ColormapHelper::Ptr helper_)
Definition: colormaphelpers_test.cc:32
anonymous_namespace{colormaphelpers_test.cc}::Data
Definition: colormaphelpers_test.cc:27
rects_are_close
bool rects_are_close(Scroom::Utils::Rectangle< double > const &a, Scroom::Utils::Rectangle< double > const &b)
Definition: transformpresentation_test.cc:34
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(keeps_object_alive_while_setting)
Definition: boost-bind.cc:45
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(compression_decompression_retains_data)
Definition: compression-tests.cc:21
Scroom::MemoryBlobs::Blob::get
RawPageData::Ptr get()
Definition: memoryblobs.cc:151
ColormapHelperBase::getTransparentBackground
bool getTransparentBackground() override
Definition: colormap-helpers.cc:44
MonochromeColormapHelper::getMonochromeColor
Color getMonochromeColor() override
Definition: colormap-helpers.cc:106
Scroom::MemoryBlobs::Blob::state
State state
Definition: memoryblobs.hh:105
Scroom::Utils::Point< double >
PostRenderer::Ptr
boost::shared_ptr< PostRenderer > Ptr
Definition: viewinterface.hh:83
Scroom::MemoryBlobs::Blob::cpuBound
boost::shared_ptr< ThreadPool > cpuBound
Definition: memoryblobs.hh:109
Detail::ViewData::removeFromToolbar
void removeFromToolbar(GtkToolItem *ti) override
Definition: transformpresentation.cc:170
TransformationData::TransformationData
TransformationData()
Definition: transformpresentation.cc:18