7 const PixelFormat& format,
unsigned maxWidth_,
unsigned height_)
13 unsigned bytesPerPixel =
format.getBytesPerPixel();
18 pitch = ((bytesPerPixel * maxWidth) + 63) & ~63;
19 data.
resize(pitch * height_);
21 maxWidth = pitch / bytesPerPixel;
25 for (
auto line :
xrange(height_)) {
26 if (bytesPerPixel == 2) {
27 setBlank(line,
static_cast<uint16_t
>(0));
29 setBlank(line,
static_cast<uint32_t
>(0));
37 return lineWidths[line];
41 unsigned line,
unsigned& width,
42 void* ,
unsigned )
const
45 width = lineWidths[line];
46 return data.
data() + line * 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.
const T * data() const
Returns pointer to the start of the memory buffer.
void resize(size_t size)
Grow or shrink the memory block.
void setBlank(unsigned line, Pixel color)
unsigned getRowLength() const override
Returns the distance (in pixels) between two consecutive lines.
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, bool dos1)
Format the given disk (= a single partition).
This file implemented 3 utility functions:
constexpr auto xrange(T e)