YSTest: YPixel.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
YPixel.h
浏览该文件的文档.
1 /*
2 © 2013 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef YSL_INC_Service_YPixel_h_
29 #define YSL_INC_Service_YPixel_h_ 1
30
31 #include "YModules.h"
32 #include YFM_YSLib_Core_YGDIBase
33 #include <ystdex/rational.hpp>
34
35 namespace YSLib
36 {
37
38 namespace Drawing
39 {
40
51 namespace Shaders
52 {
53
60 struct BlitTransparentPoint
61 {
63 template<typename _tOut, typename _tIn>
64 inline void
65 operator()(_tOut& dst_iter, _tIn& src_iter)
66 {
67 if(FetchAlpha(*src_iter))
68 *dst_iter = *src_iter;
69 }
71 template<typename _tOut>
72 inline void
73 operator()(_tOut& dst_iter, IteratorPair& src_iter)
74 {
75 *dst_iter = *src_iter.base().second & 0x80 ? FetchOpaque(*src_iter)
76 : FetchOpaque(PixelType());
77 }
78 };
79
80
91 template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits>
92 struct GPixelCompositor
93 {
102 template<typename _tDstAlpha, typename _tSrcAlpha>
103 static yconstfn ystdex::conditional_t<(_vDstAlphaBits < _vSrcAlphaBits),
104 _tSrcAlpha, _tDstAlpha>
105 CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
106 {
107 static_assert(ystdex::is_normalizable<_tDstAlpha>::value,
108 "Non-normalizable destination alpha type found.");
109 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
110 "Non-normalizable source alpha type found.");
111
112 return sa + da * (1 - sa);
113 }
114
125 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
126 typename _tAlpha>
127 static yconstfn _tDst
128 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
129 {
130 static_assert(ystdex::is_normalizable<_tDst>::value,
131 "Non-normalizable destination type found.");
132 static_assert(ystdex::is_normalizable<_tSrc>::value,
133 "Non-normalizable source type found.");
134 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
135 "Non-normalizable source alpha type found.");
136 static_assert(ystdex::is_normalizable<_tAlpha>::value,
137 "Non-normalizable alpha type found.");
138
139 return a != 0 ? (s < d ? _tDst(d - sa * (d - s) / a)
140 : _tDst(sa * (s - d) / a + d)) : _tDst(0);
141 }
142 };
143
145 template<size_t _vDstAlphaBits>
146 struct GPixelCompositor<_vDstAlphaBits, 1>
147 {
154 template<typename _tDstAlpha, typename _tSrcAlpha>
155 static yconstfn _tDstAlpha
156 CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
157 {
158 static_assert(ystdex::is_normalizable<_tDstAlpha>::value,
159 "Non-normalizable destination alpha type found.");
160 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
161 "Non-normalizable source alpha type found.");
162
163 return sa != 0 ? ystdex::normalized_max<_tDstAlpha>::get() : da;
164 }
165
173 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
174 typename _tAlpha>
175 static yconstfn _tDst
176 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
177 {
178 static_assert(ystdex::is_normalizable<_tDst>::value,
179 "Non-normalizable destination type found.");
180 static_assert(ystdex::is_normalizable<_tSrc>::value,
181 "Non-normalizable source type found.");
182 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
183 "Non-normalizable source alpha type found.");
184 static_assert(ystdex::is_normalizable<_tAlpha>::value,
185 "Non-normalizable alpha type found.");
186
187 return a != 0 ? (sa != 0 ? (s < d ? _tDst(d - (d - s) / a)
188 : _tDst((s - d) / a + d)) : d) : _tDst(0);
189 }
190 };
191
193 template<size_t _vDstAlphaBits>
194 struct GPixelCompositor<_vDstAlphaBits, 0>
195 {
204 template<typename _tDstAlpha>
205 static yconstfn _tDstAlpha
206 CompositeAlphaOver(_tDstAlpha)
207 {
208 static_assert(ystdex::is_normalizable<_tDstAlpha>::value,
209 "Non-normalizable destination alpha type found.");
210
211 return ystdex::normalized_max<_tDstAlpha>::get();
212 }
213 template<typename _tDstAlpha, typename _tSrcAlpha>
214 static yconstfn _tDstAlpha
215 CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha)
216 {
217 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
218 "Non-normalizable source alpha type found.");
219
220 return CompositeAlphaOver(da);
221 }
223
234 template<typename _tSrc>
236 static yconstfn _tSrc
237 CompositeComponentOver(_tSrc s)
238 {
239 static_assert(ystdex::is_normalizable<_tSrc>::value,
240 "Non-normalizable source type found.");
241
242 return s;
243 }
244 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
245 typename _tAlpha>
246 static yconstfn _tSrc
247 CompositeComponentOver(_tDst, _tSrc s, _tSrcAlpha, _tAlpha)
248 {
249 static_assert(ystdex::is_normalizable<_tSrc>::value,
250 "Non-normalizable destination type found.");
251 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
252 "Non-normalizable source alpha type found.");
253 static_assert(ystdex::is_normalizable<_tAlpha>::value,
254 "Non-normalizable alpha type found.");
255
256 return CompositeComponentOver(s);
257 }
259 };
260
262 template<size_t _vSrcAlphaBits>
263 struct GPixelCompositor<1, _vSrcAlphaBits>
264 {
271 template<typename _tDstAlpha, typename _tSrcAlpha>
272 static yconstfn _tSrcAlpha
273 CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
274 {
275 static_assert(ystdex::is_normalizable<_tDstAlpha>::value,
276 "Non-normalizable destination alpha type found.");
277 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
278 "Non-normalizable source alpha type found.");
279
280 return da != 0 ? ystdex::normalized_max<_tSrcAlpha>::get() : sa;
281 }
282
290 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
291 typename _tAlpha>
292 static yconstfn _tDst
293 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
294 {
295 static_assert(ystdex::is_normalizable<_tDst>::value,
296 "Non-normalizable destination type found.");
297 static_assert(ystdex::is_normalizable<_tSrc>::value,
298 "Non-normalizable source type found.");
299 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
300 "Non-normalizable source alpha type found.");
301 static_assert(ystdex::is_normalizable<_tAlpha>::value,
302 "Non-normalizable alpha type found.");
303
304 return a != 0 ? GPixelCompositor<0, _vSrcAlphaBits>
305 ::CompositeComponentOver(d, s, sa) : _tDst(0);
306 }
307 };
308
310 template<size_t _vSrcAlphaBits>
311 struct GPixelCompositor<0, _vSrcAlphaBits>
312 : private GPixelCompositor<2, 0>
313 {
322 using GPixelCompositor<2, 0>::CompositeAlphaOver;
323
333 template<typename _tDst, typename _tSrc, typename _tSrcAlpha>
334 static yconstfn _tDst
335 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa)
336 {
337 static_assert(ystdex::is_normalizable<_tDst>::value,
338 "Non-normalizable destination type found.");
339 static_assert(ystdex::is_normalizable<_tSrc>::value,
340 "Non-normalizable source type found.");
341 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
342 "Non-normalizable source alpha type found.");
343
344 return s < d ? _tDst(d - sa * (d - s)) : _tDst(sa * (s - d) + d);
345 }
346 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
347 typename _tAlpha>
348 static yconstfn _tDst
349 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha)
350 {
351 static_assert(ystdex::is_normalizable<_tAlpha>::value,
352 "Non-normalizable alpha type found.");
353
354 return CompositeComponentOver(d, s, sa);
355 }
357 };
358
360 template<>
361 struct GPixelCompositor<0, 1> : private GPixelCompositor<2, 0>
362 {
363 using GPixelCompositor<2, 0>::CompositeAlphaOver;
364
375 template<typename _tDst, typename _tSrc, typename _tSrcAlpha>
376 static yconstfn _tDst
377 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa)
378 {
379 static_assert(ystdex::is_normalizable<_tDst>::value,
380 "Non-normalizable destination type found.");
381 static_assert(ystdex::is_normalizable<_tSrc>::value,
382 "Non-normalizable source type found.");
383 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
384 "Non-normalizable source alpha type found.");
385
386 return sa != 0 ? _tDst(s) : _tDst(d);
387 }
388 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
389 typename _tAlpha>
390 static yconstfn _tDst
391 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha)
392 {
393 static_assert(ystdex::is_normalizable<_tAlpha>::value,
394 "Non-normalizable alpha type found.");
395
396 return CompositeComponentOver(d, s, sa);
397 }
399 };
400
405 template<>
406 struct GPixelCompositor<1, 0> : public GPixelCompositor<2, 0>
407 {};
408
410 template<>
411 struct GPixelCompositor<1, 1>
412 {
419 template<typename _tDstAlpha, typename _tSrcAlpha>
420 static yconstfn _tDstAlpha
421 CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
422 {
423 static_assert(ystdex::is_normalizable<_tDstAlpha>::value,
424 "Non-normalizable destination alpha type found.");
425 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
426 "Non-normalizable source alpha type found.");
427
428 return sa != 0 || da != 0 ? ystdex::normalized_max<_tDstAlpha>::get()
429 : _tDstAlpha(0);
430 }
431
440 template<typename _tDst, typename _tSrc, typename _tSrcAlpha,
441 typename _tAlpha>
442 static yconstfn _tDst
443 CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
444 {
445 static_assert(ystdex::is_normalizable<_tDst>::value,
446 "Non-normalizable destination type found.");
447 static_assert(ystdex::is_normalizable<_tSrc>::value,
448 "Non-normalizable source type found.");
449 static_assert(ystdex::is_normalizable<_tSrcAlpha>::value,
450 "Non-normalizable source alpha type found.");
451 static_assert(ystdex::is_normalizable<_tAlpha>::value,
452 "Non-normalizable alpha type found.");
453
454 return a != 0 ? GPixelCompositor<0, 1>::CompositeComponentOver(d, s, sa)
455 : _tDst(0);
456 }
457 };
458
460 template<>
461 struct GPixelCompositor<0, 0> : private GPixelCompositor<2, 0>
462 {
463 using GPixelCompositor<2, 0>::CompositeAlphaOver;
464
465 using GPixelCompositor<2, 0>::CompositeComponentOver;
466 };
468
469
476 template<size_t _vSrcAlphaBits, typename _tDstInt, typename _tSrcInt,
477 typename _tSrcAlphaInt>
478 yconstfn _tDstInt
479 BlendComponent(_tDstInt d, _tSrcInt s, _tSrcAlphaInt sa)
480 {
481 using namespace ystdex;
482 static_assert(integer_width<_tDstInt>::value == _vSrcAlphaBits,
483 "Invalid integer destination type found.");
484 static_assert(integer_width<_tSrcInt>::value == _vSrcAlphaBits,
485 "Invalid integer source type found.");
486 static_assert(integer_width<_tSrcAlphaInt>::value == _vSrcAlphaBits,
487 "Invalid integer source alpha type found.");
488 using pix = fixed_point<typename make_width_int<_vSrcAlphaBits + 1>
489 ::unsigned_least_type, _vSrcAlphaBits>;
490
491 return GPixelCompositor<1, _vSrcAlphaBits>::CompositeComponentOver(
492 pix(d, raw_tag()), pix(s, raw_tag()), pix(sa, raw_tag()),
493 normalized_max<pix>::get()).get();
494 }
495
502 template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tDstInt,
503 typename _tSrcInt, typename _tSrcAlphaInt, typename _tAlphaInt>
504 yconstfn _tDstInt
505 CompositeComponent(_tDstInt d, _tSrcInt s, _tSrcAlphaInt sa, _tAlphaInt a)
506 {
507 using namespace ystdex;
508 static_assert(integer_width<_tDstInt>::value == _vSrcAlphaBits,
509 "Invalid integer destination type found.");
510 static_assert(integer_width<_tSrcInt>::value == _vSrcAlphaBits,
511 "Invalid integer source type found.");
512 static_assert(integer_width<_tSrcAlphaInt>::value == _vSrcAlphaBits,
513 "Invalid integer source alpha type found.");
514 static_assert(integer_width<_tAlphaInt>::value > _vDstAlphaBits,
515 "Invalid integer result alpha type found.");
516 using pixd = fixed_point<typename make_width_int<_vDstAlphaBits + 1>
517 ::unsigned_least_type, _vDstAlphaBits>;
518 using pix = fixed_point<typename make_width_int<_vSrcAlphaBits + 1>
519 ::unsigned_least_type, _vSrcAlphaBits>;
520
521 return GPixelCompositor<_vDstAlphaBits, _vSrcAlphaBits>
522 ::CompositeComponentOver(pix(d, raw_tag()), pix(s, raw_tag()),
523 pix(sa, raw_tag()), pixd(a, raw_tag())).get();
524 }
525
526
547 template<size_t _vAlphaBits>
548 u16
549 BlendCore(u32 d, u32 s, u8 a)
550 {
551 static_assert(_vAlphaBits > 0 && _vAlphaBits < 16 - 5,
552 "Wrong number of alpha bits found.");
553
554 u32 dbr((d & 0x1F) | (d << 6 & 0x1F0000)), dg(d & 0x3E0);
555
556 yunseq(dbr += ((((s & 0x1F) | (s << 6 & 0x1F0000)) - dbr) * a)
557 >> _vAlphaBits, dg += (((s & 0x3E0) - dg) * a) >> _vAlphaBits);
558 return (dbr & 0x1F) | (dg & 0x3E0) | (dbr >> 6 & 0x7C00) | 1 << 15;
559 }
560
561
571 template<size_t _vSrcAlphaBits, typename _tPixel, typename _tSrcAlphaInt>
572 yconstfn _tPixel
573 Blend(const _tPixel& d, const _tPixel& s, _tSrcAlphaInt sa)
574 {
575 static_assert(std::is_integral<_tSrcAlphaInt>::value,
576 "Invalid integer source alpha type found.");
577
578 return Color(BlendComponent<_vSrcAlphaBits>(d.GetR(), s.GetR(), sa),
579 BlendComponent<_vSrcAlphaBits>(d.GetG(), s.GetG(), sa), BlendComponent<
580 _vSrcAlphaBits>(d.GetB(), s.GetB(), sa), (1 << _vSrcAlphaBits) - 1);
581 }
582 template<size_t _vSrcAlphaBits, typename _tSrcAlphaInt>
583 RGBA<5, 5, 5, 1>
584 Blend(const RGBA<5, 5, 5, 1>& d, const RGBA<5, 5, 5, 1>& s, _tSrcAlphaInt sa)
585 {
586 static_assert(std::is_integral<_tSrcAlphaInt>::value,
587 "Invalid integer source alpha type found.");
588
589 return BlendCore<_vSrcAlphaBits>(d, s, sa);
590 }
592
600 template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel,
602 typename _tSrcAlphaInt, typename _tAlphaInt>
603 yconstfn _tPixel
604 Composite(const _tPixel& d, const _tPixel& s, _tSrcAlphaInt sa, _tAlphaInt a)
605 {
606 static_assert(std::is_integral<_tSrcAlphaInt>::value,
607 "Invalid integer source alpha type found.");
608 static_assert(std::is_integral<_tAlphaInt>::value,
609 "Invalid integer result alpha type found.");
610
611 return Color(CompositeComponent<_vDstAlphaBits, _vSrcAlphaBits>(d.GetR(),
612 s.GetR(), sa, a), CompositeComponent<_vDstAlphaBits, _vSrcAlphaBits>(
613 d.GetG(), s.GetG(), sa, a), CompositeComponent<_vDstAlphaBits,
614 _vSrcAlphaBits>(d.GetB(), s.GetB(), sa, a), a);
615 }
617 template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel,
618 typename _tAlphaInt>
619 yconstfn _tPixel
620 Composite(const _tPixel& d, const _tPixel& s, _tAlphaInt a)
621 {
622 return Composite<_vDstAlphaBits, _vSrcAlphaBits>(d, s, s.GetA(), a);
623 }
625 template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel>
626 yconstfn _tPixel
627 Composite(const _tPixel& d, const _tPixel& s)
628 {
629 using namespace ystdex;
630 using pixd = fixed_point<typename make_width_int<_vDstAlphaBits + 1>
631 ::unsigned_least_type, _vDstAlphaBits>;
632 using pix = fixed_point<typename make_width_int<_vSrcAlphaBits + 1>
633 ::unsigned_least_type, _vSrcAlphaBits>;
634
635 return Composite<_vDstAlphaBits, _vSrcAlphaBits>(d, s, GPixelCompositor<
636 _vDstAlphaBits, _vSrcAlphaBits>::CompositeAlphaOver(pixd(d.GetA(),
637 raw_tag()), pix(s.GetA(), raw_tag())).get());
638 }
640
641
647 struct BlitAlphaPoint
648 {
649 template<typename _tOut>
650 inline void
651 operator()(_tOut dst_iter, IteratorPair src_iter)
652 {
653 static_assert(std::is_convertible<ystdex::remove_reference_t<
654 decltype(*dst_iter)>, PixelType>::value, "Wrong type found.");
655
656 const AlphaType a(*src_iter.base().second);
657
658 *dst_iter = Blend<8>(*dst_iter, *src_iter, a);
659 }
660 template<typename _tOut, typename _tIn>
661 inline void
662 operator()(_tOut dst_iter, ystdex::pair_iterator<
663 ystdex::pseudo_iterator<const PixelType>, _tIn> src_iter)
664 {
665 static_assert(std::is_convertible<ystdex::remove_reference_t<
666 decltype(*dst_iter)>, PixelType>::value, "Wrong type found.");
667
668 const AlphaType a(*src_iter.base().second);
669
670 *dst_iter = Blend<8>(*dst_iter, *src_iter, a);
671 }
673 template<typename _tOut, typename _tIn>
674 inline void
675 operator()(_tOut dst_iter, _tIn src_iter)
676 {
677 *dst_iter = Shaders::Composite<ystdex::remove_reference_t<decltype(
678 *dst_iter)>::Trait::ABitsN, 8>(*dst_iter, *src_iter);
679 }
680 };
681
682 } // namespace Shaders;
683
684 } // namespace Drawing;
685
686 } // namespace YSLib;
687
688 #endif
689
YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, 1 >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:176
YSLib::Drawing::Shaders::BlitAlphaPoint::operator()
void operator()(_tOut dst_iter, ystdex::pair_iterator< ystdex::pseudo_iterator< const PixelType >, _tIn > src_iter)
Definition: YPixel.h:662
YSLib::Drawing::Shaders::BlendComponent
yconstfn _tDstInt BlendComponent(_tDstInt d, _tSrcInt s, _tSrcAlphaInt sa)
像素分量混合。
Definition: YPixel.h:479
ystdex::integer_width
取指定整数类型的位宽度。
Definition: cstdint.hpp:43
YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, 0 >::CompositeAlphaOver
static yconstfn _tDstAlpha CompositeAlphaOver(_tDstAlpha)
Alpha 组合 Alpha 分量。
Definition: YPixel.h:206
ystdex::fixed_point
通用定点数。
Definition: rational.hpp:139
YSLib::Drawing::Shaders::GPixelCompositor
像素组合器。
Definition: YPixel.h:92
YSLib::u32
std::uint32_t u32
Definition: yadaptor.h:69
ystdex::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: type_op.hpp:234
YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, 0 >::CompositeComponentOver
static yconstfn _tSrc CompositeComponentOver(_tDst, _tSrc s, _tSrcAlpha, _tAlpha)
Definition: YPixel.h:247
ystdex::conditional_t
typename conditional< _bCond, _type, _type2 >::type conditional_t
Definition: type_op.hpp:277
YSLib::Drawing::Shaders::GPixelCompositor< 1, 1 >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:443
YSLib::Drawing::Shaders::GPixelCompositor< 1, _vSrcAlphaBits >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:293
YSLib::Drawing::Shaders::Blend
yconstfn _tPixel Blend(const _tPixel &d, const _tPixel &s, _tSrcAlphaInt sa)
像素混合：使用指定的源 Alpha 。
Definition: YPixel.h:573
YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, 1 >::CompositeAlphaOver
static yconstfn _tDstAlpha CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
Alpha 组合 Alpha 分量。
Definition: YPixel.h:156
YSLib::Drawing::Shaders::BlitAlphaPoint::operator()
void operator()(_tOut dst_iter, IteratorPair src_iter)
Definition: YPixel.h:651
yunseq
#define yunseq
无序列依赖表达式组求值。
Definition: ydef.h:748
YSLib::Drawing::Shaders::GPixelCompositor< 0, 1 >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha)
Definition: YPixel.h:391
YSLib::Drawing::Shaders::GPixelCompositor< 0, _vSrcAlphaBits >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:335
YSLib::Drawing::Shaders::GPixelCompositor< 1, _vSrcAlphaBits >::CompositeAlphaOver
static yconstfn _tSrcAlpha CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
Alpha 组合 Alpha 分量。
Definition: YPixel.h:273
ystdex::is_normalizable
判断类型是否可满足归一化要求。
Definition: rational.hpp:83
YSLib::Drawing::Shaders::GPixelCompositor< 0, _vSrcAlphaBits >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha)
Definition: YPixel.h:349
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:463
YSLib::Drawing::Shaders::BlitAlphaPoint
像素计算：Alpha 混合。
Definition: YPixel.h:647
YSLib::Drawing::Shaders::GPixelCompositor< 0, 1 >::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:377
ystdex::normalized_max
取算术类型的正规化后的最大值。
Definition: rational.hpp:46
platform_ex::Windows::s
return s
Definition: MinGW32.cpp:49
platform::Consoles::Color
Color
控制台颜色枚举。
Definition: Video.h:458
YSLib::Drawing::Shaders::BlitTransparentPoint
像素迭代器透明操作。
Definition: YPixel.h:60
YSLib::u8
std::uint8_t u8
通用数据类型。
Definition: yadaptor.h:67
YSLib::Drawing::Shaders::GPixelCompositor< 1, 1 >::CompositeAlphaOver
static yconstfn _tDstAlpha CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
Alpha 组合 Alpha 分量。
Definition: YPixel.h:421
ystdex::pair_iterator::base
const pair_type & base() const
Definition: iterator.hpp:986
YSLib::Drawing::Shaders::BlendCore
u16 BlendCore(u32 d, u32 s, u8 a)
AXYZ1555 格式 PixelType 的 Alpha 混合。
Definition: YPixel.h:549
YSLib::Drawing::Shaders::CompositeComponent
yconstfn _tDstInt CompositeComponent(_tDstInt d, _tSrcInt s, _tSrcAlphaInt sa, _tAlphaInt a)
像素分量组合。
Definition: YPixel.h:505
ystdex::pseudo_iterator
伪迭代器。
Definition: iterator.hpp:351
YSLib::Drawing::Shaders::BlitTransparentPoint::operator()
void operator()(_tOut &dst_iter, _tIn &src_iter)
Definition: YPixel.h:65
YSLib::Drawing::Shaders::GPixelCompositor::CompositeComponentOver
static yconstfn _tDst CompositeComponentOver(_tDst d, _tSrc s, _tSrcAlpha sa, _tAlpha a)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:128
ystdex::raw_tag
empty_base<> raw_tag
直接构造类型（直接构造重载用）。
Definition: ydef.h:665
YSLib::Drawing::Shaders::BlitTransparentPoint::operator()
void operator()(_tOut &dst_iter, IteratorPair &src_iter)
Definition: YPixel.h:73
YSLib::Drawing::Shaders::GPixelCompositor::CompositeAlphaOver
static yconstfn ystdex::conditional_t<(_vDstAlphaBits< _vSrcAlphaBits), _tSrcAlpha, _tDstAlpha > CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha sa)
Alpha 组合 Alpha 分量。
Definition: YPixel.h:105
YSLib::u16
std::uint16_t u16
Definition: yadaptor.h:68
YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, 0 >::CompositeComponentOver
static yconstfn _tSrc CompositeComponentOver(_tSrc s)
Alpha 组合非 Alpha 分量。
Definition: YPixel.h:237
YModules.h
rational.hpp
有理数运算。
YSLib::Drawing::Shaders::BlitAlphaPoint::operator()
void operator()(_tOut dst_iter, _tIn src_iter)
Definition: YPixel.h:675
YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, 0 >::CompositeAlphaOver
static yconstfn _tDstAlpha CompositeAlphaOver(_tDstAlpha da, _tSrcAlpha)
Definition: YPixel.h:215
platform::AlphaType
ystdex::octet AlphaType
Definition: Video.h:186
ystdex::pair_iterator
成对迭代器。
Definition: iterator.hpp:835
YSLib::Drawing::Shaders::Composite
yconstfn _tPixel Composite(const _tPixel &d, const _tPixel &s, _tSrcAlphaInt sa, _tAlphaInt a)
像素组合：使用指定的源 Alpha 和结果 Alpha 。
Definition: YPixel.h:604