Difference between revisions of "Unit Framebuffer"

From Ultibo.org
Jump to: navigation, search
Line 221: Line 221:
 
| <code>Rotation:LongWord;</code>
 
| <code>Rotation:LongWord;</code>
 
| Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
 
| Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
 +
|-
 +
| <code>CursorX:LongWord;</code>
 +
| Framebuffer Cursor X (Pixels) (Ignored for Allocate / SetProperties)
 +
|-
 +
| <code>CursorY:LongWord;</code>
 +
| Framebuffer Cursor Y (Pixels) (Ignored for Allocate / SetProperties)
 +
|-
 +
| <code>CursorState:LongWord;</code>
 +
| Framebuffer Cursor State (eg FRAMEBUFFER_CURSOR_ENABLED) (Ignored for Allocate / SetProperties)
 
|-
 
|-
 
|}
 
|}
Line 410: Line 419:
 
|-
 
|-
 
| <code>TFramebufferDeviceSetBacklight = function(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</code>
 
| <code>TFramebufferDeviceSetBacklight = function(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Framebuffer device set cursor'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetCursor = function(Framebuffer:PFramebufferDevice; Width,Height,HotspotX,HotspotY:LongWord; Image:Pointer; Len:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Framebuffer device update cursor'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceUpdateCursor = function(Framebuffer:PFramebufferDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 510: Line 537:
 
| <code>DeviceSetBacklight:TFramebufferDeviceSetBacklight;</code>
 
| <code>DeviceSetBacklight:TFramebufferDeviceSetBacklight;</code>
 
| A device specific DeviceSetBacklight method implementing a standard framebuffer device interface (Optional)
 
| A device specific DeviceSetBacklight method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceSetCursor:TFramebufferDeviceSetCursor;</code>
 +
| A device specific DeviceSetCursor method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceUpdateCursor:TFramebufferDeviceUpdateCursor;</code>
 +
| A device specific DeviceUpdateCursor method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 
|-
 
|-
 
| <code>DeviceGetProperties:TFramebufferDeviceGetProperties;</code>
 
| <code>DeviceGetProperties:TFramebufferDeviceGetProperties;</code>
Line 601: Line 634:
 
| <code>Rotation:LongWord;</code>
 
| <code>Rotation:LongWord;</code>
 
| Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
 
| Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
 +
|-
 +
| <code>CursorX:LongWord;</code>
 +
| Framebuffer Cursor X (Pixels)
 +
|-
 +
| <code>CursorY:LongWord;</code>
 +
| Framebuffer Cursor Y (Pixels)
 +
|-
 +
| <code>CursorState:LongWord;</code>
 +
| Framebuffer Cursor State (eg FRAMEBUFFER_CURSOR_ENABLED)
 
|-
 
|-
 
|colspan="2"|''Buffer Properties''
 
|colspan="2"|''Buffer Properties''
Line 609: Line 651:
 
| <code>CopyBuffer:Pointer;</code>
 
| <code>CopyBuffer:Pointer;</code>
 
| Buffer for overlapped copy
 
| Buffer for overlapped copy
 +
|-
 +
|colspan="2"|''Cursor Properties''
 +
|-
 +
| <code>CursorUpdate:LongBool;</code>
 +
| Flag to indicate if cursor update (Show/Hide) is in progress
 +
|-
 +
| <code>CursorImage:Pointer;</code>
 +
| Buffer for cursor image pixels (COLOR_FORMAT_DEFAULT)
 +
|-
 +
| <code>CursorInput:Pointer;</code>
 +
| Buffer for cursor image pixels (Native color format)
 +
|-
 +
| <code>CursorBuffer:Pointer;</code>
 +
| Buffer for pixels currently under cursor (Native color format)
 +
|-
 +
| <code>CursorOutput:Pointer;</code>
 +
| Buffer for cursor pixels currently displayed (Native color format)
 +
|-
 +
| <code>CursorWidth:LongWord;</code>
 +
| Framebuffer Cursor Width (Pixels)
 +
|-
 +
| <code>CursorHeight:LongWord;</code>
 +
| Framebuffer Cursor Height (Pixels)
 +
|-
 +
| <code>CursorHotspotX:LongWord;</code>
 +
| Framebuffer Cursor Hotspot X (Pixels)
 +
|-
 +
| <code>CursorHotspotY:LongWord;</code>
 +
| Framebuffer Cursor Hotspot Y (Pixels)
 
|-
 
|-
 
|colspan="2"|''Internal Properties''
 
|colspan="2"|''Internal Properties''

Revision as of 02:01, 23 March 2018

Return to Unit Reference


Description


Ultibo Framebuffer interface unit

To be documented

Constants



[Expand]
Framebuffer specific constants FRAMEBUFFER_*


[Expand]
Framebuffer device type FRAMEBUFFER_TYPE_*


[Expand]
Framebuffer device state FRAMEBUFFER_STATE_*


[Expand]
Framebuffer cursor state FRAMEBUFFER_CURSOR_*


[Expand]
Framebuffer device flag FRAMEBUFFER_FLAG_*


[Expand]
Framebuffer transfer flag FRAMEBUFFER_TRANSFER_*


Type definitions



Framebuffer palette

[Expand]

PFramebufferPalette = ^TFramebufferPalette;

TFramebufferPalette = record

Framebuffer properties

[Expand]

PFramebufferProperties = ^TFramebufferProperties;

TFramebufferProperties = record

Framebuffer enumeration callback

TFramebufferEnumerate = function(Framebuffer:PFramebufferDevice; Data:Pointer):LongWord;

Framebuffer notification callback

TFramebufferNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Framebuffer device allocate

TFramebufferDeviceAllocate = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;

Framebuffer device release

TFramebufferDeviceRelease = function(Framebuffer:PFramebufferDevice):LongWord;

Framebuffer device blank

TFramebufferDeviceBlank = function(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;

Framebuffer device read

TFramebufferDeviceRead = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;

Framebuffer device write

TFramebufferDeviceWrite = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;

Framebuffer device mark

TFramebufferDeviceMark = function(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;

Framebuffer device commit

TFramebufferDeviceCommit = function(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;

Framebuffer device get rect

TFramebufferDeviceGetRect = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;

Framebuffer device put rect

TFramebufferDevicePutRect = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;

Framebuffer device copy rect

TFramebufferDeviceCopyRect = function(Framebuffer:PFramebufferDevice; X1,Y1,X2,Y2,Width,Height,Flags:LongWord):LongWord;

Framebuffer device fill rect

TFramebufferDeviceFillRect = function(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Color,Flags:LongWord):LongWord;

Framebuffer device get line

TFramebufferDeviceGetLine = function(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;

Framebuffer device get point

TFramebufferDeviceGetPoint = function(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;

Framebuffer device wait sync

TFramebufferDeviceWaitSync = function(Framebuffer:PFramebufferDevice):LongWord;

Framebuffer device get offset

TFramebufferDeviceGetOffset = function(Framebuffer:PFramebufferDevice; var X,Y:LongWord):LongWord;

Framebuffer device set offset

TFramebufferDeviceSetOffset = function(Framebuffer:PFramebufferDevice; X,Y:LongWord;Pan:Boolean):LongWord;

Framebuffer device get palette

TFramebufferDeviceGetPalette = function(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;

Framebuffer device set palette

TFramebufferDeviceSetPalette = function(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;

Framebuffer device set backlight

TFramebufferDeviceSetBacklight = function(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;

Framebuffer device set cursor

TFramebufferDeviceSetCursor = function(Framebuffer:PFramebufferDevice; Width,Height,HotspotX,HotspotY:LongWord; Image:Pointer; Len:LongWord):LongWord;

Framebuffer device update cursor

TFramebufferDeviceUpdateCursor = function(Framebuffer:PFramebufferDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;

Framebuffer device get properties

TFramebufferDeviceGetProperties = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;

Framebuffer device set properties

TFramebufferDeviceSetProperties = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;

Framebuffer device

[Expand]

PFramebufferDevice = ^TFramebufferDevice;

TFramebufferDevice = record


Public variables



Initialization handlers

FramebufferInitHandler:TFramebufferInit;


Function declarations



Initialization functions

[Expand]
procedure FramebufferInit;
Description: To be documented


Framebuffer functions

[Expand]
function FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate and enable a framebuffer device using supplied properties or defaults


[Expand]
function FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: Disable and release a framebuffer device


[Expand]
function FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Blank (Turn off) the display of a framebuffer device


[Expand]
function FramebufferDeviceRead(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;
Description: Read one or more pixels from framebuffer device memory to a supplied buffer


[Expand]
function FramebufferDeviceWrite(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;
Description: Write one or more pixels to framebuffer device memory from a supplied buffer


[Expand]
function FramebufferDeviceMark(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;
Description: Mark a region written to the framebuffer and signal the device to take any neccessary actions


[Expand]
function FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;
Description: Commit a region written to the framebuffer and signal the device to take any neccessary actions


[Expand]
function FramebufferDeviceGetRect(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;
Description: Get a rectangular area of pixels from framebuffer memory to a supplied buffer


[Expand]
function FramebufferDevicePutRect(Framebuffer:PFramebufferDevice; X,Y:LongWord;Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;
Description: Put a rectangular area of pixels from a supplied buffer to framebuffer memory


[Expand]
function FramebufferDeviceCopyRect(Framebuffer:PFramebufferDevice; X1,Y1,X2,Y2,Width,Height,Flags:LongWord):LongWord;
Description: Copy a rectangular area of pixels within framebuffer memory


[Expand]
function FramebufferDeviceFillRect(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Color,Flags:LongWord):LongWord;
Description: Fill a rectangular area of pixels within framebuffer memory


[Expand]
function FramebufferDeviceGetLine(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;
Description: Get the address of the start of a row in framebuffer memory


[Expand]
function FramebufferDeviceGetPoint(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;
Description: Get the address of the specified row and column in framebuffer memory


[Expand]
function FramebufferDeviceWaitSync(Framebuffer:PFramebufferDevice):LongWord;
Description: Wait for the next vertical sync signal from the display hardware


[Expand]
function FramebufferDeviceGetOffset(Framebuffer:PFramebufferDevice; var X,Y:LongWord):LongWord;
Description: Get the virtual offset X and Y from a framebuffer device


[Expand]
function FramebufferDeviceSetOffset(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan:Boolean):LongWord;
Description: Set the virtual offset X and Y of a framebuffer device


[Expand]
function FramebufferDeviceGetPalette(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;
Description: Get the 8 bit color palette from a framebuffer device


[Expand]
function FramebufferDeviceSetPalette(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;
Description: Set the 8 bit color palette of a framebuffer device


[Expand]
function FramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: Set the brightness of the backlight of a framebuffer device


[Expand]
function FramebufferDeviceGetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Get the current properties from a framebuffer device


[Expand]
function FramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Set the current properties for a framebuffer device


[Expand]
function FramebufferDeviceCheckFlag(Framebuffer:PFramebufferDevice; Flag:LongWord):Boolean;
Description: To be documented


[Expand]
function FramebufferDeviceGetFormat(Framebuffer:PFramebufferDevice):LongWord;
Description: To be documented


[Expand]
function FramebufferDeviceCreate:PFramebufferDevice;
Description: Create a new Framebuffer entry


[Expand]
function FramebufferDeviceCreateEx(Size:LongWord):PFramebufferDevice;
Description: Create a new Framebuffer entry


[Expand]
function FramebufferDeviceDestroy(Framebuffer:PFramebufferDevice):LongWord;
Description: Destroy an existing Framebuffer entry


[Expand]
function FramebufferDeviceRegister(Framebuffer:PFramebufferDevice):LongWord;
Description: Register a new Framebuffer in the Framebuffer table


[Expand]
function FramebufferDeviceDeregister(Framebuffer:PFramebufferDevice):LongWord;
Description: Deregister a Framebuffer from the Framebuffer table


[Expand]
function FramebufferDeviceFind(FramebufferId:LongWord):PFramebufferDevice;
Description: To be documented


[Expand]
function FramebufferDeviceFindByName(const Name:String):PFramebufferDevice; inline;
Description: To be documented


[Expand]
function FramebufferDeviceFindByDescription(const Description:String):PFramebufferDevice; inline;
Description: To be documented


[Expand]
function FramebufferDeviceEnumerate(Callback:TFramebufferEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function FramebufferDeviceNotification(Framebuffer:PFramebufferDevice; Callback:TFramebufferNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


RTL framebuffer functions

[Expand]
function SysFramebufferAvailable:Boolean;
Description: Check if a framebuffer device is available


Framebuffer helper functions

[Expand]
function FramebufferDeviceGetCount:LongWord; inline;
Description: Get the current framebuffer device count


[Expand]
function FramebufferDeviceGetDefault:PFramebufferDevice; inline;
Description: Get the current default framebuffer device


[Expand]
function FramebufferDeviceSetDefault(Framebuffer:PFramebufferDevice):LongWord;
Description: Set the current default framebuffer device


[Expand]
function FramebufferDeviceCheck(Framebuffer:PFramebufferDevice):PFramebufferDevice;
Description: Check if the supplied Framebuffer device is in the Framebuffer table


[Expand]
function FramebufferDeviceSwap(Value:LongWord):LongWord; inline;
Description: No longer required (See ColorDefaultToFormat and ColorFormatToDefault)


[Expand]
function FramebufferDepthToString(Depth:LongWord):String;
Description: To be documented


[Expand]
function FramebufferOrderToString(Order:LongWord):String;
Description: To be documented


[Expand]
function FramebufferModeToString(Mode:LongWord):String;
Description: To be documented


[Expand]
function FramebufferRotationToString(Rotation:LongWord):String;
Description: To be documented


Return to Unit Reference