The Battle for Wesnoth  1.19.0-dev
Public Types | Public Member Functions | Private Attributes | List of all members
image::scale_modification Class Reference

Scaling (SCALE[_INTO], SCALE[_INTO]_SHARP) modifications. More...

#include <image_modifications.hpp>

Inheritance diagram for image::scale_modification:

Public Types

enum  SCALE_FLAGS : uint8_t {
  SCALE_LINEAR = 0b00000 , SCALE_SHARP = 0b00001 , FIT_TO_SIZE = 0b00010 , PRESERVE_ASPECT_RATIO = 0b00100 ,
  X_BY_FACTOR = 0b01000 , Y_BY_FACTOR = 0b10000
}
 

Public Member Functions

 scale_modification (point target_size, uint8_t flags)
 
virtual surface operator() (const surface &src) const
 Applies the image-path modification on the specified surface. More...
 
int get_w () const
 
int get_h () const
 
- Public Member Functions inherited from image::modification
virtual ~modification ()
 
virtual int priority () const
 Specifies the priority of the modification. More...
 

Private Attributes

point target_size_ {0,0}
 
uint8_t flags_ = SCALE_LINEAR | FIT_TO_SIZE
 

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

Scaling (SCALE[_INTO], SCALE[_INTO]_SHARP) modifications.

Definition at line 441 of file image_modifications.hpp.

Member Enumeration Documentation

◆ SCALE_FLAGS

Enumerator
SCALE_LINEAR 
SCALE_SHARP 
FIT_TO_SIZE 
PRESERVE_ASPECT_RATIO 
X_BY_FACTOR 
Y_BY_FACTOR 

Definition at line 445 of file image_modifications.hpp.

Constructor & Destructor Documentation

◆ scale_modification()

image::scale_modification::scale_modification ( point  target_size,
uint8_t  flags 
)
inline

Definition at line 454 of file image_modifications.hpp.

Member Function Documentation

◆ get_h()

int image::scale_modification::get_h ( ) const
inline

Definition at line 462 of file image_modifications.hpp.

References target_size_.

Referenced by BOOST_AUTO_TEST_CASE().

◆ get_w()

int image::scale_modification::get_w ( ) const
inline

Definition at line 461 of file image_modifications.hpp.

References target_size_.

Referenced by BOOST_AUTO_TEST_CASE().

◆ operator()()

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

Applies the image-path modification on the specified surface.

Implements image::modification.

Definition at line 468 of file image_modifications.cpp.

References scale_surface_legacy(), scale_surface_sharp(), and utf8::size().

Member Data Documentation

◆ flags_

uint8_t image::scale_modification::flags_ = SCALE_LINEAR | FIT_TO_SIZE
private

Definition at line 467 of file image_modifications.hpp.

◆ target_size_

point image::scale_modification::target_size_ {0,0}
private

Definition at line 465 of file image_modifications.hpp.

Referenced by get_h(), and get_w().


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