C

DrawingDevice Class

class Qul::PlatformInterface::DrawingDevice

The DrawingDevice class defines a device which can be drawn onto. More...

Header: #include <platforminterface/drawingdevice.h>
Since: Qt Quick Ultralite (Platform) 1.5

Public Functions

DrawingDevice(Qul::PixelFormat format, const Qul::PlatformInterface::Size &size, uchar *bits, int32_t bytesPerLine, Qul::PlatformInterface::DrawingEngine *drawingEngine, void *platformContext = NULL)
uchar *bits() const
int32_t bitsPerPixel() const
int32_t bytesPerLine() const
Qul::PlatformInterface::DrawingEngine *drawingEngine() const
Qul::PlatformInterface::DrawingEngine *fallbackDrawingEngine() const
Qul::PixelFormat format() const
int32_t height() const
Qul::PlatformInterface::PixelDataPointer pixelDataAt(int32_t x, int32_t y) const
Qul::PlatformInterface::PixelDataPointer pixelDataAt(Qul::PlatformInterface::Point pos) const
void *platformContext() const
uchar *scanLine(int32_t y) const
void setBits(uchar *bits)
void setBytesPerLine(int32_t bytesPerLine)
void setPlatformContext(void *context)
void setSize(Qul::PlatformInterface::Size size)
const Qul::PlatformInterface::Size &size() const
int32_t width() const

Detailed Description

It contains all information that is needed for a painting engine to draw.

Member Function Documentation

DrawingDevice::DrawingDevice(Qul::PixelFormat format, const Qul::PlatformInterface::Size &size, uchar *bits, int32_t bytesPerLine, Qul::PlatformInterface::DrawingEngine *drawingEngine, void *platformContext = NULL)

Constructs a drawing device.

The drawing device with all required information is construced from format, size, bits, bytesPerLine, platformContext and drawingEngine.

No ownership is taken of bits or drawingEngine.

size has to be non-empty. bytesPerLine has to greater than 0. bits has to be a valid pointer to the pixel data of this device.

uchar *DrawingDevice::bits() const

Returns the starting address of the pixel data.

See also setBits().

int32_t DrawingDevice::bitsPerPixel() const

Returns the number of bits per pixel of this device. The value is determined by the format given when constructing this class.

See also Qul::PixelFormat.

int32_t DrawingDevice::bytesPerLine() const

Returns the number of bytes per line of this device.

The number has to be specified when constructing this class.

See also setBytesPerLine().

Qul::PlatformInterface::DrawingEngine *DrawingDevice::drawingEngine() const

Returns the drawing engine of this device.

Qul::PlatformInterface::DrawingEngine *DrawingDevice::fallbackDrawingEngine() const

Returns the fallback drawing engine for this device.

Qul::PixelFormat DrawingDevice::format() const

Returns the pixel format of this device.

int32_t DrawingDevice::height() const

Returns the height of this device.

Qul::PlatformInterface::PixelDataPointer DrawingDevice::pixelDataAt(int32_t x, int32_t y) const

Returns the starting address of a given pixel.

The pixel is specified by coordinates x and y.

Qul::PlatformInterface::PixelDataPointer DrawingDevice::pixelDataAt(Qul::PlatformInterface::Point pos) const

Returns the starting address of a given pixel.

The pixel is specified by coordinates from pos

void *DrawingDevice::platformContext() const

Returns pointer to lower level platform context object

When beginFrame() is called by graphics device, drawing device is instantiated with lower level platform context. This function can be used to obtain the platform context. This can be type-casted to the data-type which is specific to the platform.

See also setPlatformContext().

uchar *DrawingDevice::scanLine(int32_t y) const

Returns the starting address of a given scan line.

y has to be in the range of 0 to the height of the device.

void DrawingDevice::setBits(uchar *bits)

Sets the starting address of the pixel data to bits.

This function should only be used from platform's beginFrame() function when there are multiple framebuffers to be switched.

No ownership is taken.

See also bits().

void DrawingDevice::setBytesPerLine(int32_t bytesPerLine)

Sets the number of bytes per line of the device to bytesPerLine.

This function should only be used from platform's beginFrame() function when using the partial framebuffer strategy.

See also bytesPerLine().

void DrawingDevice::setPlatformContext(void *context)

Sets a pointer to the lower level platform context object to context.

This function can be used by the platform to set the platform context.

See also platformContext().

void DrawingDevice::setSize(Qul::PlatformInterface::Size size)

Sets the size of the device to size.

This function should only be used from platform's beginFrame() function when using the partial framebuffer strategy.

See also size().

const Qul::PlatformInterface::Size &DrawingDevice::size() const

Returns the size of this device.

See also setSize().

int32_t DrawingDevice::width() const

Returns the width of this device.

Available under certain Qt licenses.
Find out more.