App
Blender.hpp
Go to the documentation of this file.
1 
6 // forward declaration
7 namespace app {
8  class Blender;
9 }
10 
11 #ifndef BLENDER_HPP_
12 #define BLENDER_HPP_
13 
14 #include "../typedefs.hpp"
15 #include "../utils/Geometry.hpp"
16 #include "../utils/PointerArea.hpp"
17 #include "../bitmaps/TBitmap.hpp"
18 #include "Blender_blend_macro.hpp"
19 #include "Blender_define.hpp"
20 #include "Blender_define_macro.hpp"
21 #include "Blender_BlendMode.hpp"
22 #include <cstddef> // proč?
23 #include <cmath>
24 
25 namespace app {
26 
85 class Blender {
86 public:
87 
89  Blender();
91  virtual ~Blender();
92 
94 
110  static int blendTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_4x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig);
111 
113 
130  static int blendTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_4x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig, double alpha);
131 
132 
133 
134 
135 
136 
137  static int blendTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, px_4x8bit * src, Rect dstRect);
138  static int blendTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, px_4x8bit * src, Rect dstRect, double alpha);
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
152 
168  static int addTo(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig);
169 
171 
189  static int addTo(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig, double alpha);
190 
192  static int addTo(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig);
193 
195  static int addTo(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig, double alpha);
196 
198 
212  static int removeFrom(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig);
213 
215 
231  static int removeFrom(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig, double alpha);
232 
234  static int removeFrom(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig);
235 
237  static int removeFrom(TBitmap<px_1x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig, double alpha);
238 
240  static int addTo(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig);
241 
243  static int addTo(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig, double alpha);
244 
246  static int addTo(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig);
247 
249  static int addTo(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig, double alpha);
250 
252  static int removeFrom(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig);
253 
255  static int removeFrom(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect srcRect, Point srcOrig, double alpha);
256 
258  static int removeFrom(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig);
259 
261  static int removeFrom(TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_1x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig, double alpha);
262 
264 
281  static int drawTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, px_4x8bit * src, Rect mskRect, Point mskOrig);
282 
284 
301  static int drawTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, px_4x8bit * src, Rect mskRect, Point mskOrig, double alpha);
302 
304 
313  static int drawTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_4x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig);
314 
316 
327  static int drawTo(BlendMode mode, TBitmap<px_4x8bit, px_1x8bit> &dst, const TBitmap<px_1x8bit, px_1x8bit> &msk, const TBitmap<px_4x8bit, px_1x8bit> &src, Rect mskRect, Point srcOrig, Point mskOrig, double alpha);
328 
329 protected:
330  // Deklarace selektorů - metoda vrací pointer na příslušnou blendovací funkci
337 
338 
339  static int blend_add_onech_sd(PARAMS_SD);
340 
342  static int blend_add_onech_sda(PARAMS_SDA);
343 
344  static int blend_add_onech_sdm(PARAMS_SDM);
345 
346  static int blend_add_onech_sdma(PARAMS_SDMA);
347 
349  static int blend_remove_onech_sd(PARAMS_SD);
350 
353 
355 
357 
358 
359 
360  static int blend_add_argb_sd(PARAMS_SD);
361  static int blend_add_argb_sda(PARAMS_SDA);
362  static int blend_add_argb_sdm(PARAMS_SDM);
363  static int blend_add_argb_sdma(PARAMS_SDMA);
364 
365  static int blend_remove_argb_sd(PARAMS_SD);
366  static int blend_remove_argb_sda(PARAMS_SDA);
367  static int blend_remove_argb_sdm(PARAMS_SDM);
369 
370  // Deklarace metod pro blendování ARGB bitmap v příslušném módu
372 
375 
377  DECLARE_BLEND_FUNCTIONS(multiply)
378  DECLARE_BLEND_FUNCTIONS(colorBurn)
379  DECLARE_BLEND_FUNCTIONS(linearBurn)
380  DECLARE_BLEND_FUNCTIONS(darkerColor)
381 
382  DECLARE_BLEND_FUNCTIONS(lighten)
384  DECLARE_BLEND_FUNCTIONS(colorDodge)
385  DECLARE_BLEND_FUNCTIONS(linearDodgeAdd)
386  DECLARE_BLEND_FUNCTIONS(lighterColor)
387 
388  DECLARE_BLEND_FUNCTIONS(overlay)
389  DECLARE_BLEND_FUNCTIONS(softLight)
390  DECLARE_BLEND_FUNCTIONS(hardLight)
391  DECLARE_BLEND_FUNCTIONS(vividLight)
392  DECLARE_BLEND_FUNCTIONS(linearLight)
393  DECLARE_BLEND_FUNCTIONS(pinLight)
394  DECLARE_BLEND_FUNCTIONS(hardMix)
395 
396  DECLARE_BLEND_FUNCTIONS(difference)
397  DECLARE_BLEND_FUNCTIONS(exclusion)
398  DECLARE_BLEND_FUNCTIONS(subtract)
400 
402  DECLARE_BLEND_FUNCTIONS(saturation)
404  DECLARE_BLEND_FUNCTIONS(luminosity)
405 };
406 
407 } /* namespace app */
408 #endif /* BLENDER_HPP_ */