10 , pitch(
narrow<unsigned>(((sizeof(
Pixel) * maxWidth) + 63) & ~63))
17 data.
resize(
size_t(pitch) * height_);
19 maxWidth = pitch /
sizeof(
Pixel);
23 for (
auto line :
xrange(height_)) {
24 setBlank(line,
static_cast<uint32_t
>(0));
31 return lineWidths[line];
35 unsigned line,
unsigned& width,
36 void* ,
unsigned )
const
39 width = lineWidths[line];
40 return data.
data() + line * size_t(pitch);
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.
unsigned getLineWidth(unsigned line) const override
Gets the number of display pixels on the given line.
RawFrame(unsigned maxWidth, unsigned height)
void setBlank(unsigned line, Pixel color)
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().
This file implemented 3 utility functions:
constexpr To narrow(From from) noexcept
constexpr auto xrange(T e)