48 void push(std::unique_ptr<modification> mod);
50 std::size_t
size()
const;
55 typedef std::map<int, std::vector<std::unique_ptr<modification>>, std::greater<int>>
map_type;
136 virtual int priority()
const override {
return 1; }
Adjust Alpha (ADJUST_ALPHA) modification.
adjust_alpha_modification(const std::string &formula)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Adjust Channels (CHAN) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
adjust_channels_modification(const std::vector< std::string > &formulas)
std::vector< std::string > formulas_
Gaussian-like blur (BL) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
bl_modification(int depth)
Color blending (BLEND) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
blend_modification(int r, int g, int b, float a)
Scale (BLIT) modification.
const surface & get_surface() const
blit_modification(const surface &surf, int x, int y)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Black and white (BW) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
bw_modification(int threshold)
Crop (CROP) modification.
const SDL_Rect & get_slice() const
crop_modification(const SDL_Rect &slice)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Crop transparent padding (CROP_TRANSPARENCY) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Color-shift (CS, R, G, B) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
cs_modification(int r, int g, int b)
Mirror (FL) modification.
bool toggle_horiz()
Toggle horizontal mirror flag.
bool toggle_vert()
Toggle vertical mirror flag.
fl_modification(bool horiz=false, bool vert=false)
Constructor.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Grayscale (GS) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
light_modification(const surface &surf)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
const surface & get_surface() const
Mask (MASK) modification.
const surface & get_mask() const
mask_modification(const surface &mask, int x, int y)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
A modified priority queue used to order image modifications.
modification * top() const
Returns the top element in the queue .
std::map< int, std::vector< std::unique_ptr< modification > >, std::greater< int > > map_type
Map from a mod's priority() to the mods having that priority.
void pop()
Removes the top element from the queue.
void push(std::unique_ptr< modification > mod)
Adds mod to the queue (unless mod is nullptr).
map_type priorities_
Map from a mod's priority() to the mods having that priority.
std::size_t size() const
Returns the number of elements in the queue.
Base abstract class for an image-path modification.
static modification_queue decode(const std::string &)
Decodes modifications from a modification string.
virtual int priority() const
Specifies the priority of the modification.
virtual void operator()(surface &src) const =0
Applies the image-path modification on the specified surface.
Make an image negative (NEG)
negative_modification(int r, int g, int b)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Opacity (O) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
float get_opacity() const
o_modification(float opacity)
Plot Alpha (Alpha) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Recolor (RC/TC/PAL) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
const color_range_map & map() const
rc_modification()
Default constructor.
rc_modification(const color_range_map &recolor_map)
RC-map based constructor.
virtual int priority() const override
Specifies the priority of the modification.
Rotate (ROTATE) modification.
rotate_modification(int degrees=90, int zoom=16, int offset=8)
Constructor.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Scaling (SCALE[_INTO], SCALE[_INTO]_SHARP) modifications.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
scale_modification(point target_size, uint8_t flags)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
swap_modification(channel r, channel g, channel b, channel a)
Wipe Alpha (Wipe_Alpha) modification.
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
xBRZ scale (xBRZ) modification
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
Base class for exceptions that want to be thrown 'through' lua.
std::unordered_map< color_t, color_t > color_range_map
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
Functions to load and save images from/to disk.
rect src
Non-transparent portion of the surface to compose.
The basic class for representing 8-bit RGB or RGBA colour values.
Fill background with a color (BG).
const color_t & get_color() const
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.
background_modification(const color_t &c)
Exception thrown by the operator() when an error occurs.
imod_exception(const std::stringstream &message_stream)
Constructor.
const std::string message
The error message regarding the failed operation.
~imod_exception() noexcept
Give to the image a sepia tint (SEPIA)
virtual void operator()(surface &src) const override
Applies the image-path modification on the specified surface.