Skip to main content

LCD32bpp_XRGB8888

This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles on 16 bits per pixel displays.

See: LCD

Note: All coordinates are expected to be in absolute coordinates!

Inherits from: LCD

Public Functions

virtual uint8_tbitDepth() const
Number of bits per pixel used by the display.
virtual voidblitCopy(const uint16_t * sourceData, const Rect & source, const Rect & blitRect, uint8_t alpha, bool hasTransparentPixels)
Blits (directly copies) a block of data to the framebuffer, performing alpha blending (and tranparency keying) as specified.
virtual voidblitCopy(const uint8_t * sourceData, Bitmap::BitmapFormat sourceFormat, const Rect & source, const Rect & blitRect, uint8_t alpha, bool hasTransparentPixels)
Blits (directly copies) a block of data to the framebuffer, performing alpha blending (and tranparency keying) as specified.
virtual uint16_t *copyFrameBufferRegionToMemory(const Rect & visRegion, const Rect & absRegion, const BitmapId bitmapId)
Copies part of the framebuffer to the data section of a bitmap.
virtual voiddrawPartialBitmap(const Bitmap & bitmap, int16_t x, int16_t y, const Rect & rect, uint8_t alpha =255, bool useOptimized =true)
Draws all (or a part) of a bitmap.
voidenableTextureMapperA4()
Enables the texture mappers for A4 image format.
voidenableTextureMapperA4_BilinearInterpolation()
Enables the texture mappers for A4 image format.
voidenableTextureMapperA4_NearestNeighbor()
Enables the texture mappers for A4 image format.
voidenableTextureMapperAll()
Enables the texture mappers for all image formats.
voidenableTextureMapperARGB8888()
Enables the texture mappers for ARGB8888 image format.
voidenableTextureMapperARGB8888_BilinearInterpolation()
Enables the texture mappers for ARGB8888 image format.
voidenableTextureMapperARGB8888_NearestNeighbor()
Enables the texture mappers for ARGB8888 image format.
voidenableTextureMapperL8_ARGB8888()
Enables the texture mappers for L8_ARGB8888 image format.
voidenableTextureMapperL8_ARGB8888_BilinearInterpolation()
Enables the texture mappers for L8_ARGB8888 image format.
voidenableTextureMapperL8_ARGB8888_NearestNeighbor()
Enables the texture mappers for L8_ARGB8888 image format.
voidenableTextureMapperL8_RGB565()
Enables the texture mappers for L8_RGB565 image format.
voidenableTextureMapperL8_RGB565_BilinearInterpolation()
Enables the texture mappers for L8_RGB565 image format.
voidenableTextureMapperL8_RGB565_NearestNeighbor()
Enables the texture mappers for L8_RGB565 image format.
voidenableTextureMapperL8_RGB888()
Enables the texture mappers for L8_RGB888 image format.
voidenableTextureMapperL8_RGB888_BilinearInterpolation()
Enables the texture mappers for L8_RGB888 image format.
voidenableTextureMapperL8_RGB888_NearestNeighbor()
Enables the texture mappers for L8_RGB888 image format.
voidenableTextureMapperRGB565()
Enables the texture mappers for RGB565 image format.
voidenableTextureMapperRGB565_NonOpaque_BilinearInterpolation()
Enables the texture mappers for NonOpaque RGB565 image format.
voidenableTextureMapperRGB565_NonOpaque_NearestNeighbor()
Enables the texture mappers for NonOpaque RGB565 image format.
voidenableTextureMapperRGB565_Opaque_BilinearInterpolation()
Enables the texture mappers for Opaque RGB565 image format.
voidenableTextureMapperRGB565_Opaque_NearestNeighbor()
Enables the texture mappers for Opaque RGB565 image format.
voidenableTextureMapperRGB888()
Enables the texture mappers for RGB888 image format.
voidenableTextureMapperRGB888_BilinearInterpolation()
Enables the texture mappers for RGB888 image format.
voidenableTextureMapperRGB888_NearestNeighbor()
Enables the texture mappers for RGB888 image format.
virtual voidfillBuffer(uint8_t *const destination, uint16_t pixelStride, const Rect & rect, const colortype color, const uint8_t alpha)
Draws a filled rectangle in destination memory using the specified color and opacity.
virtual voidfillRect(const Rect & rect, colortype color, uint8_t alpha =255)
Draws a filled rectangle in the framebuffer in the specified color and opacity.
virtual Bitmap::BitmapFormatframebufferFormat() const
Framebuffer format used by the display.
virtual uint16_tframebufferStride() const
Framebuffer stride in bytes.
LCD32bpp_XRGB8888()
virtual boolsupportDynamicBitmapDrawing(const Bitmap::BitmapFormat format)
Check if LCD support dynamic bitmap drawing.
FORCE_INLINE_FUNCTION uint32_tblendRgb565withXrgb8888(const uint16_t fgRGB565, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha)
Alpha blend a 16bit RGB565 color with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for fgRGB565) and bgAlpha (for bgXRGB8888).
FORCE_INLINE_FUNCTION uint32_tblendRgb888withXrgb8888(const uint8_t *const fgRGB888, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha)
Alpha blend a 24bit RGB888 with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for fgRGB888) and bgAlpha (for bgXRGB8888).
FORCE_INLINE_FUNCTION uint32_tblendRGBwithXrgb8888(const uint8_t fgR, const uint8_t fgG, const uint8_t fgB, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha)
Alpha blend R,G,B with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for R, G,B) and bgAlpha (for bgXRGB8888).
FORCE_INLINE_FUNCTION uint32_tblendXrgb888withXrgb8888(const uint32_t fgXRGB8888, const uint32_t bgXRGB8888, const uint8_t fgAlpha, const uint8_t bgAlpha)
Alpha blend two 32bit colors using the provided fgAlpha (for fgXRGB8888) and bgAlpha (for bgXRGB8888).
FORCE_INLINE_FUNCTION uint8_tgetBlueFromColor(colortype color)
Gets blue from color.
FORCE_INLINE_FUNCTION uint16_tgetFramebufferStride()
Framebuffer stride in bytes.
FORCE_INLINE_FUNCTION uint32_trgb888toXrgb8888(const uint8_t *const rgb888)
Copies the 24bit color (blue, green, red) to the given 32bit destination, setting alpha to zero.

