8 const PixelFormat& format,
unsigned maxWidth_,
unsigned height_)
14 unsigned bytesPerPixel =
format.getBytesPerPixel();
19 pitch = ((bytesPerPixel * maxWidth) + 63) & ~63;
20 data.
resize(
size_t(pitch) * height_);
22 maxWidth = pitch / bytesPerPixel;
26 for (
auto line :
xrange(height_)) {
27 if (bytesPerPixel == 2) {
28 setBlank(line,
static_cast<uint16_t
>(0));
30 setBlank(line,
static_cast<uint32_t
>(0));
38 return lineWidths[line];
42 unsigned line,
unsigned& width,
43 void* ,
unsigned )
const
46 width = lineWidths[line];
47 return data.
data() + line * size_t(pitch);
Interface for getting lines from a video frame.
void setHeight(unsigned height_)
void init(FieldType fieldType_)
(Re)initialize an existing FrameSource.
unsigned getHeight() const
Gets the number of lines in this frame.
@ FIELD_NONINTERLACED
Interlacing is off for this frame.
void resize(size_t size)
Grow or shrink the memory block.
const T * data() const
Returns pointer to the start of the memory buffer.
void setBlank(unsigned line, Pixel color)
unsigned getLineWidth(unsigned line) const override
Gets the number of display pixels on the given line.
RawFrame(const PixelFormat &format, unsigned maxWidth, unsigned height)
bool hasContiguousStorage() const override
Returns true when two consecutive rows are also consecutive in memory.
const void * getLineInfo(unsigned line, unsigned &width, void *buf, unsigned bufWidth) const override
Abstract implementation of getLinePtr().
void format(SectorAccessibleDisk &disk, MSXBootSectorType bootType)
Format the given disk (= a single partition).
This file implemented 3 utility functions:
constexpr auto xrange(T e)