13 template<
typename Pixel>
20 [[nodiscard]]
unsigned getLineWidth(
unsigned line)
const override;
21 [[nodiscard]]
const void* getLineInfo(
22 unsigned line,
unsigned& width,
23 void* buf,
unsigned bufWidth)
const override;
35 if (
format.getBytesPerPixel() == 2) {
36 return std::make_unique<SuperImposedFrameImpl<uint16_t>>(
format);
40 if (
format.getBytesPerPixel() == 4) {
41 return std::make_unique<SuperImposedFrameImpl<uint32_t>>(
format);
63 template<
typename Pixel>
71 template<
typename Pixel>
74 unsigned tNum = (getHeight() == top ->getHeight()) ? line : line / 2;
75 unsigned bNum = (getHeight() == bottom->getHeight()) ? line : line / 2;
76 unsigned tWidth = top ->getLineWidth(tNum);
77 unsigned bWidth = bottom->getLineWidth(bNum);
81 template<
typename Pixel>
82 const void* SuperImposedFrameImpl<Pixel>::getLineInfo(
83 unsigned line,
unsigned& width,
void* buf,
unsigned bufWidth)
const
85 unsigned tNum = (getHeight() == top ->getHeight()) ? line : line / 2;
86 unsigned bNum = (getHeight() == bottom->getHeight()) ? line : line / 2;
87 unsigned tWidth = top ->getLineWidth(tNum);
88 unsigned bWidth = bottom->getLineWidth(bNum);
92 auto* tBuf =
static_cast<Pixel*
>(buf);
94 auto* tLine = top ->getLinePtr(tNum, width, tBuf);
95 auto* bLine = bottom->getLinePtr(bNum, width, bBuf);
97 AlphaBlendLines<Pixel> blend(pixelOps);
98 blend(tLine, bLine, tBuf, width);
Interface for getting lines from a video frame.
void setHeight(unsigned height_)
unsigned getHeight() const
Gets the number of lines in this frame.
SuperImposedFrameImpl(const PixelFormat &format)
This class represents a frame that is the (per-pixel) alpha-blend of two other frames.
void init(const FrameSource *top, const FrameSource *bottom)
static std::unique_ptr< SuperImposedFrame > create(const PixelFormat &format)
const FrameSource * bottom
SuperImposedFrame(const PixelFormat &format)
constexpr vecN< N, T > min(const vecN< N, T > &x, const vecN< N, T > &y)
constexpr vecN< N, T > max(const vecN< N, T > &x, const vecN< N, T > &y)
void format(SectorAccessibleDisk &disk, bool dos1)
Format the given disk (= a single partition).
This file implemented 3 utility functions:
#define VLA_SSE_ALIGNED(TYPE, NAME, LENGTH)