Protected Functions

virtual voiddrawGlyph(uint16_t wbuf16, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect & invalidatedArea, const GlyphNode glyph, const uint8_t * glyphData, uint8_t byteAlignRow, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation)
Private version of draw-glyph with explicit destination buffer pointer argument.
virtual DrawTextureMapScanLineBase *getTextureMapperDrawScanLine(const TextureSurface & texture, RenderingVariant renderVariant, uint8_t alpha)
Gets pointer to object that can draw a scan line which allows for highly specialized and optimized implementation.
voidblitCopyL8(const uint8_t sourceData, const uint8_t clutData, const Rect & source, const Rect & blitRect, uint8_t alpha)
Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if indexed format is not supported by the DMA a software blend is performed.
voidblitCopyL8_ARGB8888(const uint8_t sourceData, const uint8_t clutData, const Rect & source, const Rect & blitRect, uint8_t alpha)
Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is performed.
voidblitCopyL8_RGB565(const uint8_t sourceData, const uint8_t clutData, const Rect & source, const Rect & blitRect, uint8_t alpha)
Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if L8_RGB565 is not supported by the DMA a software blend is performed.
voidblitCopyL8_RGB888(const uint8_t sourceData, const uint8_t clutData, const Rect & source, const Rect & blitRect, uint8_t alpha)
Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if L8_RGB888 is not supported by the DMA a software blend is performed.
voidblitCopyRGB565(const uint16_t * sourceData16, const Rect & source, const Rect & blitRect, uint8_t alpha)
Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified.
voidblitCopyRGB888(const uint16_t * sourceData16, const Rect & source, const Rect & blitRect, uint8_t alpha)
Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified.
intnextLine(bool rotatedDisplay, TextRotation textRotation)
Find out how much to advance in the display buffer to get to the next line.
intnextPixel(bool rotatedDisplay, TextRotation textRotation)
Find out how much to advance in the display buffer to get to the next pixel.

