Scroom  0.14
colormapplugin.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 <list>
11 #include <string>
12 
16 #include <scroom/utilities.hh>
17 
18 namespace Scroom::ColormapImpl
19 {
24  , public PresentationObserver
25  , virtual public Scroom::Utils::Base
26  {
27  public:
28  using Ptr = boost::shared_ptr<ColormapPlugin>;
29 
30  private:
31  std::list<PresentationInterface::WeakPtr> presentations;
32 
33  private:
34  ColormapPlugin() = default;
35 
36  public:
37  static Ptr create();
38 
39  public:
40  std::string getPluginName() override;
41  std::string getPluginVersion() override;
43 
45  void presentationDeleted() override;
46  };
47 
48 } // namespace Scroom::ColormapImpl
Scroom::ColormapImpl::ColormapPlugin::getPluginName
std::string getPluginName() override
Definition: colormapplugin.cc:25
Scroom::Utils::on_scope_exit
Definition: utilities.hh:56
Scroom::Utils::Rectangle::getTopLeft
xy_type getTopLeft() const
Definition: rectangle.hh:133
Scroom::Utils::Rectangle< int >::x
value_type x() const
Definition: rectangle.hh:125
Scroom::Utils
Definition: assertions.hh:14
Scroom::Utils::Rectangle::rightOf
Rectangle< value_type > rightOf(value_type v) const
Definition: rectangle.hh:148
test_types
boost::mpl::list< Segment< int >, RectangleHorizontalTestScaffold, RectangleVerticalTestScaffold > test_types
Definition: rectangletests.cc:101
RectangleVerticalTestScaffold::contains
bool contains(int y) const
Definition: rectangletests.cc:89
Scroom::Utils::Rectangle::getVertically
const Segment< value_type > & getVertically() const
Definition: rectangle.hh:259
Scroom::ColormapImpl
Definition: colormapplugin.cc:21
RectangleVerticalTestScaffold::getEnd
int getEnd() const
Definition: rectangletests.cc:88
PresentationObserver
Definition: scroominterface.hh:80
RectangleHorizontalTestScaffold::intersection
RectangleHorizontalTestScaffold intersection(const RectangleHorizontalTestScaffold &other) const
Definition: rectangletests.cc:54
Scroom::ColormapImpl::ColormapPlugin::presentations
std::list< PresentationInterface::WeakPtr > presentations
Definition: colormapplugin.hh:31
presentationinterface.hh
utilities.hh
RectangleHorizontalTestScaffold::verticalStart
static const int verticalStart
Definition: rectangletests.cc:28
RectangleHorizontalTestScaffold
Definition: rectangletests.cc:25
Scroom::Utils::Rectangle::getBottomLeft
xy_type getBottomLeft() const
Definition: rectangle.hh:137
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(sample.expectedColors, originalColormap->colors.size())
RectangleVerticalTestScaffold
Definition: rectangletests.cc:65
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(test_on_scope_exit)
Definition: scope-exit-tests.cpp:16
Scroom::ColormapImpl::ColormapPlugin::ColormapPlugin
ColormapPlugin()=default
colormappable.hh
plugininformationinterface.hh
Scroom::Utils::make_rect
Rectangle< T > make_rect(T x, T y, T width, T height)
Definition: rectangle.hh:284
RectangleVerticalTestScaffold::getStart
int getStart() const
Definition: rectangletests.cc:87
containedSegmentEqualsIntersection
void containedSegmentEqualsIntersection(const Scaffold &container, const Scaffold &contained)
Definition: rectangletests.cc:109
Scroom::ColormapImpl::ColormapPlugin::Ptr
boost::shared_ptr< ColormapPlugin > Ptr
Definition: colormapplugin.hh:28
Scroom::Utils::Rectangle< int >::getHeight
value_type getHeight() const
Definition: rectangle.hh:123
RectangleHorizontalTestScaffold::RectangleHorizontalTestScaffold
RectangleHorizontalTestScaffold()=default
RectangleVerticalTestScaffold::horizontalSize
static const int horizontalSize
Definition: rectangletests.cc:71
Scroom::Utils::make_point
Point< T > make_point(T x, T y)
Definition: point.hh:116
RectangleHorizontalTestScaffold::verticalContainedStart
static const int verticalContainedStart
Definition: rectangletests.cc:29
Scroom::ColormapImpl::ColormapPlugin::registerCapabilities
void registerCapabilities(ScroomPluginInterface::Ptr host) override
Definition: colormapplugin.cc:29
PluginInformationInterface::Ptr
boost::shared_ptr< PluginInformationInterface > Ptr
Definition: plugininformationinterface.hh:20
RectangleVerticalTestScaffold::getSize
int getSize() const
Definition: rectangletests.cc:86
RectangleHorizontalTestScaffold::getSize
int getSize() const
Definition: rectangletests.cc:46
Scroom::ColormapImpl::ColormapPlugin::create
static Ptr create()
Definition: colormapplugin.cc:23
RectangleVerticalTestScaffold::intersection
RectangleVerticalTestScaffold intersection(const RectangleVerticalTestScaffold &other) const
Definition: rectangletests.cc:93
RectangleHorizontalTestScaffold::getStart
int getStart() const
Definition: rectangletests.cc:48
RectangleHorizontalTestScaffold::RectangleHorizontalTestScaffold
RectangleHorizontalTestScaffold(int horizontalStart, int horizontalSize)
Definition: rectangletests.cc:34
RectangleHorizontalTestScaffold::RectangleHorizontalTestScaffold
RectangleHorizontalTestScaffold(const Rectangle< int > &r)
Definition: rectangletests.cc:41
RectangleVerticalTestScaffold::RectangleVerticalTestScaffold
RectangleVerticalTestScaffold()=default
Scroom::Utils::Rectangle::getBottomRight
xy_type getBottomRight() const
Definition: rectangle.hh:139
RectangleHorizontalTestScaffold::verticalContainedWidth
static const int verticalContainedWidth
Definition: rectangletests.cc:30
PresentationInterface::Ptr
boost::shared_ptr< PresentationInterface > Ptr
Definition: presentationinterface.hh:74
RectangleVerticalTestScaffold::contains
bool contains(const RectangleVerticalTestScaffold &other) const
Definition: rectangletests.cc:91
Scroom::ColormapImpl::ColormapProvider::Ptr
boost::shared_ptr< ColormapProvider > Ptr
Definition: colormapprovider.hh:33
Scroom::Utils::Rectangle::below
Rectangle< value_type > below(value_type v) const
Definition: rectangle.hh:158
COLORMAPPABLE_PROPERTY_NAME
const std::string COLORMAPPABLE_PROPERTY_NAME
Definition: colormappable.hh:21
Scroom::Utils::Rectangle< int >::getWidth
value_type getWidth() const
Definition: rectangle.hh:121
Scroom::ColormapImpl::ColormapProvider::create
static ColormapProvider::Ptr create(const PresentationInterface::Ptr &p)
Definition: colormapprovider.cc:47
RectangleVerticalTestScaffold::moveTo
Rectangle moveTo(int y)
Definition: rectangletests.cc:98
RectangleVerticalTestScaffold::horizontalContainedWidth
static const int horizontalContainedWidth
Definition: rectangletests.cc:70
Scroom::Utils::Base
Definition: utilities.hh:30
Scroom::Utils::on_destruction
boost::shared_ptr< void > on_destruction(F f)
Definition: utilities.hh:75
Scroom::ColormapImpl::ColormapPlugin::getPluginVersion
std::string getPluginVersion() override
Definition: colormapplugin.cc:27
RectangleHorizontalTestScaffold::getEnd
int getEnd() const
Definition: rectangletests.cc:49
RectangleVerticalTestScaffold::horizontalContainedStart
static const int horizontalContainedStart
Definition: rectangletests.cc:69
scroominterface.hh
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(testRetrievingHorizontallyAndVertically)
Definition: rectangletests.cc:313
Scroom::Utils::optional_cleanup
Definition: utilities.hh:81
RectangleVerticalTestScaffold::RectangleVerticalTestScaffold
RectangleVerticalTestScaffold(int verticalStart, int verticalSize)
Definition: rectangletests.cc:74
BOOST_AUTO_TEST_CASE_TEMPLATE
BOOST_AUTO_TEST_CASE_TEMPLATE(testCreateSegment, Scaffold, test_types)
Definition: rectangletests.cc:127
Scroom::Utils::Rectangle< int >::getLeft
value_type getLeft() const
Definition: rectangle.hh:110
Scroom::ColormapImpl::ColormapPlugin::presentationAdded
void presentationAdded(PresentationInterface::Ptr p) override
Definition: colormapplugin.cc:34
Scroom::Utils::Segment
Definition: linearsegment.hh:44
PluginInformationInterface
Definition: plugininformationinterface.hh:17
Scroom::Utils::Rectangle::getTopRight
xy_type getTopRight() const
Definition: rectangle.hh:135
Scroom::Utils::Rectangle::getHorizontally
const Segment< value_type > & getHorizontally() const
Definition: rectangle.hh:257
colormapplugin.hh
RectangleHorizontalTestScaffold::contains
bool contains(const RectangleHorizontalTestScaffold &other) const
Definition: rectangletests.cc:52
gtk-helpers.hh
Scroom::Utils::Rectangle::above
Rectangle< value_type > above(value_type v) const
Definition: rectangle.hh:153
ScroomPluginInterface::Ptr
boost::shared_ptr< ScroomPluginInterface > Ptr
Definition: scroominterface.hh:102
b
static void b(const B::Ptr &)
Definition: gtkhelper-tests.cc:32
RectangleHorizontalTestScaffold::moveTo
Rectangle moveTo(int x)
Definition: rectangletests.cc:59
colormapprovider.hh
Scroom::Utils::Rectangle< int >::y
value_type y() const
Definition: rectangle.hh:127
Scroom::Utils::make_segment
Segment< T > make_segment(T start, T size)
Definition: linearsegment.hh:223
RectangleHorizontalTestScaffold::contains
bool contains(int x) const
Definition: rectangletests.cc:50
linearsegment.hh
Scroom::Utils::Rectangle
Definition: rectangle.hh:22
RectangleHorizontalTestScaffold::verticalSize
static const int verticalSize
Definition: rectangletests.cc:31
Scroom::GtkHelpers::createCairoIntRectangle
cairo_rectangle_int_t createCairoIntRectangle(int x, int y, int width, int height)
Definition: gtk-helpers.hh:71
intersectsImpliesNonEmptyIntersection
void intersectsImpliesNonEmptyIntersection(const Scaffold &a, const Scaffold &b)
Definition: rectangletests.cc:119
Scroom::ColormapImpl::ColormapPlugin
Definition: colormapplugin.hh:22
rectangle.hh
Scroom::Utils::Rectangle< int >::getTop
value_type getTop() const
Definition: rectangle.hh:108
Scroom::Utils::Rectangle::leftOf
Rectangle< value_type > leftOf(value_type v) const
Definition: rectangle.hh:143
RectangleVerticalTestScaffold::horizontalStart
static const int horizontalStart
Definition: rectangletests.cc:68
RectangleVerticalTestScaffold::RectangleVerticalTestScaffold
RectangleVerticalTestScaffold(const Rectangle< int > &r)
Definition: rectangletests.cc:81
Scroom::ColormapImpl::ColormapPlugin::presentationDeleted
void presentationDeleted() override
Definition: colormapplugin.cc:44
Scroom::Utils::Point
Definition: point.hh:23