29.11.2014 Views

Fast Models Reference Manual - ARM Information Center

Fast Models Reference Manual - ARM Information Center

Fast Models Reference Manual - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Peripheral and Interface Components<br />

In addition to the public method defined in VisRegion, this class defines the following:<br />

VisRasterLayout const *lock()<br />

Locks the region for client rendering. The VisRasterLayout structure is described<br />

elsewhere. See Struct VisRasterLayout. While the buffer is locked, the client can<br />

modify the pixel data for the buffer. You must not call the methods writeText()<br />

and renderBitmap() while the buffer is locked.<br />

void unlock()<br />

This releases the lock on the render buffer, allowing the buffer to be updated on<br />

screen.<br />

void update(int left, int top, unsigned int width, unsigned int height)<br />

This causes the specified rectangle to be drawn to the GUI.<br />

int writeText(const char *text, int x, int y)<br />

This renders the given ASCII text onto an unlocked VisRenderRegion. The return<br />

value is the x co-ordinate of the end of the string. The default font is 8 pixels high,<br />

and cannot be changed.<br />

void renderBitmap(VisBitmap *bitmap, int x, int y)<br />

Draws a bitmap onto an unlocked VisRenderRegion.<br />

Struct VisRasterLayout<br />

The VisRasterLayout struct defines the layout of the pixel data in a frame-buffer. The lock()<br />

method of the LCD protocol expects to be given a pointer to this structure. You can generate a<br />

suitable instance by calling VisRasterRegion::lock().<br />

The structure contains the following fields:<br />

uint8_t *buffer<br />

This points to the buffer for the rasterized pixel data. The controller can write<br />

pixels into this buffer, but must stick within the bounds specified by the width and<br />

height.<br />

uint32_t pitch<br />

The number of bytes between consecutive raster lines in the pixel data. This can<br />

be greater than the number of bytes per line.<br />

uint32_t width<br />

The width, in pixels, of the render area. This value can be less than the width<br />

requested by the LCD controller when it called lock().<br />

uint32_t height<br />

The height, in pixels, of the render area. This value can be less than the height<br />

requested by the LCD controller when it called lock().<br />

VisPixelFormat format<br />

This structure defines the format of the pixel data in the raster buffer.<br />

bool changed<br />

This is set to true if the pixel format or buffer size has changed since the previous<br />

call to lock().<br />

<strong>ARM</strong> DUI 0423J Copyright © 2008-2011 <strong>ARM</strong>. All rights reserved. 5-155<br />

ID051811<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!