Additional inherited members

Public Classes inherited from LCD

structStringVisuals
The visual elements when writing a string.

Protected Classes inherited from LCD

classDrawTextureMapScanLineBase
Base class for drawing scanline by the texture mapper.

Public Functions inherited from LCD

voiddrawString(Rect widgetArea, const Rect & invalidatedArea, const StringVisuals & stringVisuals, const Unicode::UnicodeChar * format, ... )
Draws the specified Unicode string.
virtual voiddrawTextureMapQuad(const DrawingSurface & dest, const Point3D * vertices, const TextureSurface & texture, const Rect & absoluteRect, const Rect & dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha =255, uint16_t subDivisionSize =12)
Texture map quad.
virtual voiddrawTextureMapTriangle(const DrawingSurface & dest, const Point3D * vertices, const TextureSurface & texture, const Rect & absoluteRect, const Rect & dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha =255, uint16_t subDivisionSize =12)
Texture map triangle.
colortypegetDefaultColor() const
Gets default color previously set using setDefaultColor.
LCD()
Initializes a new instance of the LCD class.
virtual voidsetDefaultColor(colortype color)
Sets default color as used by alpha level only bitmap formats, e.g.
virtual ~LCD()
Finalizes an instance of the LCD class.
FORCE_INLINE_FUNCTION uint8_tdiv255(uint16_t num)
Approximates an integer division of a 16bit value by 255.
FORCE_INLINE_FUNCTION uint32_tdiv255g(uint32_t pixelxAlpha)
Divides the green component of pixelxAlpha by 255.
FORCE_INLINE_FUNCTION uint32_tdiv255rb(uint32_t pixelxAlpha)
Divides the red and blue components of pixelxAlpha by 255.

Protected Functions inherited from LCD

voiddrawStringLTR(const Rect & widgetArea, const Rect & invalidatedArea, const StringVisuals & visuals, const Unicode::UnicodeChar * format, va_list pArg)
Draws the specified Unicode string.
voiddrawStringRTL(const Rect & widgetArea, const Rect & invalidatedArea, const StringVisuals & visuals, const Unicode::UnicodeChar * format, va_list pArg)
Draws the specified Unicode string.
virtual voiddrawTextureMapScanLine(const DrawingSurface & dest, const Gradients & gradients, const Edge leftEdge, const Edge rightEdge, const TextureSurface & texture, const Rect & absoluteRect, const Rect & dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize)
Draw scan line.
FORCE_INLINE_FUNCTION uint8_tgetAlphaFromA4(const uint16_t * data, uint32_t offset)
Gets alpha from A4 image at given offset.
uint16_tgetNumLines(TextProvider & textProvider, WideTextAction wideTextAction, TextDirection textDirection, const Font * font, int16_t width)
Gets number of lines for a given text taking word wrap into consideration.
intrealX(const Rect & widgetArea, int16_t x, int16_t y, TextRotation rotation)
Find the real, absolute x coordinate of a point inside a widget with regards to rotation.
intrealY(const Rect & widgetArea, int16_t x, int16_t y, TextRotation rotation)
Find the real, absolute y coordinate of a point inside a widget with regards to rotation.
voidrotateRect(Rect & rect, const Rect & canvas, const TextRotation rotation)
Rotate a rectangle inside another rectangle.
uint16_tstringWidth(TextProvider & textProvider, const Font & font, const int numChars, TextDirection textDirection)
Find string width of the given number of ligatures read from the given TextProvider.

Protected Attributes inherited from LCD

colortypedefaultColor
Default Color to use when displaying transparency-only elements, e.g. A4 bitmaps.
const uint16_tnewLine
NewLine value.

Public Functions Documentation

bitDepth

virtual uint8_t bitDepth()const

