The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Attributes | List of all members
image::rotate_modification Class Reference

Rotate (ROTATE) modification. More...

#include <image_modifications.hpp>

Inheritance diagram for image::rotate_modification:

Public Member Functions

 rotate_modification (int degrees=90, int zoom=16, int offset=8)
 Constructor. More...
 
virtual void operator() (surface &src) const override
 Applies the image-path modification on the specified surface. More...
 
bool no_op () const
 
- Public Member Functions inherited from image::modification
virtual ~modification ()
 
virtual int priority () const
 Specifies the priority of the modification. More...
 

Private Attributes

int degrees_
 
int zoom_
 
int offset_
 

Additional Inherited Members

- Static Public Member Functions inherited from image::modification
static modification_queue decode (const std::string &)
 Decodes modifications from a modification string. More...
 

Detailed Description

Rotate (ROTATE) modification.

Definition at line 185 of file image_modifications.hpp.

Constructor & Destructor Documentation

◆ rotate_modification()

image::rotate_modification::rotate_modification ( int  degrees = 90,
int  zoom = 16,
int  offset = 8 
)
inline

Constructor.

Precondition
zoom >= offset Otherwise the result will have empty pixels.
offset > 0 Otherwise the procedure will not return.
Parameters
degreesAmount of rotation (in degrees). Positive values are clockwise; negative are counter-clockwise.
zoomThe zoom level to calculate the rotation from. Greater values result in better results and increased runtime. This parameter will be ignored if degrees is a multiple of 90.
offsetDetermines the step size of the scanning of the zoomed source. Different offsets can produce better results, try them out. Greater values result in decreased runtime. This parameter will be ignored if degrees is a multiple of 90. If offset is greater than zoom the result will have empty pixels.

Definition at line 205 of file image_modifications.hpp.

Member Function Documentation

◆ no_op()

bool image::rotate_modification::no_op ( ) const
inline

Definition at line 210 of file image_modifications.hpp.

References degrees_.

◆ operator()()

void image::rotate_modification::operator() ( surface src) const
overridevirtual

Applies the image-path modification on the specified surface.

Implements image::modification.

Definition at line 171 of file image_modifications.cpp.

References rotate_180_surface(), rotate_90_surface(), rotate_any_surface(), and src.

Member Data Documentation

◆ degrees_

int image::rotate_modification::degrees_
private

Definition at line 213 of file image_modifications.hpp.

Referenced by no_op().

◆ offset_

int image::rotate_modification::offset_
private

Definition at line 215 of file image_modifications.hpp.

◆ zoom_

int image::rotate_modification::zoom_
private

Definition at line 214 of file image_modifications.hpp.


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