C

QSafeRenderer Class

class SafeRenderer::QSafeRenderer

The QSafeRenderer class renders the safe layout. More...

Header: #include <QSafeRenderer>
Since: QtSafeRenderer 1.0

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)

Detailed Description

The QSafeRenderer class draws and clears the bitmaps defined in the QSafeLayout class.

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:

ExceptionIdDescription
SafeRenderer::QSafeLayoutExceptionSafeRenderer::QSafeLayoutException::LayoutException::UnknownBitmapIdThe bitmap could not found bitmap by given ID.
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeLayoutException::LayoutException::UnknownItemThe item could not be found.
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeLayoutException::LayoutException::ItemOutOfBoundsThe item's position is out of the layout's boundaries.
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeLayoutException::RendererException::UnsupportedSurfaceFormatThe 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:

ExceptionIdDescription
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapIdThe bitmap ID is 0.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::UnsupportedSurfaceFormatThe 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:

ExceptionIdDescription
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapIdThe bitmap ID is 0.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::UnsupportedSurfaceFormatThe 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:

ExceptionIdDescription
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapIdThe 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:

ExceptionIdDescription
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::InvalidBitmapIdThe bitmap ID is 0.
SafeRenderer::QSafeRendererExceptionSafeRenderer::QSafeRendererException::RendererException::UnsupportedSurfaceFormatThe 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

qchar

Qt-style synonym for 8-bit signed char.

qint8

Qt-style synonym for 8-bit signed char.

qint32

Qt-style synonym for 32-bit signed int.

qint64

Qt-style synonym for 64-bit signed long long.

qint

Qt-style synonym for 32-bit signed int.

quchar

Qt-style synonym for 8-bit unsigned char.

quint8

Qt-style synonym for 8-bit unsigned char.

quint16

Qt-style synonym for 16-bit unsigned short.

quint32

Qt-style synonym for 32-bit unsigned int.

quint64

Qt-style synonym for 64-bit unsigned long long.

Available under certain Qt licenses.
Find out more.