Unit Framebuffer
From Ultibo.org
Return to Unit Reference
Description
To be documented
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure FramebufferInit;
Description: To be documented
Note | None documented |
---|
Framebuffer functions
function FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate and enable a framebuffer device using supplied properties or defaults
Framebuffer | The framebuffer device to allocate |
---|---|
Properties | The framebuffer properties (Width/Height/Depth etc) to use for allocation (Optional) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: Disable and release a framebuffer device
Framebuffer | The framebuffer device to release |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Blank (Turn off) the display of a framebuffer device
Framebuffer | The framebuffer device to blank |
---|---|
Blank | Turn off the display if True / Turn on the display if False |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Not all framebuffer devices support blank, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support blank should set the flag FRAMEBUFFER_FLAG_BLANK. |
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
Framebuffer | The framebuffer device to read from |
---|---|
X | The column to start reading from |
Y | The row to start reading from |
Buffer | Pointer to a buffer to receive the read pixels |
Len | The number of pixels to read starting at X,Y |
Flags | The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read. |
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
Framebuffer | The framebuffer device to write to |
---|---|
X | The column to start writing from |
Y | The row to start writing from |
Buffer | Pointer to a buffer containing the pixels to write |
Len | The number of pixels to write starting at X,Y |
Flags | The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write. |
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
Framebuffer | The framebuffer device to mark |
---|---|
X | The starting column of the mark |
Y | The starting row of the mark |
Width | The number of columns to mark |
Height | The number of rows to mark |
Flags | The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Not all framebuffer devices support mark, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support and require mark should set the flag FRAMEBUFFER_FLAG_MARK. |
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
Framebuffer | The framebuffer device to commit |
---|---|
Address | The starting address of the commit |
Size | The size in bytes of the commit |
Flags | The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Not all framebuffer devices support commit, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support and require commit should set the flag FRAMEBUFFER_FLAG_COMMIT. |
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
Framebuffer | The framebuffer device to get from |
---|---|
X | The starting column of the get |
Y | The starting row of the get |
Buffer | Pointer to a block of memory large enough to hold the pixels in a contiguous block of rows |
Width | The number of columns to get |
Height | The number of rows to get |
Skip | The number of pixels to skip in the buffer after each row (Optional) |
Flags | The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read. |
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
Framebuffer | The framebuffer device to put to |
---|---|
X | The starting column of the put |
Y | The starting row of the put |
Buffer | Pointer to a block of memory containing the pixels in a contiguous block of rows |
Width | The number of columns to put |
Height | The number of rows to put |
Skip | The number of pixels to skip in the buffer after each row (Optional) |
Flags | The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write. |
function FramebufferDeviceCopyRect(Framebuffer:PFramebufferDevice; X1,Y1,X2,Y2,Width,Height,Flags:LongWord):LongWord;
Description: Copy a rectangular area of pixels within framebuffer memory
Frambuffer | The framebuffer device to copy on |
---|---|
X1 | The starting column to copy from |
Y1 | The starting row to copy from |
X2 | The starting column to copy to |
Y2 | The starting row to copy to |
Width | The number of columns to copy |
Height | The number of rows to copy |
Flags | The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The default method assumes that framebuffer memory is DMA coherent and does not require cache clean/invalidate before or after a DMA read/write. |
function FramebufferDeviceFillRect(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Color,Flags:LongWord):LongWord;
Description: Fill a rectangular area of pixels within framebuffer memory
Frambuffer | The framebuffer device to fill on |
---|---|
X | The starting column of the fill |
Y | The starting row of the fill |
Width | The number of columns to fill |
Height | The number of rows to fill |
Color | The color to use for the fill |
Flags | The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the correct format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write. |
function FramebufferDeviceGetLine(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;
Description: Get the address of the start of a row in framebuffer memory
Framebuffer | The framebuffer device to get the start address from |
---|---|
Y | The row to get the start address of |
Return | Pointer to the start address of the row or nil on failure |
function FramebufferDeviceGetPoint(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;
Description: Get the address of the specified row and column in framebuffer memory
Framebuffer | The framebuffer device to get the address from |
---|---|
X | The column to get the start address of |
Y | The row to get the start address of |
Return | Pointer to the address of the row and column or nil on failure |
function FramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: Set the brightness of the backlight of a framebuffer device
Framebuffer | The framebuffer device to set the backlight |
---|---|
Brightness | The brightness value to set (Normally 0 to 100) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Not all framebuffer devices support set backlight, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support set backlight should set the flag FRAMEBUFFER_FLAG_BACKLIGHT. |
function FramebufferDeviceGetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Get the current properties from a framebuffer device
Framebuffer | The framebuffer device to get properties from |
---|---|
Properties | Pointer to a TFramebufferProperties structure to return |
Return | ERROR_SUCCESS if completed or another error code on failure |
function FramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Set the current properties for a framebuffer device
Framebuffer | The framebuffer device to set properties for |
---|---|
Properties | Pointer to a TFramebufferProperties structure containing the properties |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Changing certain properties may cause the framebuffer to be reallocated |
function FramebufferDeviceCheckFlag(Framebuffer:PFramebufferDevice; Flag:LongWord):Boolean;
Description: To be documented
Note | None documented |
---|
function FramebufferDeviceGetFormat(Framebuffer:PFramebufferDevice):LongWord;
Description: To be documented
Note | None documented |
---|
function FramebufferDeviceCreate:PFramebufferDevice;
Description: Create a new Framebuffer entry
Return | Pointer to new Framebuffer entry or nil if Framebuffer could not be created |
---|
function FramebufferDeviceCreateEx(Size:LongWord):PFramebufferDevice;
Description: Create a new Framebuffer entry
Size | Size in bytes to allocate for new Framebuffer (Including the Framebuffer entry) |
---|---|
Return | Pointer to new Framebuffer entry or nil if Framebuffer could not be created |
function FramebufferDeviceDestroy(Framebuffer:PFramebufferDevice):LongWord;
Description: Destroy an existing Framebuffer entry
Note | None documented |
---|
function FramebufferDeviceRegister(Framebuffer:PFramebufferDevice):LongWord;
Description: Register a new Framebuffer in the Framebuffer table
Note | None documented |
---|
function FramebufferDeviceDeregister(Framebuffer:PFramebufferDevice):LongWord;
Description: Deregister a Framebuffer from the Framebuffer table
Note | None documented |
---|
function FramebufferDeviceFind(FramebufferId:LongWord):PFramebufferDevice;
Description: To be documented
Note | None documented |
---|
function FramebufferDeviceFindByName(const Name:String):PFramebufferDevice; inline;
Description: To be documented
Note | None documented |
---|
function FramebufferDeviceFindByDescription(const Description:String):PFramebufferDevice; inline;
Description: To be documented
Note | None documented |
---|
function FramebufferDeviceEnumerate(Callback:TFramebufferEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note | None documented |
---|
function FramebufferDeviceNotification(Framebuffer:PFramebufferDevice; Callback:TFramebufferNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
RTL framebuffer functions
function SysFramebufferAvailable:Boolean;
Description: Check if a framebuffer device is available
Note | None documented |
---|
Framebuffer helper functions
function FramebufferDeviceGetCount:LongWord; inline;
Description: Get the current framebuffer device count
Note | None documented |
---|
function FramebufferDeviceGetDefault:PFramebufferDevice; inline;
Description: Get the current default framebuffer device
Note | None documented |
---|
function FramebufferDeviceSetDefault(Framebuffer:PFramebufferDevice):LongWord;
Description: Set the current default framebuffer device
Note | None documented |
---|
function FramebufferDeviceCheck(Framebuffer:PFramebufferDevice):PFramebufferDevice;
Description: Check if the supplied Framebuffer device is in the Framebuffer table
Note | None documented |
---|
function FramebufferDeviceSwap(Value:LongWord):LongWord; inline;
Description: No longer required (See ColorDefaultToFormat and ColorFormatToDefault)
Note | None documented |
---|
function FramebufferDepthToString(Depth:LongWord):String;
Description: To be documented
Note | None documented |
---|
function FramebufferOrderToString(Order:LongWord):String;
Description: To be documented
Note | None documented |
---|
function FramebufferModeToString(Mode:LongWord):String;
Description: To be documented
Note | None documented |
---|
function FramebufferRotationToString(Rotation:LongWord):String;
Description: To be documented
Note | None documented |
---|
Return to Unit Reference