13template<std::
unsigned_
integral Pixel>
19template<std::
unsigned_
integral Pixel>
24 for (
unsigned srcY = srcStartY, dstY = dstStartY;
25 dstY < dstEndY; srcY += 1, dstY += 2) {
32template<std::
unsigned_
integral Pixel>
37 for (
unsigned srcY = srcStartY, dstY = dstStartY;
38 dstY < dstEndY; srcY += 1, dstY += 1) {
44template<std::
unsigned_
integral Pixel>
46 unsigned srcStartY,
unsigned ,
unsigned srcWidth,
52 for (
unsigned y = dstStartY; y < dstEndY; y += 2, ++srcStartY) {
53 auto srcLine = src.
getLine(srcStartY, buf);
55 scale(srcLine, dstLine0);
57 copy(dstLine0, dstLine1);
63template<std::
unsigned_
integral Pixel>
64static void doScale2(FrameSource& src,
65 unsigned srcStartY,
unsigned ,
unsigned srcWidth,
66 ScalerOutput<Pixel>& dst,
unsigned dstStartY,
unsigned dstEndY,
67 PolyLineScaler<Pixel>&
scale)
70 for (
unsigned srcY = srcStartY, dstY = dstStartY;
71 dstY < dstEndY; ++dstY, ++srcY) {
72 auto srcLine = src.getLine(srcY, buf);
73 auto dstLine = dst.acquireLine(dstY);
74 scale(srcLine, dstLine);
75 dst.releaseLine(dstY, dstLine);
80template<std::
unsigned_
integral Pixel>
82 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
86 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
87 dst, dstStartY, dstEndY, op);
90template<std::
unsigned_
integral Pixel>
92 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
96 doScale2<Pixel>(src, srcStartY, srcEndY, srcWidth,
97 dst, dstStartY, dstEndY, op);
106template<std::
unsigned_
integral Pixel>
108 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
112 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
113 dst, dstStartY, dstEndY, op);
116template<std::
unsigned_
integral Pixel>
118 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
122 doScale2<Pixel>(src, srcStartY, srcEndY, srcWidth,
123 dst, dstStartY, dstEndY, op);
126template<std::
unsigned_
integral Pixel>
128 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
132 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
133 dst, dstStartY, dstEndY, op);
136template<std::
unsigned_
integral Pixel>
138 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
142 doScale2<Pixel>(src, srcStartY, srcEndY, srcWidth,
143 dst, dstStartY, dstEndY, op);
146template<std::
unsigned_
integral Pixel>
148 unsigned srcStartY,
unsigned ,
unsigned srcWidth,
152 assert(dst.
getWidth() == srcWidth); (void)srcWidth;
154 for (
unsigned y = dstStartY; y < dstEndY; y += 2, ++srcStartY) {
156 auto srcLine = src.
getLine(srcStartY, dstLine0);
157 if (srcLine.data() != dstLine0.data())
copy(srcLine, dstLine0);
159 copy(dstLine0, dstLine1);
165template<std::
unsigned_
integral Pixel>
167 unsigned srcStartY,
unsigned ,
unsigned srcWidth,
171 assert(dst.
getWidth() == srcWidth); (void)srcWidth;
173 for (
unsigned srcY = srcStartY, dstY = dstStartY;
174 dstY < dstEndY; ++dstY, ++srcY) {
176 auto srcLine = src.
getLine(srcY, dstLine);
177 if (srcLine.data() != dstLine.data())
copy(srcLine, dstLine);
182template<std::
unsigned_
integral Pixel>
184 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
188 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
189 dst, dstStartY, dstEndY, op);
192template<std::
unsigned_
integral Pixel>
194 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
198 doScale2<Pixel>(src, srcStartY, srcEndY, srcWidth,
199 dst, dstStartY, dstEndY, op);
202template<std::
unsigned_
integral Pixel>
204 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
208 doScale1<Pixel>(src, srcStartY, srcEndY, srcWidth,
209 dst, dstStartY, dstEndY, op);
212template<std::
unsigned_
integral Pixel>
214 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
218 doScale2<Pixel>(src, srcStartY, srcEndY, srcWidth,
219 dst, dstStartY, dstEndY, op);
222template<std::
unsigned_
integral Pixel>
224 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
230 scaleBlank1to2(src, srcStartY, srcEndY,
231 dst, dstStartY, dstEndY);
234 scale1x1to3x2(src, srcStartY, srcEndY, srcWidth,
235 dst, dstStartY, dstEndY);
238 scale1x1to2x2(src, srcStartY, srcEndY, srcWidth,
239 dst, dstStartY, dstEndY);
242 scale2x1to3x2(src, srcStartY, srcEndY, srcWidth,
243 dst, dstStartY, dstEndY);
246 scale1x1to1x2(src, srcStartY, srcEndY, srcWidth,
247 dst, dstStartY, dstEndY);
250 scale4x1to3x2(src, srcStartY, srcEndY, srcWidth,
251 dst, dstStartY, dstEndY);
254 scale2x1to1x2(src, srcStartY, srcEndY, srcWidth,
255 dst, dstStartY, dstEndY);
264 scaleBlank1to1(src, srcStartY, srcEndY,
265 dst, dstStartY, dstEndY);
268 scale1x1to3x1(src, srcStartY, srcEndY, srcWidth,
269 dst, dstStartY, dstEndY);
272 scale1x1to2x1(src, srcStartY, srcEndY, srcWidth,
273 dst, dstStartY, dstEndY);
276 scale2x1to3x1(src, srcStartY, srcEndY, srcWidth,
277 dst, dstStartY, dstEndY);
280 scale1x1to1x1(src, srcStartY, srcEndY, srcWidth,
281 dst, dstStartY, dstEndY);
284 scale4x1to3x1(src, srcStartY, srcEndY, srcWidth,
285 dst, dstStartY, dstEndY);
288 scale2x1to1x1(src, srcStartY, srcEndY, srcWidth,
289 dst, dstStartY, dstEndY);
297template<std::
unsigned_
integral Pixel>
299 unsigned srcStartY,
unsigned srcEndY,
unsigned srcWidth,
304 dst, *superImpose, pixelOps);
305 dispatchScale(src, srcStartY, srcEndY, srcWidth,
306 dst2, dstStartY, dstEndY);
308 dispatchScale(src, srcStartY, srcEndY, srcWidth,
309 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 2x scalers.
virtual void scale1x1to1x1(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale1x1to2x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale1x1to3x1(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 scale4x1to3x1(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scaleBlank1to2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale1x1to3x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x1to3x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale1x1to2x1(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scaleBlank1to1(FrameSource &src, unsigned srcStartY, unsigned srcEndY, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
Scaler2(const PixelOperations< Pixel > &pixelOps)
virtual void scale4x1to3x2(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 scale1x1to1x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x1to3x1(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x1to1x2(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual void scale2x1to1x1(FrameSource &src, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, ScalerOutput< Pixel > &dst, unsigned dstStartY, unsigned dstEndY)
virtual unsigned getWidth() const =0
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)