Table of Contents Glide Programming Guide


Writing a Rectangle of Pixels into the LFB



Download 6.22 Mb.
Page88/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   84   85   86   87   88   89   90   91   ...   106
GLIDEPGM

9Writing a Rectangle of Pixels into the LFB


The grLfbWriteRegion() convenience function copies a rectangle of pixels from a region of memory into the linear frame buffer as efficiently as possible. It performs the buffer locks and unlocks as needed.
FxBool grLfbWriteRegion( GrBuffer_t buffer, FxU32 xStart, FxU32 yStart,
GrLfbSrcFmt_t srcFormat, FxU32 width, FxU32 height, FxI32 strideInBytes,
void *data
)
The first argument, buffer, specifies the buffer that the data will be copied into; the choices are GR_BUFFER_FRONTBUFFER, GR_BUFFER_BACKBUFFER, and GR_BUFFER_AUXBUFFER. The next two parameters, xStart and yStart, specify the starting coordinates in the buffer where the data will be written. The y origin is assumed to be in the upper left corner of the screen.
The srcFormat argument describes the format of the data; valid values are shown in Table Accessing the Linear Frame Buffer.5. The width and height parameters give the dimensions, in pixels, of the rectangular region to be written to the LFB and strideInBytes specifies how many bytes are in one row of the array. The final argument, data, points to the pixel data in memory.
Note that strideInBytes can be a negative number. If data points to the pixel closest to the origin, and strideInBytes is the length of a row in the array, then the sign of strideInBytes represents the location of the origin in the image pointed to by data. A negative strideInBytes is used if data points to the lower left corner, as shown in Figure Accessing the Linear Frame Buffer.2.

  1. Table Accessing the Linear Frame Buffer.5 Source data formats for the grLfbWriteRegion() routine.



source data format

description

GR_LFB_SRC_FMT_565

RGB 565 color image

GR_LFB_SRC_FMT_555

RGB 555 color image

GR_LFB_SRC_FMT_1555

RGB 1555 color image

GR_LFB_SRC_FMT_888

RGB 888 color image. Each pixel is padded to 32 bits with RGB in the low order 24 bits.

GR_LFB_SRC_FMT_8888

ARGB 8888 color image

GR_LFB_SRC_FMT_565_DEPTH

RGB 565 and 16-bit depth value packed into each 32-bit element of image

GR_LFB_SRC_FMT_555_DEPTH

RGB 555 and 16-bit depth value packed into each 32-bit element of image

GR_LFB_SRC_FMT_1555_DEPTH

RGB 1555 and 16-bit depth value packed into each 32-bit element of image

GR_LFB_SRC_FMT_ZA16

Two 16-bit depth or alpha values. Alpha values are stored into odd bytes.

GR_LFB_SRC_FMT_RLE16

A 16-bit RLE Encoded image: each pixel has a16-bit signed count and a 16-bit color. Negative counts are currently ignored.



Download 6.22 Mb.

Share with your friends:
1   ...   84   85   86   87   88   89   90   91   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page