13template<std::
unsigned_
integral Pixel>
19template<std::
unsigned_
integral Pixel>
24 for (
unsigned srcY = srcStartY, dstY = dstStartY;
25 dstY < dstEndY; srcY += 1, dstY += 3) {
33template<std::
unsigned_
integral Pixel>
38 for (
unsigned srcY = srcStartY, dstY = dstStartY;
39 dstY < dstEndY; srcY += 2, dstY += 3) {
42 Pixel color01 = pixelOps.template blend<1, 1>(color0, color1);
49template<std::
unsigned_
integral Pixel>
51 unsigned srcStartY,
unsigned ,
unsigned srcWidth,
57 for (
unsigned dstY = dstStartY; dstY < dstEndY; dstY += 3, ++srcStartY) {
58 auto srcLine = src.
getLine(srcStartY, buf);
60 scale(srcLine, dstLine0);
63 copy(dstLine0, dstLine1);
66 copy(dstLine0, dstLine2);
74template<std::
unsigned_
integral Pixel>
75static void doScaleDV(FrameSource& src,
76 unsigned srcStartY,
unsigned ,
unsigned srcWidth,
77 ScalerOutput<Pixel>& dst,
unsigned dstStartY,
unsigned dstEndY,
78 PixelOperations<Pixel> ops, PolyLineScaler<Pixel>&
scale)
81 BlendLines<Pixel> blend(ops);
82 for (
unsigned srcY = srcStartY, dstY = dstStartY; dstY < dstEndY;
83 srcY += 2, dstY += 3) {
84 auto srcLine0 = src.getLine(srcY + 0, buf);
85 auto dstLine0 = dst.acquireLine(dstY + 0);
86 scale(srcLine0, dstLine0);
88 auto srcLine1 = src.getLine(srcY + 1, buf);
89 auto dstLine2 = dst.acquireLine(dstY + 2);
90 scale(srcLine1, dstLine2);
92 auto dstLine1 = dst.acquireLine(dstY + 1);
93 blend(dstLine0, dstLine2, dstLine1);
95 dst.releaseLine(dstY + 0, dstLine0);
96 dst.releaseLine(dstY + 1, dstLine1);
97 dst.releaseLine(dstY + 2, dstLine2);
101template<std::
unsigned_
integral Pixel>
103 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
107 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
108 dst, dstStartY, dstEndY, op);
111template<std::
unsigned_
integral Pixel>
113 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
117 doScaleDV<Pixel>(src, srcStartY, srcEndY, srcWidth,
118 dst, dstStartY, dstEndY, pixelOps, op);
121template<std::
unsigned_
integral Pixel>
123 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
127 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
128 dst, dstStartY, dstEndY, op);
131template<std::
unsigned_
integral Pixel>
133 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
137 doScaleDV<Pixel>(src, srcStartY, srcEndY, srcWidth,
138 dst, dstStartY, dstEndY, pixelOps, op);
141template<std::
unsigned_
integral Pixel>
143 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
147 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
148 dst, dstStartY, dstEndY, op);
151template<std::
unsigned_
integral Pixel>
153 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
157 doScaleDV<Pixel>(src, srcStartY, srcEndY, srcWidth,
158 dst, dstStartY, dstEndY, pixelOps, op);
161template<std::
unsigned_
integral Pixel>
163 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
167 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
168 dst, dstStartY, dstEndY, op);
171template<std::
unsigned_
integral Pixel>
173 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
177 doScaleDV<Pixel>(src, srcStartY, srcEndY, srcWidth,
178 dst, dstStartY, dstEndY, pixelOps, op);
181template<std::
unsigned_
integral Pixel>
183 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
187 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
188 dst, dstStartY, dstEndY, op);
191template<std::
unsigned_
integral Pixel>
193 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
197 doScaleDV<Pixel>(src, srcStartY, srcEndY, srcWidth,
198 dst, dstStartY, dstEndY, pixelOps, op);
201template<std::
unsigned_
integral Pixel>
203 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
207 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
208 dst, dstStartY, dstEndY, op);
211template<std::
unsigned_
integral Pixel>
213 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
217 doScaleDV<Pixel>(src, srcStartY, srcEndY, srcWidth,
218 dst, dstStartY, dstEndY, pixelOps, op);
221template<std::
unsigned_
integral Pixel>
223 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
229 scaleBlank1to3(src, srcStartY, srcEndY,
230 dst, dstStartY, dstEndY);
233 scale2x1to9x3(src, srcStartY, srcEndY, srcWidth,
234 dst, dstStartY, dstEndY);
237 scale1x1to3x3(src, srcStartY, srcEndY, srcWidth,
238 dst, dstStartY, dstEndY);
241 scale4x1to9x3(src, srcStartY, srcEndY, srcWidth,
242 dst, dstStartY, dstEndY);
245 scale2x1to3x3(src, srcStartY, srcEndY, srcWidth,
246 dst, dstStartY, dstEndY);
249 scale8x1to9x3(src, srcStartY, srcEndY, srcWidth,
250 dst, dstStartY, dstEndY);
253 scale4x1to3x3(src, srcStartY, srcEndY, srcWidth,
254 dst, dstStartY, dstEndY);
263 scaleBlank2to3(src, srcStartY, srcEndY,
264 dst, dstStartY, dstEndY);
267 scale2x2to9x3(src, srcStartY, srcEndY, srcWidth,
268 dst, dstStartY, dstEndY);
271 scale1x2to3x3(src, srcStartY, srcEndY, srcWidth,
272 dst, dstStartY, dstEndY);
275 scale4x2to9x3(src, srcStartY, srcEndY, srcWidth,
276 dst, dstStartY, dstEndY);
279 scale2x2to3x3(src, srcStartY, srcEndY, srcWidth,
280 dst, dstStartY, dstEndY);
283 scale8x2to9x3(src, srcStartY, srcEndY, srcWidth,
284 dst, dstStartY, dstEndY);
287 scale4x2to3x3(src, srcStartY, srcEndY, srcWidth,
288 dst, dstStartY, dstEndY);
296template<std::
unsigned_
integral Pixel>
298 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
303 dst, *superImpose, pixelOps);
304 dispatchScale(src, srcStartY, srcEndY, srcWidth,
305 dst2, dstStartY, dstEndY);
307 dispatchScale(src, srcStartY, srcEndY, srcWidth,
308 dst, dstStartY, dstEndY);
Interface for getting lines from a video frame.
Pixel getLineColor(unsigned line) const
Get the (single) color of the given line.
std::span< const Pixel > getLine(int line, std::span< Pixel > buf) const
Gets a pointer to the pixels of the given line number.
unsigned getHeight() const
Gets the number of lines in this frame.
Polymorphic wrapper around another line scaler.
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Base class for 3x scalers.
virtual void scale2x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale1x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
void scaleImage(FrameSource &src, const RawFrame *superImpose, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY) override
Scales the image in the given area, which must consist of lines which are all equally wide.
virtual void scale4x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scaleBlank1to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale4x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale1x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
Scaler3(const PixelOperations< Pixel > &pixelOps)
virtual void scale4x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x1to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale4x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x2to3x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale8x1to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scaleBlank2to3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale8x2to9x3(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
void dispatchScale(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void fillLine(unsigned y, Pixel color)=0
virtual void releaseLine(unsigned y, std::span< Pixel > buf)=0
virtual std::span< Pixel > acquireLine(unsigned y)=0
constexpr mat4 scale(const vec3 &xyz)
This file implemented 3 utility functions:
auto copy(InputRange &&range, OutputIter out)
#define VLA_SSE_ALIGNED(TYPE, NAME, LENGTH)
constexpr auto xrange(T e)