Number of bits per pixel used by the display.

Returns:

The number of bits per pixel.

Reimplements: touchgfx::LCD::bitDepth

blitCopy

virtual void blitCopy(const uint16_t *sourceData ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha ,
boolhasTransparentPixels
)

Blits (directly copies) a block of data to the framebuffer, performing alpha blending (and tranparency keying) as specified.

Performs a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255 (solid).

Parameters:
sourceDataThe source array pointer (points to the beginning of the data). The sourceData must be stored in a format suitable for the selected display.
sourceThe position and dimensions of the source. The x and y of this rect should both be 0.
blitRectA rectangle describing what region of the sourceData is to be copied to the framebuffer.
alphaThe alpha value to use for blending ranging from 0=invisible to 255=solid=no blending.
hasTransparentPixelsIf true, this data copy contains transparent pixels and require hardware support for that to be enabled.

Reimplements: touchgfx::LCD::blitCopy

blitCopy

virtual void blitCopy(const uint8_t *sourceData ,
Bitmap::BitmapFormatsourceFormat ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha ,
boolhasTransparentPixels
)

Blits (directly copies) a block of data to the framebuffer, performing alpha blending (and tranparency keying) as specified.

Performs a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha < 255 (solid).

If the display does not support the specified sourceFormat, an assert will be raised.

Parameters:
sourceDataThe source array pointer (points to the beginning of the data). The sourceData must be stored in a format suitable for the selected display.
sourceFormatThe bitmap format used in the source data.
sourceThe position and dimensions of the source. The x and y of this rect should both be 0.
blitRectA rectangle describing what region of the sourceData is to be copied to the framebuffer.
alphaThe alpha value to use for blending ranging from 0=invisible to 255=solid=no blending.
hasTransparentPixelsIf true, this data copy contains transparent pixels and require hardware support for that to be enabled.

Reimplements: touchgfx::LCD::blitCopy

copyFrameBufferRegionToMemory

virtual uint16_t * copyFrameBufferRegionToMemory(const Rect &visRegion ,
const Rect &absRegion ,
const BitmapIdbitmapId
)

Copies part of the framebuffer to the data section of a bitmap.

The bitmap must be a dynamic bitmap or animation storage (BITMAP_ANIMATION_STORAGE). The two regions given are the visible region and the absolute region on screen. This is used to copy only a part of the framebuffer. This might be the case if a SnapshotWidget is placed inside a Container where parts of the SnapshowWidget is outside the area defined by the Container. The visible region must be completely inside the absolute region.

Parameters:
visRegionThe visible region.
absRegionThe absolute region.
bitmapIdIdentifier for the bitmap.
Returns:

Null if it fails, else a pointer to the data in the given bitmap.

Note

There is only one instance of animation storage. The content of the bitmap data /animation storage outside the given region is left untouched.

See also:

Reimplements: touchgfx::LCD::copyFrameBufferRegionToMemory

drawPartialBitmap

virtual void drawPartialBitmap(const Bitmap &bitmap ,
int16_tx ,
int16_ty ,
const Rect &rect ,
uint8_talpha =255,
booluseOptimized =true
)

Draws all (or a part) of a bitmap.

The coordinates of the corner of the bitmap is given in (x, y) and rect describes which part of the bitmap should be drawn. The bitmap can be drawn as it is or more or less transparent depending on the value of alpha. The value of alpha is independent of the transparency of the individual pixels of the given bitmap.

Parameters:
bitmapThe bitmap to draw.
xThe absolute x coordinate to place (0, 0) of the bitmap on the screen.
yThe absolute y coordinate to place (0, 0) of the bitmap on the screen.
rectA rectangle describing what region of the bitmap is to be drawn.
alpha(Optional) Optional alpha value ranging from 0=invisible to 255=solid. Default is 255 (solid).
useOptimized(Optional) if false, do not attempt to substitute (parts of) this bitmap with faster fillrects.

Reimplements: touchgfx::LCD::drawPartialBitmap

enableTextureMapperA4

