20 #include "ShaderDrawHelper.h" 35 template<
typename ColorFunc,
typename DestType,
typename Src0Type,
typename Src1Type,
typename Src2Type,
typename Src3Type>
36 static inline void ShaderDraw(
const DestType& dest_frame,
const Src0Type& src0_frame,
const Src1Type& src1_frame,
const Src2Type& src2_frame,
const Src3Type& src3_frame)
39 helper::controler<DestType> dest(dest_frame);
40 helper::controler<Src0Type> src0(src0_frame);
41 helper::controler<Src1Type> src1(src1_frame);
42 helper::controler<Src2Type> src2(src2_frame);
43 helper::controler<Src3Type> src3(src3_frame);
46 GraphSubset end_temp = dest.get_range();
49 src0.mod_range(end_temp);
50 src1.mod_range(end_temp);
51 src2.mod_range(end_temp);
52 src3.mod_range(end_temp);
54 const GraphSubset end = end_temp;
55 if (end.size_x() == 0 || end.size_y() == 0)
65 int begin_y = 0, end_y = end.size_y();
67 dest.mod_y(begin_y, end_y);
68 src0.mod_y(begin_y, end_y);
69 src1.mod_y(begin_y, end_y);
70 src2.mod_y(begin_y, end_y);
71 src3.mod_y(begin_y, end_y);
75 dest.set_y(begin_y, end_y);
76 src0.set_y(begin_y, end_y);
77 src1.set_y(begin_y, end_y);
78 src2.set_y(begin_y, end_y);
79 src3.set_y(begin_y, end_y);
82 for (
int y = end_y-begin_y; y>0; --y, dest.inc_y(), src0.inc_y(), src1.inc_y(), src2.inc_y(), src3.inc_y())
84 int begin_x = 0, end_x = end.size_x();
86 dest.mod_x(begin_x, end_x);
87 src0.mod_x(begin_x, end_x);
88 src1.mod_x(begin_x, end_x);
89 src2.mod_x(begin_x, end_x);
90 src3.mod_x(begin_x, end_x);
94 dest.set_x(begin_x, end_x);
95 src0.set_x(begin_x, end_x);
96 src1.set_x(begin_x, end_x);
97 src2.set_x(begin_x, end_x);
98 src3.set_x(begin_x, end_x);
101 for (
int x = end_x-begin_x; x>0; --x, dest.inc_x(), src0.inc_x(), src1.inc_x(), src2.inc_x(), src3.inc_x())
103 ColorFunc::func(dest.get_ref(), src0.get_ref(), src1.get_ref(), src2.get_ref(), src3.get_ref());
109 template<
typename ColorFunc,
typename DestType,
typename Src0Type,
typename Src1Type,
typename Src2Type>
110 static inline void ShaderDraw(
const DestType& dest_frame,
const Src0Type& src0_frame,
const Src1Type& src1_frame,
const Src2Type& src2_frame)
112 ShaderDraw<ColorFunc>(dest_frame, src0_frame, src1_frame, src2_frame, helper::Nothing());
114 template<
typename ColorFunc,
typename DestType,
typename Src0Type,
typename Src1Type>
115 static inline void ShaderDraw(
const DestType& dest_frame,
const Src0Type& src0_frame,
const Src1Type& src1_frame)
117 ShaderDraw<ColorFunc>(dest_frame, src0_frame, src1_frame, helper::Nothing(), helper::Nothing());
119 template<
typename ColorFunc,
typename DestType,
typename Src0Type>
120 static inline void ShaderDraw(
const DestType& dest_frame,
const Src0Type& src0_frame)
122 ShaderDraw<ColorFunc>(dest_frame, src0_frame, helper::Nothing(), helper::Nothing(), helper::Nothing());
124 template<
typename ColorFunc,
typename DestType>
125 static inline void ShaderDraw(
const DestType& dest_frame)
127 ShaderDraw<ColorFunc>(dest_frame, helper::Nothing(), helper::Nothing(), helper::Nothing(), helper::Nothing());
131 static inline helper::Scalar<T> ShaderScalar(T& t)
133 return helper::Scalar<T>(t);
136 static inline helper::Scalar<const T> ShaderScalar(
const T& t)
138 return helper::Scalar<const T>(t);
144 const Uint8 ColorGroup = 15<<4;
145 const Uint8 ColorShade = 15;
146 const Uint8 ColorShadeMax = 15;
147 const Uint8 BLACK = 15;
Definition: BaseInfoState.cpp:40