Scroom 0.14-48-ga0fee447
Loading...
Searching...
No Matches
Scroom::Utils::TweakSelection Class Referenceabstract

#include <tweak-view.hh>

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

Public Types

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 >
 

Public Member Functions

virtual Rectangle< double > tweakSelection (const Rectangle< double > &selection) const =0
 
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
 

Protected Member Functions

 TweakSelection (const Point< double > &aspectRatio_)
 

Protected Attributes

Point< double > aspectRatio
 

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ TweakSelection()

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

Member Function Documentation

◆ tweakSelection() [1/2]

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

◆ tweakSelection() [2/2]

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 }
virtual Rectangle< double > tweakSelection(const Rectangle< double > &selection) const =0
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
auto selection
Definition pipette-tests.cc:157
const SampleIterator< const uint8_t > start(nullptr, initial_offset, bps)
Here is the call graph for this function:

Member Data Documentation

◆ aspectRatio

Point<double> Scroom::Utils::TweakSelection::aspectRatio
protected

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