Enables the texture mappers for A4 image format.

This allows drawing A4 images using Bilinear Interpolation and Nearest Neighbor algorithms.

See also:

enableTextureMapperA4_BilinearInterpolation

Enables the texture mappers for A4 image format.

This allows drawing A4 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperA4_NearestNeighbor

Enables the texture mappers for A4 image format.

This allows drawing A4 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperAll

Enables the texture mappers for all image formats.

This allows drawing any image using Bilinear Interpolation and Nearest Neighbor algorithms, but might use a lot of memory for the drawing algorithms.

enableTextureMapperARGB8888

Enables the texture mappers for ARGB8888 image format.

This allows drawing ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms.

See also:

enableTextureMapperARGB8888_BilinearInterpolation

Enables the texture mappers for ARGB8888 image format.

This allows drawing ARGB8888 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperARGB8888_NearestNeighbor

Enables the texture mappers for ARGB8888 image format.

This allows drawing ARGB8888 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperL8_ARGB8888

Enables the texture mappers for L8_ARGB8888 image format.

This allows drawing L8_ARGB8888 images using Bilinear Interpolation and Nearest Neighbor algorithms.

See also:

enableTextureMapperL8_ARGB8888_BilinearInterpolation

Enables the texture mappers for L8_ARGB8888 image format.

This allows drawing L8_ARGB8888 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperL8_ARGB8888_NearestNeighbor

Enables the texture mappers for L8_ARGB8888 image format.

This allows drawing L8_ARGB8888 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperL8_RGB565

Enables the texture mappers for L8_RGB565 image format.

This allows drawing L8_RGB565 images using Bilinear Interpolation and Nearest Neighbor algorithms.

See also:

enableTextureMapperL8_RGB565_BilinearInterpolation

Enables the texture mappers for L8_RGB565 image format.

This allows drawing L8_RGB565 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperL8_RGB565_NearestNeighbor

Enables the texture mappers for L8_RGB565 image format.

This allows drawing L8_RGB565 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperL8_RGB888

Enables the texture mappers for L8_RGB888 image format.

This allows drawing L8_RGB888 images using Bilinear Interpolation and Nearest Neighbor algorithms.

See also:

enableTextureMapperL8_RGB888_BilinearInterpolation

Enables the texture mappers for L8_RGB888 image format.

This allows drawing L8_RGB888 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperL8_RGB888_NearestNeighbor

Enables the texture mappers for L8_RGB888 image format.

This allows drawing L8_RGB888 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperRGB565

Enables the texture mappers for RGB565 image format.

This allows drawing RGB565 images using Bilinear Interpolation and Nearest Neighbor algorithms.

enableTextureMapperRGB565_NonOpaque_BilinearInterpolation

Enables the texture mappers for NonOpaque RGB565 image format.

This allows drawing RGB565 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperRGB565_NonOpaque_NearestNeighbor

Enables the texture mappers for NonOpaque RGB565 image format.

This allows drawing RGB565 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperRGB565_Opaque_BilinearInterpolation

Enables the texture mappers for Opaque RGB565 image format.

This allows drawing RGB565 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperRGB565_Opaque_NearestNeighbor

Enables the texture mappers for Opaque RGB565 image format.

This allows drawing RGB565 images using Nearest Neighbor algorithm.

See also:

enableTextureMapperRGB888

Enables the texture mappers for RGB888 image format.

This allows drawing RGB888 images using Bilinear Interpolation and Nearest Neighbor algorithms.

See also:

enableTextureMapperRGB888_BilinearInterpolation

Enables the texture mappers for RGB888 image format.

This allows drawing RGB888 images using Bilinear Interpolation algorithm.

See also:

enableTextureMapperRGB888_NearestNeighbor

Enables the texture mappers for RGB888 image format.

This allows drawing RGB888 images using Nearest Neighbor algorithm.

See also:

fillBuffer

virtual void fillBuffer(uint8_t *constdestination ,
uint16_tpixelStride ,
const Rect &rect ,
const colortypecolor ,
const uint8_talpha
)

