14template<std::
unsigned_
integral Pixel>
21 [[nodiscard]]
unsigned getLineWidth(
unsigned line)
const override;
22 [[nodiscard]]
const void* getLineInfo(
23 unsigned line,
unsigned& width,
24 void* buf,
unsigned bufWidth)
const override;
36 if (
format.getBytesPerPixel() == 2) {
37 return std::make_unique<SuperImposedFrameImpl<uint16_t>>(
format);
41 if (
format.getBytesPerPixel() == 4) {
42 return std::make_unique<SuperImposedFrameImpl<uint32_t>>(
format);
64template<std::
unsigned_
integral Pixel>
72template<std::
unsigned_
integral Pixel>
75 unsigned tNum = (getHeight() == top ->getHeight()) ? line : line / 2;
76 unsigned bNum = (getHeight() == bottom->getHeight()) ? line : line / 2;
77 unsigned tWidth = top ->getLineWidth(tNum);
78 unsigned bWidth = bottom->getLineWidth(bNum);
82template<std::
unsigned_
integral Pixel>
83const void* SuperImposedFrameImpl<Pixel>::getLineInfo(
84 unsigned line,
unsigned& width,
void* buf,
unsigned bufWidth)
const
86 unsigned tNum = (getHeight() == top ->getHeight()) ? line : line / 2;
87 unsigned bNum = (getHeight() == bottom->getHeight()) ? line : line / 2;
88 unsigned tWidth = top ->getLineWidth(tNum);
89 unsigned bWidth = bottom->getLineWidth(bNum);
93 auto tBuf = std::span{
static_cast<Pixel*
>(buf), width};
95 auto tLine = top ->getLine(tNum, tBuf);
96 auto bLine = bottom->getLine(bNum, bBuf);
98 AlphaBlendLines<Pixel> blend(pixelOps);
99 blend(tLine, bLine, tBuf);
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, MSXBootSectorType bootType)
Format the given disk (= a single partition).
This file implemented 3 utility functions:
#define VLA_SSE_ALIGNED(TYPE, NAME, LENGTH)