Scroom  0.14
TweakPixelSelection Class Reference
Inheritance diagram for TweakPixelSelection:
Inheritance graph
Collaboration diagram for TweakPixelSelection:
Collaboration graph

Public Member Functions

Rectangle tweakSelection (Rectangle selection) const override
 
virtual Rectangle tweakSelection (Rectangle selection) const=0
 
Selection tweakSelection (Selection selection) const override
 
 TweakSelection (Point aspectRatio_)
 
- Public Member Functions inherited from TweakSelection
Selection tweakSelection (Selection selection) const override
 
void setAspectRatio (Point aspectRatio_) override
 
- Public Member Functions inherited from Interface
 Interface ()=default
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
 Interface (const Interface &&)=delete
 
Interfaceoperator= (const Interface &&)=delete
 
virtual ~Interface ()=default
 

Static Public Member Functions

static Ptr create (Point aspectRatio_)
 

Additional Inherited Members

- Public Types inherited from TweakSelection
using Rectangle = Scroom::Utils::Rectangle< double >
 
- Public Types inherited from ITweakSelection
using Ptr = boost::shared_ptr< ITweakSelection >
 
using Point = Scroom::Utils::Point< double >
 
- Protected Member Functions inherited from TweakSelection
 TweakSelection (Point aspectRatio_)
 
- Protected Attributes inherited from TweakSelection
Point aspectRatio
 

Member Function Documentation

◆ create()

static Ptr TweakPixelSelection::create ( Point  aspectRatio_)
inlinestatic
224 { return Ptr(new TweakPixelSelection(aspectRatio_)); }

Referenced by View::View().

Here is the caller graph for this function:

◆ TweakSelection()

TweakSelection::TweakSelection
inlineexplicit
199  : aspectRatio(aspectRatio_)
200  {
201  }

◆ tweakSelection() [1/3]

Rectangle TweakPixelSelection::tweakSelection ( Rectangle  selection) const
inlineoverridevirtual

Implements TweakSelection.

227  {
228  return roundOutward(selection / aspectRatio) * aspectRatio;
229  }
Here is the call graph for this function:

◆ tweakSelection() [2/3]

virtual Rectangle TweakSelection::tweakSelection

◆ tweakSelection() [3/3]

Selection TweakSelection::tweakSelection
inlineoverride
182  {
183  const auto original = toRectangle(selection);
184  const auto tweaked = tweakSelection(original);
185 
186  const auto startCorner = find_closest_corner(selection.start, original);
187  const auto endCorner = find_opposed_corner(startCorner);
188 
189  const auto start = corner_getter(startCorner)(tweaked);
190  const auto end = corner_getter(endCorner)(tweaked);
191 
192  return {start, end};
193  }

The documentation for this class was generated from the following file:
toRectangle
Scroom::Utils::Rectangle< double > toRectangle(Selection s)
Definition: view.cc:162
TweakPixelSelection::tweakSelection
Rectangle tweakSelection(Rectangle selection) const override
Definition: view.cc:226
corner_getter
std::function< Scroom::Utils::Point< double >Scroom::Utils::Rectangle< double >)> corner_getter(Corner c)
Definition: view.cc:118
TweakSelection::aspectRatio
Point aspectRatio
Definition: view.cc:204
TweakPixelSelection
Definition: view.cc:221
ITweakSelection::Ptr
boost::shared_ptr< ITweakSelection > Ptr
Definition: view.cc:167
find_opposed_corner
Corner find_opposed_corner(Corner c)
Definition: view.cc:146
find_closest_corner
Corner find_closest_corner(Scroom::Utils::Point< double > p, Scroom::Utils::Rectangle< double > r)
Definition: view.cc:134
Scroom::Utils::roundOutward
Segment< double > roundOutward(Segment< double > s)
Definition: linearsegment.hh:240