Draws a filled rectangle in destination memory using the specified color and opacity.

The destination memory must have the same format as the display framebuffer. By default the rectangle will be drawn as a solid box. The rectangle can be drawn with transparency by specifying alpha from 0=invisible to 255=solid.

Parameters:
destinationThe start of the memory area to fill.
pixelStrideThe pixel stride, i.e. number of pixels in a row.
rectThe rectangle to fill absolute coordinates.
colorThe rectangle color.
alphaThe rectangle opacity, from 0=invisible to 255=solid.
Note

The pixelStride is rounded up to nearest whole bytes for displays with more than one pixel per byte (LCD1bpp, LCD2bpp and LCD4bpp)

Reimplements: touchgfx::LCD::fillBuffer

fillRect

virtual void fillRect(const Rect &rect ,
colortypecolor ,
uint8_talpha =255
)

Draws a filled rectangle in the framebuffer in the specified color and opacity.

By default the rectangle will be drawn as a solid box. The rectangle can be drawn with transparency by specifying alpha from 0=invisible to 255=solid.

Parameters:
rectThe rectangle to draw in absolute display coordinates.
colorThe rectangle color.
alpha(Optional) The rectangle opacity, from 0=invisible to 255=solid.
See also:

Reimplements: touchgfx::LCD::fillRect

framebufferFormat

virtual Bitmap::BitmapFormat framebufferFormat()const

Framebuffer format used by the display.

Returns:

Reimplements: touchgfx::LCD::framebufferFormat

framebufferStride

virtual uint16_t framebufferStride()const

Framebuffer stride in bytes.

The distance (in bytes) from the start of one framebuffer row, to the next.

Returns:

The number of bytes in one framebuffer row.

Reimplements: touchgfx::LCD::framebufferStride

LCD32bpp_XRGB8888

supportDynamicBitmapDrawing

Check if LCD support dynamic bitmap drawing.

Parameters:
formatThe dynamic bitmap format.
Returns:

true if dynamic bitmap drawing is supported, false otherwise.

Reimplements: touchgfx::LCD::supportDynamicBitmapDrawing

blendRgb565withXrgb8888

static FORCE_INLINE_FUNCTION uint32_t blendRgb565withXrgb8888(const uint16_tfgRGB565 ,
const uint32_tbgXRGB8888 ,
const uint8_tfgAlpha ,
const uint8_tbgAlpha
)

Alpha blend a 16bit RGB565 color with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for fgRGB565) and bgAlpha (for bgXRGB8888).

The resulting color is returned. address.

Parameters:
fgRGB565A pointer to the foreground 24bit RGB.
bgXRGB8888The background 32bit color.
fgAlphaThe foreground alpha.
bgAlphaThe background alpha.
Returns:

The blended value.

blendRgb888withXrgb8888

static FORCE_INLINE_FUNCTION uint32_t blendRgb888withXrgb8888(const uint8_t *constfgRGB888 ,
const uint32_tbgXRGB8888 ,
const uint8_tfgAlpha ,
const uint8_tbgAlpha
)

Alpha blend a 24bit RGB888 with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for fgRGB888) and bgAlpha (for bgXRGB8888).

The resulting color is returned. address.

Parameters:
fgRGB888A pointer to the foreground 24bit RGB.
bgXRGB8888The background 32bit color.
fgAlphaThe foreground alpha.
bgAlphaThe background alpha.
Returns:

The blended value.

blendRGBwithXrgb8888

static FORCE_INLINE_FUNCTION uint32_t blendRGBwithXrgb8888(const uint8_tfgR ,
const uint8_tfgG ,
const uint8_tfgB ,
const uint32_tbgXRGB8888 ,
const uint8_tfgAlpha ,
const uint8_tbgAlpha
)

Alpha blend R,G,B with the 32bit color given in bgXRGB8888 using the provided fgAlpha (for R, G,B) and bgAlpha (for bgXRGB8888).

The resulting color is returned. address.

