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

This class was introduced in 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)
uchar *bits() const
int32_t bytesPerLine() const
int32_t bytesPerPixel() const
Qul::PlatformInterface::DrawingEngine *drawingEngine() const
Qul::PlatformInterface::DrawingEngine *fallbackDrawingEngine() const
Qul::PixelFormat format() const
int32_t height() const
uchar *pixelAt(int32_t x, int32_t y) const
uchar *pixelAt(Qul::PlatformInterface::Point pos) const
uchar *scanLine(int32_t y) const
void setBits(uchar *bits)
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)

Constructs a drawing device.

The drawing device with all required information is construced from format, size, bits, bytesPerLine and a 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::bytesPerLine() const

Returns the number of bytes per line of this device.

The number has to be specified when constructing this class.

int32_t DrawingDevice::bytesPerPixel() const

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

See also Qul::PixelFormat.

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.

uchar *DrawingDevice::pixelAt(int32_t x, int32_t y) const

Returns the starting address of a given pixel.

The pixel is specified by coordinates x and y.

uchar *DrawingDevice::pixelAt(Qul::PlatformInterface::Point pos) const

Returns the starting address of a given pixel.

The pixel is specified by coordinates from pos

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().

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

Returns the size of this device.

int32_t DrawingDevice::width() const

Returns the width of this device.

Available under certain Qt licenses.
Find out more.