C
QSafeRenderer Class
class SafeRenderer::QSafeRendererThe QSafeRenderer class renders the safe layout. More...
Header: | #include <QSafeRenderer> |
Since: | QtSafeRenderer 1.0 |
This class was introduced in QtSafeRenderer 1.0.
Public Types
enum | RendererException { UnsupportedSurfaceFormat, BitmapOutOfScreen, InvalidBitmapPointer, InvalidBitmapId } |
Public Functions
QSafeRenderer(SafeRenderer::AbstractWindow *const window, SafeRenderer::QSafeLayout *const layout) | |
~QSafeRenderer() | |
SafeRenderer::QSafeRect | clear(const SafeRenderer::ARGB pixel) |
SafeRenderer::QSafeRect | clearBitmap(const SafeRenderer::quint32 itemId, const bool useGlobalClearColor) |
SafeRenderer::QSafeRect | clearBitmap(const SafeRenderer::qchar *const itemName, const bool useGlobalClearColor) |
SafeRenderer::QSafeRect | drawBitmap(const SafeRenderer::quint32 itemId) |
SafeRenderer::QSafeRect | drawBitmap(const SafeRenderer::qchar *const itemName) |
bool | setLayout(SafeRenderer::QSafeLayout *const layout) |
Related Non-Members
typedef | qchar |
typedef | qint8 |
typedef | qint32 |
typedef | qint64 |
typedef | qint |
typedef | quchar |
typedef | quint8 |
typedef | quint16 |
typedef | quint32 |
typedef | quint64 |
Detailed Description
The QSafeRenderer class draws and clears the bitmaps defined in the QSafeLayout class.
Member Type Documentation
enum QSafeRenderer::RendererException
This enum describes the exception values in the QSafeRenderer class.
Constant | Value | Description |
---|---|---|
SafeRenderer::QSafeRenderer::UnsupportedSurfaceFormat | 0 | The bits per pixel value in the window is neither 16 or 32. |
SafeRenderer::QSafeRenderer::BitmapOutOfScreen | 1 | The bitmap does not fit inside the screen area. |
SafeRenderer::QSafeRenderer::InvalidBitmapPointer | 2 | The bitmap pointer is a null pointer. |
SafeRenderer::QSafeRenderer::InvalidBitmapId | 3 | The bitmap ID is 0. |
Member Function Documentation
QSafeRenderer::QSafeRenderer(SafeRenderer::AbstractWindow *const window, SafeRenderer::QSafeLayout *const layout)
Constructs a safe renderer object with a window and layout. window is the target window where the bitmap is drawn. layout hold the layout data position.
In case of a failure, one of the following exceptions will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeLayout::LayoutException::UnknownBitmapId | The bitmap could not found bitmap by given ID. |
SafeRenderer::QSafeLayout::LayoutException::UnknownItem | The item could not be found. |
SafeRenderer::QSafeLayout::LayoutException::ItemOutOfBounds | The item's position is out of the layout's boundaries. |
SafeRenderer::QSafeRenderer::RendererException::UnsupportedSurfaceFormat | The bits per pixel value in the window is neither 16 nor 32, or the given framebuffer address is NULL, or the framebuffer is not 32-bit word aligned. |
QSafeRenderer::~QSafeRenderer()
Destroys the safe renderer.
SafeRenderer::QSafeRect QSafeRenderer::clear(const SafeRenderer::ARGB pixel)
Fills the screen with the pixel color.
SafeRenderer::QSafeRect QSafeRenderer::clearBitmap(const SafeRenderer::quint32 itemId, const bool useGlobalClearColor)
Clears the bitmap itemId from the screen.
Fills in the bitmap's rectangle with m_clearColor if useGlobalClearColor is true; otherwise use fillColor property if bitmap has it. In case of a failure, one of the following exceptions will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeRenderer::BitmapOutOfScreen | The bitmap does not fit to the screen. |
SafeRenderer::QSafeRenderer::InvalidBitmapPointer | The bitmap pointer is a null pointer. |
SafeRenderer::QSafeRenderer::InvalidBitmapId | The bitmap ID is 0. |
SafeRenderer::QSafeRenderer::UnsupportedSurfaceFormat | The bits per pixel value in the window is neither 16 nor 32, or the given framebuffer address is NULL, or the framebuffer is not 32-bit word aligned. |
SafeRenderer::QSafeRect QSafeRenderer::clearBitmap(const SafeRenderer::qchar *const itemName, const bool useGlobalClearColor)
Clears the bitmap itemName from the screen.
Fills in the bitmap's rectangle with m_clearColor if useGlobalClearColor is true; otherwise use fillColor property if bitmap has it. In case of a failure, one of the following exceptions will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeRenderer::BitmapOutOfScreen | The bitmap does not fit to the screen. |
SafeRenderer::QSafeRenderer::InvalidBitmapPointer | The bitmap pointer is a null pointer. |
SafeRenderer::QSafeRenderer::InvalidBitmapId | The bitmap ID is 0. |
SafeRenderer::QSafeRenderer::UnsupportedSurfaceFormat | The bits per pixel value in the window is neither 16 nor 32, or the given framebuffer address is NULL, or the framebuffer is not 32-bit word aligned. |
SafeRenderer::QSafeRect QSafeRenderer::drawBitmap(const SafeRenderer::quint32 itemId)
Draws bitmap itemId to the screen.
In case of a failure, one of the following exceptions will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeRenderer::BitmapOutOfScreen | The bitmap does not fit to the screen. |
SafeRenderer::QSafeRenderer::InvalidBitmapPointer | The bitmap pointer is a null pointer. |
SafeRenderer::QSafeRenderer::InvalidBitmapId | The bitmap ID is 0. |
SafeRenderer::QSafeRect QSafeRenderer::drawBitmap(const SafeRenderer::qchar *const itemName)
Draws the bitmap itemName to the screen.
In case of a failure, one of the following exceptions will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeRenderer::BitmapOutOfScreen | The bitmap does not fit to the screen. |
SafeRenderer::QSafeRenderer::InvalidBitmapPointer | The bitmap pointer is a null pointer. |
SafeRenderer::QSafeRenderer::InvalidBitmapId | The bitmap ID is 0. |
SafeRenderer::QSafeRenderer::UnsupportedSurfaceFormat | The bits per pixel value in the window is neither 16 nor 32, or the given framebuffer address is NULL, or the framebuffer is not 32-bit word aligned. |
bool QSafeRenderer::setLayout(SafeRenderer::QSafeLayout *const layout)
Sets the layout to layout.
It is possible to change renderer layout on runtime. The size of the new layout must match the current layout.
Returns true if setting the layout succeeded, otherwise false.
Related Non-Members
typedef qchar
Qt-style synonym for 8-bit signed char
.
typedef qint8
Qt-style synonym for 8-bit signed char
.
typedef qint32
Qt-style synonym for 32-bit signed int
.
typedef qint64
Qt-style synonym for 64-bit signed long long
.
typedef qint
Qt-style synonym for 32-bit signed int
.
typedef quchar
Qt-style synonym for 8-bit unsigned char
.
typedef quint8
Qt-style synonym for 8-bit unsigned char
.
typedef quint16
Qt-style synonym for 16-bit unsigned short
.
typedef quint32
Qt-style synonym for 32-bit unsigned int
.
typedef quint64
Qt-style synonym for 64-bit unsigned long long
.
Available under certain Qt licenses.
Find out more.