Parameters:
fgRThe foreground blue.
fgGThe foreground green.
fgBThe foreground blue.
bgXRGB8888The background 32bit color.
fgAlphaThe foreground alpha.
bgAlphaThe background alpha.
Returns:

The blended value.

blendXrgb888withXrgb8888

static FORCE_INLINE_FUNCTION uint32_t blendXrgb888withXrgb8888(const uint32_tfgXRGB8888 ,
const uint32_tbgXRGB8888 ,
const uint8_tfgAlpha ,
const uint8_tbgAlpha
)

Alpha blend two 32bit colors using the provided fgAlpha (for fgXRGB8888) and bgAlpha (for bgXRGB8888).

The resulting color is returned.

Parameters:
fgXRGB8888The foreground 32bit color.
bgXRGB8888The background 32bit color.
fgAlphaThe foreground alpha.
bgAlphaThe background alpha.
Returns:

The blended value.

getBlueFromColor

static FORCE_INLINE_FUNCTION uint8_t getBlueFromColor(colortypecolor)

Gets blue from color.

Parameters:
colorThe color.
Returns:

The blue from color.

getFramebufferStride

static FORCE_INLINE_FUNCTION uint16_t getFramebufferStride()

Framebuffer stride in bytes.

The distance (in bytes) from the start of one framebuffer row, to the next.

Returns:

The number of bytes in one framebuffer row.

rgb888toXrgb8888

static FORCE_INLINE_FUNCTION uint32_t rgb888toXrgb8888(const uint8_t *constrgb888)

Copies the 24bit color (blue, green, red) to the given 32bit destination, setting alpha to zero.

Parameters:
rgb888A pointer to the three bytes.
Returns:

The 24bit RGB888 converted to a 32bit color value with zero alpha.

Protected Functions Documentation

drawGlyph

virtual void drawGlyph(uint16_t *wbuf16 ,
RectwidgetArea ,
int16_tx ,
int16_ty ,
uint16_toffsetX ,
uint16_toffsetY ,
const Rect &invalidatedArea ,
const GlyphNode *glyph ,
const uint8_t *glyphData ,
uint8_tbyteAlignRow ,
colortypecolor ,
uint8_tbitsPerPixel ,
uint8_talpha ,
TextRotationrotation
)

Private version of draw-glyph with explicit destination buffer pointer argument.

For all parameters (except the buffer pointer) see the public function drawString().

Parameters:
wbuf16The destination (frame) buffer to draw to.
widgetAreaThe canvas to draw the glyph inside.
xHorizontal offset to start drawing the glyph.
yVertical offset to start drawing the glyph.
offsetXHorizontal offset in the glyph to start drawing from.
offsetYVertical offset in the glyph to start drawing from.
invalidatedAreaThe area to draw inside.
glyphSpecifications of the glyph to draw.
glyphDataData containing the actual glyph (dense format)
byteAlignRowEach row of glyph data starts in a new byte.
colorThe color of the glyph.
bitsPerPixelBit depth of the glyph.
alphaThe transparency of the glyph.
rotationRotation to do before drawing the glyph.

Reimplements: touchgfx::LCD::drawGlyph

getTextureMapperDrawScanLine

virtual DrawTextureMapScanLineBase * getTextureMapperDrawScanLine(const TextureSurface &texture ,
RenderingVariantrenderVariant ,
uint8_talpha
)

Gets pointer to object that can draw a scan line which allows for highly specialized and optimized implementation.

Parameters:
textureThe texture Surface.
renderVariantThe render variant.
alphaThe global alpha.
Returns:

Null if it fails, else the pointer to the texture mapper draw scan line object.

Reimplements: touchgfx::LCD::getTextureMapperDrawScanLine

blitCopyL8

static void blitCopyL8(const uint8_t *sourceData ,
const uint8_t *clutData ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha
)

Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if indexed format is not supported by the DMA a software blend is performed.

