C

QSafeRenderer Class

(SafeRenderer::QSafeRenderer)

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

Header: #include <QSafeRenderer>
Since: QtSafeRenderer 1.0

Public Types

enum RendererException { UnsupportedSurfaceFormat, BitmapOutOfScreen, InvalidBitmapPointer, InvalidBitmapId }

Public Functions

QSafeRenderer(AbstractWindow * const window, QSafeLayout * const layout)
~QSafeRenderer()
void clear(const ARGB &pixel)
void clearBitmap(const qint32 id)
void clearBitmap(const qchar * const itemName)
void drawBitmap(const qint32 id)
void drawBitmap(const qchar * const itemName)
bool setLayout(QSafeLayout * const layout)
typedef qchar
typedef qint32
typedef qint64
typedef qint
typedef quchar
typedef quint8
typedef quint16
typedef quint32
typedef quint64

Detailed Description

The QSafeRenderer class renders the safe layout.

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.

ConstantValueDescription
SafeRenderer::QSafeRenderer::UnsupportedSurfaceFormat0The bits per pixel value in the window is neither 16 or 32.
SafeRenderer::QSafeRenderer::BitmapOutOfScreen1The bitmap does not fit inside the screen area.
SafeRenderer::QSafeRenderer::InvalidBitmapPointer2The bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapId3The bitmap ID is 0.

Member Function Documentation

QSafeRenderer::QSafeRenderer(AbstractWindow * const window, 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:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeLayout::LayoutException::UnknownBitmapIdThe bitmap could not found bitmap by given ID.
SafeRenderer::QSafeLayout::LayoutException::UnknownItemThe item could not be found.
SafeRenderer::QSafeLayout::LayoutException::ItemOutOfBoundsThe item's position is out of the layout's boundaries.
SafeRenderer::QSafeLayout::LayoutException::ItemOverlapsWithOthersThe item overlaps with the other items on the screen.
SafeRenderer::QSafeRenderer::RendererException::UnsupportedSurfaceFormatThe bits per pixel value in the window is neither 16 or 32.

QSafeRenderer::~QSafeRenderer()

Destroys the safe renderer.

void QSafeRenderer::clear(const ARGB &pixel)

Fill the screen with the pixel color.

void QSafeRenderer::clearBitmap(const qint32 id)

Clears the bitmap id from the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

void QSafeRenderer::clearBitmap(const qchar * const itemName)

Clears the bitmap itemName from the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

void QSafeRenderer::drawBitmap(const qint32 id)

Draws bitmap id to the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

void QSafeRenderer::drawBitmap(const qchar * const itemName)

Draws the bitmap itemName to the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

bool QSafeRenderer::setLayout(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 SafeRenderer::qchar

Qt-style synonym for 8-bit signed char.

typedef SafeRenderer::qint32

Qt-style synonym for 32-bit signed int.

typedef SafeRenderer::qint64

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

typedef SafeRenderer::qint

Qt-style synonym for 32-bit signed int.

typedef SafeRenderer::quchar

Qt-style synonym for 8-bit unsigned char.

typedef SafeRenderer::quint8

Qt-style synonym for 8-bit unsigned char.

typedef SafeRenderer::quint16

Qt-style synonym for 16-bit unsigned short.

typedef SafeRenderer::quint32

Qt-style synonym for 32-bit unsigned int.

typedef SafeRenderer::quint64

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

Available under certain Qt licenses.
Find out more.