The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:
Inheritance graph

Public Member Functions

 rotate_modification (int degrees=90, int zoom=16, int offset=8)
 Constructor. More...
 
virtual surface operator() (const surface &src) const
 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 183 of file image_modifications.hpp.

Constructor & Destructor Documentation

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 203 of file image_modifications.hpp.

Member Function Documentation

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

Definition at line 208 of file image_modifications.hpp.

References degrees_.

surface image::rotate_modification::operator() ( const surface src) const
virtual

Applies the image-path modification on the specified surface.

Implements image::modification.

Definition at line 176 of file image_modifications.cpp.

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

Member Data Documentation

int image::rotate_modification::degrees_
private

Definition at line 211 of file image_modifications.hpp.

Referenced by no_op().

int image::rotate_modification::offset_
private

Definition at line 213 of file image_modifications.hpp.

int image::rotate_modification::zoom_
private

Definition at line 212 of file image_modifications.hpp.


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