Parameters:
sourceDataThe source-indexes pointer (points to the beginning of the data). The sourceData must be stored as 8- bits indexes.
clutDataThe source-clut pointer (points to the beginning of the CLUT color format and size data followed by colors entries.
sourceThe location and dimensions of the source.
blitRectA rectangle describing what region is to be drawn.
alphaThe alpha value to use for blending applied to the whole image (255 = solid, no blending)

blitCopyL8_ARGB8888

static void blitCopyL8_ARGB8888(const uint8_t *sourceData ,
const uint8_t *clutData ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha
)

Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if L8_ARGB8888 is not supported by the DMA a software blend is performed.

Parameters:
sourceDataThe source-indexes pointer (points to the beginning of the data). The sourceData must be stored as 8- bits indexes.
clutDataThe source-clut pointer (points to the beginning of the CLUT color format and size data followed by colors entries stored as 32- bits (ARGB8888) format.
sourceThe location and dimensions of the source.
blitRectA rectangle describing what region is to be drawn.
alphaThe alpha value to use for blending applied to the whole image (255 = solid, no blending)

blitCopyL8_RGB565

static void blitCopyL8_RGB565(const uint8_t *sourceData ,
const uint8_t *clutData ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha
)

Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if L8_RGB565 is not supported by the DMA a software blend is performed.

Parameters:
sourceDataThe source-indexes pointer (points to the beginning of the data). The sourceData must be stored as 8- bits indexes.
clutDataThe source-clut pointer (points to the beginning of the CLUT color format and size data followed by colors entries stored as 16- bits (RGB565) format.
sourceThe location and dimensions of the source.
blitRectA rectangle describing what region is to be drawn.
alphaThe alpha value to use for blending applied to the whole image (255 = solid, no blending)

blitCopyL8_RGB888

static void blitCopyL8_RGB888(const uint8_t *sourceData ,
const uint8_t *clutData ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha
)

Blits a 2D indexed 8-bit source to the framebuffer performing alpha-blending per pixel as specified if L8_RGB888 is not supported by the DMA a software blend is performed.

Parameters:
sourceDataThe source-indexes pointer (points to the beginning of the data). The sourceData must be stored as 8- bits indexes.
clutDataThe source-clut pointer (points to the beginning of the CLUT color format and size data followed by colors entries stored as 32- bits (RGB888) format.
sourceThe location and dimensions of the source.
blitRectA rectangle describing what region is to be drawn.
alphaThe alpha value to use for blending applied to the whole image (255 = solid, no blending)

blitCopyRGB565

static void blitCopyRGB565(const uint16_t *sourceData16 ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha
)

Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified.

If! RGB565 is not supported by the DMA a software blend is performed.

Parameters:
sourceData16The source-array pointer (points to the beginning of the data). The sourceData must be stored as 16- bits RGB565 values.
sourceThe location and dimensions of the source.
blitRectA rectangle describing what region is to be drawn.
alphaThe alpha value to use for blending applied to the whole image (255 = solid, no blending)

blitCopyRGB888

static void blitCopyRGB888(const uint16_t *sourceData16 ,
const Rect &source ,
const Rect &blitRect ,
uint8_talpha
)

Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified.

If RGB888 is not supported by the DMA a software blend is performed.

Parameters:
sourceData16The source-array pointer (points to the beginning of the data). The sourceData must be stored as 24- bits RGB888 values.
sourceThe location and dimensions of the source.
blitRectA rectangle describing what region is to be drawn.
alphaThe alpha value to use for blending applied to the whole image (255 = solid, no blending)

nextLine

static int nextLine(boolrotatedDisplay ,
TextRotationtextRotation
)

Find out how much to advance in the display buffer to get to the next line.

Parameters:
rotatedDisplayIs the display running in portrait mode?
textRotationRotation to perform.
Returns:

How much to advance to get to the next line.

nextPixel

static int nextPixel(boolrotatedDisplay ,
TextRotationtextRotation
)

Find out how much to advance in the display buffer to get to the next pixel.

Parameters:
rotatedDisplayIs the display running in portrait mode?
textRotationRotation to perform.
Returns:

How much to advance to get to the next pixel.