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