App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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
331 DECLARE_ARGB_FUNCTION_SELECTOR(sd)
332 DECLARE_ARGB_FUNCTION_SELECTOR(sda)
333 DECLARE_ARGB_FUNCTION_SELECTOR(sdm)
334 DECLARE_ARGB_FUNCTION_SELECTOR(sdma)
335 DECLARE_ARGB_FUNCTION_SELECTOR(cdm)
336 DECLARE_ARGB_FUNCTION_SELECTOR(cd)
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
352 static int blend_remove_onech_sda(PARAMS_SDA);
353
354 static int blend_remove_onech_sdm(PARAMS_SDM);
355
356 static int blend_remove_onech_sdma(PARAMS_SDMA);
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);
368 static int blend_remove_argb_sdma(PARAMS_SDMA);
369
370 // Deklarace metod pro blendování ARGB bitmap v příslušném módu
371 DECLARE_BLEND_FUNCTIONS(normal)
372
373 DECLARE_BLEND_FUNCTIONS(behind)
374 DECLARE_BLEND_FUNCTIONS(clear)
375
376 DECLARE_BLEND_FUNCTIONS(darken)
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)
383 DECLARE_BLEND_FUNCTIONS(screen)
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)
399 DECLARE_BLEND_FUNCTIONS(divide)
400
401 DECLARE_BLEND_FUNCTIONS(hue)
402 DECLARE_BLEND_FUNCTIONS(saturation)
403 DECLARE_BLEND_FUNCTIONS(color)
404 DECLARE_BLEND_FUNCTIONS(luminosity)
405 };
406
407 } /* namespace app */
408 #endif /* BLENDER_HPP_ */