Scroom 0.14-48-ga0fee447
Loading...
Searching...
No Matches
Scroom::Utils::TweakGridSelection Class Reference

#include <tweak-view.hh>

Inheritance diagram for Scroom::Utils::TweakGridSelection:
Inheritance graph
Collaboration diagram for Scroom::Utils::TweakGridSelection:
Collaboration graph

Public Member Functions

Rectangle< double > tweakSelection (const Rectangle< double > &selection) const override
 
virtual Rectangle< double > tweakSelection (const Rectangle< double > &selection) const=0
 
Selection tweakSelection (const Selection &selection) const override
 
 TweakSelection (const Point< double > &aspectRatio_)
 
- Public Member Functions inherited from Scroom::Utils::TweakSelection
Selection tweakSelection (const Selection &selection) const override
 
- Public Member Functions inherited from Interface
 Interface ()=default
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
 Interface (Interface &&)=delete
 
Interfaceoperator= (Interface &&)=delete
 
virtual ~Interface ()=default
 

Static Public Member Functions

static ITweakSelection::Ptr create (const Point< double > &aspectRatio_)
 

Additional Inherited Members

- Public Types inherited from Scroom::Utils::TweakSelection
using Ptr = std::shared_ptr< TweakSelection >
 
- Public Types inherited from Scroom::Utils::ITweakSelection
using Ptr = std::shared_ptr< ITweakSelection >
 
using Map = std::map< std::string, ITweakSelection::Ptr >
 
- Protected Member Functions inherited from Scroom::Utils::TweakSelection
 TweakSelection (const Point< double > &aspectRatio_)
 
- Protected Attributes inherited from Scroom::Utils::TweakSelection
Point< double > aspectRatio
 

Member Function Documentation

◆ create()

ITweakSelection::Ptr Scroom::Utils::TweakGridSelection::create ( const Point< double > &  aspectRatio_)
static
154 {
155 return Ptr(new TweakGridSelection(aspectRatio_));
156 }
std::shared_ptr< TweakSelection > Ptr
Definition tweak-view.hh:107

Referenced by TransformPresentation::TransformPresentation().

Here is the caller graph for this function:

◆ TweakSelection()

Scroom::Utils::TweakSelection::TweakSelection ( const Point< double > &  aspectRatio_)
explicit
133 : aspectRatio(aspectRatio_)
134 {
135 }
Point< double > aspectRatio
Definition tweak-view.hh:117

◆ tweakSelection() [1/3]

Rectangle< double > Scroom::Utils::TweakGridSelection::tweakSelection ( const Rectangle< double > &  selection) const
overridevirtual

Implements Scroom::Utils::TweakSelection.

159 {
161 }
Rectangle< double > roundCorners(Rectangle< double > r)
Definition rectangle.hh:345
auto selection
Definition pipette-tests.cc:157
Here is the call graph for this function:

◆ tweakSelection() [2/3]

virtual Rectangle< double > Scroom::Utils::TweakSelection::tweakSelection ( const Rectangle< double > &  selection) const
virtual

◆ tweakSelection() [3/3]

Selection Scroom::Utils::TweakSelection::tweakSelection ( const Selection selection) const
overridevirtual

Implements Scroom::Utils::ITweakSelection.

138 {
139 const auto original = toRectangle(selection);
140 const auto tweaked = tweakSelection(original);
141
142 const auto startCorner = find_closest_corner(selection.start, original);
143 const auto endCorner = find_opposed_corner(startCorner);
144
145 const auto start = corner_getter(startCorner)(tweaked);
146 const auto end = corner_getter(endCorner)(tweaked);
147
148 return {start, end};
149 }
Rectangle< double > tweakSelection(const Rectangle< double > &selection) const override
Definition tweak-view.cc:158
Corner find_closest_corner(const Point< double > &p, const Rectangle< double > &r)
Definition tweak-view.cc:63
Rectangle< double > toRectangle(const Selection &s)
Definition tweak-view.cc:91
Corner find_opposed_corner(Corner c)
Definition tweak-view.cc:75
std::function< Point< double >(const Rectangle< double > &)> corner_getter(Corner c)
Definition tweak-view.cc:47
const SampleIterator< const uint8_t > start(nullptr, initial_offset, bps)
Here is the call graph for this function:

The documentation for this class was generated from the following files: