C
Qul::PlatformInterface::DrawingDevice Class
class Qul::PlatformInterface::DrawingDeviceDrawingDevice 类定义了一种可用于绘制的设备。更多内容...
| Header: | #include <platforminterface/drawingdevice.h> |
| Since: | Qt Quick Ultralite (Platform) 1.5 |
公共函数
| 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(Qul::PlatformInterface::Point pos) const |
| Qul::PlatformInterface::PixelDataPointer | pixelDataAt(int32_t x, int32_t y) const |
| void * | platformContext() const |
| Qul::PlatformInterface::RenderHints | renderHints() const |
| uchar * | scanLine(int32_t y) const |
| void | setBits(uchar *bits) |
| void | setBytesPerLine(int32_t bytesPerLine) |
| void | setPlatformContext(void *context) |
| void | setRenderHint(Qul::PlatformInterface::RenderHint hint, bool on = true) |
| void | setSize(Qul::PlatformInterface::Size size) |
| const Qul::PlatformInterface::Size & | size() const |
| bool | testRenderHint(Qul::PlatformInterface::RenderHint hint) const |
| int32_t | width() const |
成员函数文档
DrawingDevice::DrawingDevice(Qul::PixelFormat format, const Qul::PlatformInterface::Size &size, uchar *bits, int32_t bytesPerLine, Qul::PlatformInterface::DrawingEngine *drawingEngine, void *platformContext = NULL)
构建一个绘图设备。
该绘图设备包含所有必要信息,由以下网址构建而成:format 、size 、bits 、bytesPerLine 、platformContext 以及drawingEngine 。
bits 和drawingEngine 不被归为自有域名。
size 必须是非空的。bytesPerLine 必须大于 0。bits 必须是该设备像素数据的有效指针。
uchar *DrawingDevice::bits() const
返回像素数据的起始地址。
另请参阅 setBits()。
int32_t DrawingDevice::bitsPerPixel() const
返回该设备中每个像素的位数。该值由创建该类时指定的格式决定。
另请参阅 Qul::PixelFormat 。
int32_t DrawingDevice::bytesPerLine() const
返回该设备每行的字节数。
在构造该类时必须指定该数值。
另请参阅 setBytesPerLine()。
Qul::PlatformInterface::DrawingEngine *DrawingDevice::drawingEngine() const
返回该设备的绘图引擎。
Qul::PlatformInterface::DrawingEngine *DrawingDevice::fallbackDrawingEngine() const
返回该设备的备用绘图引擎。
Qul::PixelFormat DrawingDevice::format() const
返回该设备的像素格式。
int32_t DrawingDevice::height() const
返回该设备的高度。
Qul::PlatformInterface::PixelDataPointer DrawingDevice::pixelDataAt(Qul::PlatformInterface::Point pos) const
返回给定像素的起始地址。
该像素由以下坐标指定:pos
Qul::PlatformInterface::PixelDataPointer DrawingDevice::pixelDataAt(int32_t x, int32_t y) const
返回给定像素的起始地址。
该像素由坐标x 和y 指定。
void *DrawingDevice::platformContext() const
返回指向低级平台上下文对象的指针
当图形设备调用 beginFrame() 时,绘图设备将基于低级平台上下文进行实例化。该函数可用于获取平台上下文。该上下文可强制转换为特定于该平台的数据类型。
另请参阅 setPlatformContext()。
Qul::PlatformInterface::RenderHints DrawingDevice::renderHints() const
返回一个标志,用于指定此混合操作所需的渲染提示。
另请参阅 testRenderHint() 以及“硬件加速混合”。
uchar *DrawingDevice::scanLine(int32_t y) const
返回给定扫描线的起始地址。
y 该值必须在 0 到设备高度的范围内。
void DrawingDevice::setBits(uchar *bits)
将像素数据的起始地址设置为bits 。
仅当需要切换多个帧缓冲区时,才应在平台的 beginFrame() 函数中使用此函数。
不会获取所有权。
另请参阅 bits()。
void DrawingDevice::setBytesPerLine(int32_t bytesPerLine)
将设备的每行字节数设置为bytesPerLine 。
仅在使用部分帧缓冲策略时,才应从平台的 beginFrame() 函数中调用此函数。
另请参阅 bytesPerLine()。
void DrawingDevice::setPlatformContext(void *context)
将指向低级平台上下文对象的指针设置为context 。
平台可使用此函数来设置平台上下文。
另请参阅 platformContext()。
void DrawingDevice::setRenderHint(Qul::PlatformInterface::RenderHint hint, bool on = true)
如果 `on ` 为真,则在 `DrawingEngine ` 上设置给定的渲染提示(hint );否则清除该渲染提示。
注意: 在渲染函数调用之前调用此方法 ,以提供指导渲染过程的提示。
void DrawingDevice::setSize(Qul::PlatformInterface::Size size)
将设备尺寸设置为size 。
仅在使用部分帧缓冲策略时,才应在平台的 beginFrame() 函数中调用此函数。
另请参阅 size()。
const Qul::PlatformInterface::Size &DrawingDevice::size() const
返回该设备的大小。
另请参阅 setSize()。
bool DrawingDevice::testRenderHint(Qul::PlatformInterface::RenderHint hint) const
如果混合操作需要hint ,则返回true ;否则返回false 。
另请参阅 renderHints() 以及“硬件加速混合”。
int32_t DrawingDevice::width() const
返回该设备的宽度。
在某些 Qt 许可下可用。
了解更多信息。