Unit GraphicsConsole

From Ultibo.org
Revision as of 05:05, 1 August 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


The Graphics console unit provides access to the underlying framebuffer device as a pixel interface that allows putting blocks (or rectangles) of pixel data on to the screen or getting rectangles of pixel data from the screen. Functions are also included to copy a rectangle from one part of the screen to another and to put text (with a specified font) on to the screen.

Most image formats either consist of, or can be decoded to, a block of data that is a number of horizontal rows each with a number of pixels (columns) with each pixel containing color information in a certain bit size (8/16/24/32) and format (RGB/BGR/RGBA etc).

If the data exists in memory as a single contiguous block with each row following directly after the previous row then that can be passed directly to the functions in this unit (eg GraphicsWindowDrawImage) to be drawn on the screen.

Many graphics libraries do image manipulation, rendering and compositing to a memory buffer in a form that is compatible with the functions in this unit so a complex image can be constructed in memory and then transferred to the screen in a single operation. This is sometimes referred to as a bit block transfer or BitBlt and is a very standard technique for rendering both text and images to a framebuffer device.

This unit extends the console unit by creating a new type of console window (WINDOW_MODE_GRAPHICS) and therefore allows both text console windows and graphics console windows to co-exist on the screen at once.

The functions in this unit cannot be used to draw on a text console window (WINDOW_MODE_TEXT) and vice versa the functions in the console unit cannot be used to draw on a graphics console window.

Like the console unit, the graphics console supports setting a viewport for a specified window to allow masking the area to be written to. However the graphics console does not support a tracking a cursor X and Y position. Setting a window as the default is also not supported since that functionality is purely intended to support the RTL functions for text output.

Graphics windows can only be created on console devices which have a mode of CONSOLE_MODE_PIXEL.

Notes: Unlike the Console unit, Graphics console coordinates are always based on pixels not characters. Graphics console coordinates begin at 0,0 and extend to Width - 1, Height - 1. Graphics Window coordinates X,Y are always based on pixels, beginning at 0,0 and extending to Cols - 1, Rows - 1.

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure GraphicsConsoleInit;
Description: To be documented
Note To be documented



Return to Unit Reference