9 struct SDL_PixelFormat;
66 for (
unsigned line = 1; line < height; ++line) {
74 template <
typename Pixel>
86 template <
typename Pixel>
89 line = std::min<unsigned>(std::max(0, line),
getHeight() - 1);
90 unsigned internalWidth;
91 auto internalData =
reinterpret_cast<const Pixel*
>(
93 if (internalWidth == width) {
97 return scaleLine(internalData, internalWidth, width);
106 template <
typename Pixel>
108 int line,
unsigned numLines,
unsigned& actualLines,
109 unsigned width)
const
113 if ((line < 0) || (height <= line)) {
114 return getLinePtr<Pixel>(line, width);
116 unsigned internalWidth;
117 auto internalData =
reinterpret_cast<const Pixel*
>(
119 if (internalWidth != width) {
120 return scaleLine(internalData, internalWidth, width);
127 if ((line == height) || (
getLineWidth(line) != width)) {
142 template <
typename Pixel>
149 template <
typename Pixel>
156 template <
typename Pixel>
182 explicit FrameSource(
const SDL_PixelFormat& format);
190 virtual const void*
getLineInfo(
unsigned line,
unsigned& width)
const = 0;
206 template <
typename Pixel>
const Pixel* scaleLine(
207 const Pixel* in,
unsigned inWidth,
unsigned outWidth)
const;
208 template <
typename Pixel>
const Pixel* blendLines(
209 const Pixel* line1,
const Pixel* line2,
unsigned width)
const;
213 const SDL_PixelFormat& pixelFormat;
220 mutable std::vector<void*> tempBuffers;
221 mutable unsigned tempCounter;
226 #endif // FRAMESOURCE_HH