50 std::size_t
size()
const;
55 typedef std::map<int, std::vector<std::shared_ptr<modification>>, std::greater<int>>
map_type;
131 : rc_map_(recolor_map)
138 bool no_op()
const {
return rc_map_.empty(); }
175 bool no_op()
const {
return ((!horiz_) && (!vert_)); }
206 : degrees_(degrees), zoom_(zoom), offset_(offset)
210 bool no_op()
const {
return degrees_ % 360 == 0; }
300 : formulas_(formulas)
302 if(formulas_.empty()) {
303 formulas_.push_back(
"red");
305 if(formulas_.size() == 1) {
306 formulas_.push_back(
"green");
308 if(formulas_.size() == 2) {
309 formulas_.push_back(
"blue");
311 if(formulas_.size() == 3) {
312 formulas_.push_back(
"alpha");
350 : surf_(surf), x_(x), y_(y)
383 : mask_(mask), x_(x), y_(y)
436 :
w_(width), h_(height), nn_(use_nn), fn_(fn)
439 virtual std::pair<int,int> calculate_size(
const surface& src)
const = 0;
468 virtual std::pair<int,int> calculate_size(
const surface& src)
const;
481 virtual std::pair<int,int> calculate_size(
const surface& src)
const;
527 : r_(r), g_(g),
b_(b)
546 : r_(r), g_(g),
b_(b),
a_(a)
const surface & get_surface() const
Grayscale (GS) modification.
Scale (BLIT) modification.
scale_modification(int width, int height, const std::string &fn, bool use_nn)
scale_exact_modification(int width, int height, const std::string &fn, bool use_nn)
blend_modification(int r, int g, int b, float a)
Fill background with a color (BG).
mask_modification(const surface &mask, int x, int y)
Gaussian-like blur (BL) modification.
const surface & get_surface() const
Adjust Channels (CHAN) modification.
Color-shift (CS, R, G, B) modification.
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
Adjust Alpha (ADJUST_ALPHA) modification.
Black and white (BW) modification.
A modified priority queue used to order image modifications.
adjust_channels_modification(const std::vector< std::string > &formulas)
Plot Alpha (Alpha) modification.
rc_modification()
Default constructor.
xBRZ scale (xBRZ) modification
Mask (MASK) modification.
const SDL_Rect & get_slice() const
o_modification(float opacity)
background_modification(const color_t &c)
static void decode(const std::string &input_file, const std::string &output_file)
Recolor (RC/TC/PAL) modification.
virtual int priority() const
Specifies the priority of the modification.
Make an image negative (NEG)
void push(modification *mod)
Adds mod to the queue (unless mod is nullptr).
bool toggle_vert()
Toggle vertical mirror flag.
bw_modification(int threshold)
cs_modification(int r, int g, int b)
virtual int priority() const
Specifies the priority of the modification.
std::size_t size() const
Returns the number of elements in the queue.
const color_t & get_color() const
negative_modification(int r, int g, int b)
Crop (CROP) modification.
Scale exact modification.
Color blending (BLEND) modification.
The basic class for representing 8-bit RGB or RGBA colour values.
Base abstract class for an image-path modification.
bl_modification(int depth)
std::map< int, std::vector< std::shared_ptr< modification > >, std::greater< int > > map_type
Map from a mod's priority() to the mods having that priority.
std::unordered_map< color_t, color_t > color_range_map
Give to the image a sepia tint (SEPIA)
Rotate (ROTATE) modification.
light_modification(const surface &surf)
~imod_exception() noexcept
scale_into_modification(int width, int height, const std::string &fn, bool use_nn)
Opacity (O) modification.
rc_modification(const color_range_map &recolor_map)
RC-map based constructor.
Wipe Alpha (Wipe_Alpha) modification.
blit_modification(const surface &surf, int x, int y)
float get_opacity() const
bool toggle_horiz()
Toggle horizontal mirror flag.
Functions to load and save images from/to disk.
modification * top() const
Returns the top element in the queue .
map_type priorities_
Map from a mod's priority() to the mods having that priority.
Scale into (SCALE_INTO) modification.
adjust_alpha_modification(const std::string &formula)
rotate_modification(int degrees=90, int zoom=16, int offset=8)
Constructor.
void pop()
Removes the top element from the queue.
swap_modification(channel r, channel g, channel b, channel a)
const surface & get_mask() const
Exception thrown by the operator() when an error occurs.
Mirror (FL) modification.
Base class for exceptions that want to be thrown 'through' lua.
fl_modification(bool horiz=false, bool vert=false)
Constructor.
Scaling modifications base class.
std::vector< std::string > formulas_
crop_modification(const SDL_Rect &slice)
const std::string message
The error message regarding the failed operation.
const color_range_map & map() const