#include <transformpresentation.hh>
◆ Ptr
◆ TransformPresentation()
◆ close()
Gets called just before the View is destroyed
- Precondition
- Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)
Reimplemented from PresentationBase.
74 auto data =
viewData.at(viewInterface);
◆ create()
◆ disableTransparentBackground()
| void TransformPresentation::disableTransparentBackground |
( |
| ) |
|
|
overridevirtual |
◆ getAspectRatio()
◆ getMonochromeColor()
| Color TransformPresentation::getMonochromeColor |
( |
| ) |
|
|
overridevirtual |
◆ getNumberOfColors()
| int TransformPresentation::getNumberOfColors |
( |
| ) |
|
|
overridevirtual |
Retrieve the number of colors in use by the presentation
Implements Colormappable.
◆ getOriginalColormap()
◆ getPixelAverages()
Returns the average pixel values for each component, contained in the area.
- Parameters
-
| area | selected area to get the pixel values from. |
Implements PipetteViewInterface.
146 return pipettePresentation->getPixelAverages(area /
getAspectRatio());
◆ getProperty()
| bool TransformPresentation::getProperty |
( |
const std::string & |
name, |
|
|
std::string & |
value |
|
) |
| |
|
overridevirtual |
Return the value of the requested property
- Parameters
-
| [in] | name | The name of the requested property |
| [out] | value | The value of the requested property |
- Return values
-
| true | if the property existed |
| false | if the property didn't exist |
Implements PresentationInterface.
◆ getRect()
◆ getTitle()
| std::string TransformPresentation::getTitle |
( |
| ) |
|
|
overridevirtual |
◆ getTransparentBackground()
| bool TransformPresentation::getTransparentBackground |
( |
| ) |
|
|
overridevirtual |
◆ isPropertyDefined()
| bool TransformPresentation::isPropertyDefined |
( |
const std::string & |
name | ) |
|
|
overridevirtual |
◆ open()
Gets called just after the View is created
- Precondition
- Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)
Reimplemented from PresentationBase.
66 auto& [_, data] = *it;
◆ redraw()
Draw the requested ara at the requested zoom level
- Parameters
-
| vi | The ViewInterface on whose behalf the request is made |
| cr | The context to draw the area on |
| presentationArea | the area that is to be drawn. The given x and y coordinates should map on 0,0 of the given context cr. |
| zoom | The requested zoom level. One pixel of your presentation should have size 2**zoom when drawn. zoom may be negative. |
Implements PresentationInterface.
89 if(data->presentationArea != presentationArea || data->zoom != zoom)
96 auto viewArea =
ceil((presentationArea * pixelSize / aspectRatio).getSize()).to<
int>();
100 cairo_surface_t* surface = data->image->get();
101 cairo_t* image_cr = cairo_create(surface);
103 presentation->redraw(data, image_cr, presentationArea / aspectRatio, zoom);
105 cairo_destroy(image_cr);
109 cairo_scale(cr, aspectRatio.
x, aspectRatio.
y);
110 cairo_set_source_surface(cr, data->image->get(), 0, 0);
◆ setColormap()
| void TransformPresentation::setColormap |
( |
Colormap::Ptr |
colormap | ) |
|
|
overridevirtual |
Request that the presentation use the given colormap
Implements Colormappable.
◆ setMonochromeColor()
| void TransformPresentation::setMonochromeColor |
( |
const Color & |
c | ) |
|
|
overridevirtual |
◆ setTransparentBackground()
| void TransformPresentation::setTransparentBackground |
( |
| ) |
|
|
overridevirtual |
◆ showMetadata()
| void TransformPresentation::showMetadata |
( |
GtkWindow * |
parent | ) |
|
|
overridevirtual |
Request to show a window containing the presentation metadata
- Parameters
-
| parent | the parent window, if found. Nullptr otherwise |
Implements ShowMetadataInterface.
◆ colormappable
◆ presentation
◆ showMetaDataInterface
◆ transformationData
◆ viewData
The documentation for this class was generated from the following files:
#define require(expr)
Definition: assertions.hh:28
value_type x
Definition: point.hh:111
static Ptr create(int width, int height, cairo_format_t format)
Definition: bitmap-helpers.cc:13
boost::shared_ptr< PipetteViewInterface > Ptr
Definition: pipetteviewinterface.hh:21
Point< T > ceil(Point< T > p)
Definition: point.hh:228
const Colormap::Ptr colormap
Definition: colormaphelpers_test.cc:54
void open(ViewInterface::WeakPtr vi) override
Definition: presentationinterface.cc:11
void close(ViewInterface::WeakPtr vi) override
Definition: presentationinterface.cc:23
double pixelSizeFromZoom(int zoom)
Definition: cairo-helpers.cc:112
static ViewData::Ptr create(const ViewInterface::WeakPtr &parent)
Definition: transformpresentation.cc:176
value_type y
Definition: point.hh:112