MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Functions
stb_osd.h File Reference

Graphics functions required by the HD MHEG5 engine. All references to colour used in these functions can be one of three formats: More...

#include "techtype.h"
#include "osdtype.h"

Go to the source code of this file.

Functions

void STB_OSDMhegSetPalette (U16BIT index, U16BIT number, const U32BIT *argb)
 Sets Colour Palette array of up to 256 values, for single byte colour depth. This palette being an array of 'U32BIT' (8 Alpha, 8 Red, 8 Green, 8 Blue). More...
 
void * STB_OSDMhegSetResolution (U16BIT width, U16BIT height, U8BIT bits)
 Sets the size of the OSD to be used by MHEG engine. The return must be a surface handle for the entire screen back-buffer. The Engine will draw to the surface using STB_OSDMhegBlitStretch, which would be equivalent to it using STB_OSDMhegBlitBitmap() without stretching. More...
 
void * STB_OSDMhegCreateSurface (U16BIT width, U16BIT height, BOOLEAN init, U32BIT colour)
 Creates a hardware surface on which MHEG5 engine will draw an individual MHEG object. At its basic the function can just allocate the buffer to be returned by STB_OSDMhegLockBuffer(). It's size being: (width * height * bytes_per_pixel) Also, when 'init' is TRUE, function initialises surface buffer to the specified colour. For pixel colour format of less than four bytes, use least significant bits of 'colour'. More...
 
void * STB_OSDMhegLockBuffer (void *surface, U32BIT *pPitch)
 Converts hardware surface handle returned by STB_OSDMhegCreateSurface() to buffer address that the engine needs in order to draw the MHEG object. This function can inform HW that the engine needs write access to buffer. MHEG5 will use the return address and 'pitch' (or stride) value to locate pixel data. Before calling this function, 'pitch' is initialised to width as given by STB_OSDMhegCreateSurface(), but platform can alter this here. More...
 
void STB_OSDMhegUnlockBuffer (void *surface)
 This function informs HW that MHEG5 is finished writing to the buffer. More...
 
void STB_OSDMhegDestroySurface (void *surface)
 This function destroys surface and all data allocated by STB_OSDMhegCreateSurface() More...
 
void STB_OSDMhegBlitBitmap (void *surface, S_RECTANGLE *pRect, U32BIT pitch, U16BIT screen_x, U16BIT screen_y, E_BLIT_OP bflg)
 Render bitmap on OSD back buffer in the given screen location, with given operation. The bitmap is referenced 'surface' - a handle returned by STB_OSDMhegCreateSurface() More...
 
void STB_OSDMhegFillRectangle (S_RECTANGLE *pRect, U32BIT colour, E_BLIT_OP bflg)
 Draw a filled rectangle on OSD back buffer in the location given. Where pixel colour is less than four bytes, use least significant bits in 'colour'. 'rect' can be part of the screen or the entire screen. More...
 
void STB_OSDMhegBlitStretch (S_RECTANGLE *pSrcRect, void *src_surf, S_RECTANGLE *pDstRect, void *dst_surf, E_BLIT_OP bflg)
 Stretch blit bitmap data from source surface to destination surface using source and destination rectangles. When 'dst_surf' is handle returned by STB_OSDMhegSetResolution(), and rectangles are same size, this function is equivalent to STB_OSDMhegBlitBitmap. More...
 
void STB_OSDMhegFillSurface (void *surface, S_RECTANGLE *pRect, U32BIT colour, E_BLIT_OP bflg)
 Draw a filled rectangle on surface in the location given. Where pixel colour is less than four bytes, use least significant bits in 'colour'. More...
 
void STB_OSDMhegUpdate (void)
 Commit OSD changes to the screen - changes given by previous calls to STB_OSDMhegDrawRectangle() and STB_OSDMhegDrawBitmap(). More...
 
void STB_OSDMhegClear (void)
 Clear MHEG's entire OSD.
 

Detailed Description

Graphics functions required by the HD MHEG5 engine. All references to colour used in these functions can be one of three formats:

Date
30/04/2008
Author
Adam Sturtridge

Function Documentation

void STB_OSDMhegBlitBitmap ( void *  surface,
S_RECTANGLE pRect,
U32BIT  pitch,
U16BIT  screen_x,
U16BIT  screen_y,
E_BLIT_OP  bflg 
)

Render bitmap on OSD back buffer in the given screen location, with given operation. The bitmap is referenced 'surface' - a handle returned by STB_OSDMhegCreateSurface()

  1. It is a one-to-one mapping between surface pixels and screen pixels, so rect.width and rect.height give size of rectangle on the screen as well.
  2. (rect.top + rect.height) is guarenteed to be less than or equal to height given to STB_OSDMhegCreateSurface()
    Parameters
    surfaceHandle of surface returned by STB_OSDMhegCreateSurface
    rectsource rectangle within surface - top/left is offset into bitmap referenced by 'surface', width/height gives size.
    pitchWidth of line of source bitmap data - as returned by STB_OSDMhegLockBuffer()
    screen_xLeft or X position on screen to draw bitmap
    screen_yTop or Y position on screen to draw bitmap
    bflgOperation - COPY or ALPHA BLEND
    Returns
    void
void STB_OSDMhegBlitStretch ( S_RECTANGLE pSrcRect,
void *  src_surf,
S_RECTANGLE pDstRect,
void *  dst_surf,
E_BLIT_OP  bflg 
)

Stretch blit bitmap data from source surface to destination surface using source and destination rectangles. When 'dst_surf' is handle returned by STB_OSDMhegSetResolution(), and rectangles are same size, this function is equivalent to STB_OSDMhegBlitBitmap.

Parameters
pSrcRectrectangle for bitmap data
src_surfhandle returned by STB_OSDMhegCreateSurface
pDstRectrectangle for destination on surface
dst_surfhandle returned by STB_OSDMhegCreateSurface or STB_OSDMhegSetResolution
bflgOperation - COPY or ALPHA BLEND
Returns
void
void* STB_OSDMhegCreateSurface ( U16BIT  width,
U16BIT  height,
BOOLEAN  init,
U32BIT  colour 
)

Creates a hardware surface on which MHEG5 engine will draw an individual MHEG object. At its basic the function can just allocate the buffer to be returned by STB_OSDMhegLockBuffer(). It's size being: (width * height * bytes_per_pixel) Also, when 'init' is TRUE, function initialises surface buffer to the specified colour. For pixel colour format of less than four bytes, use least significant bits of 'colour'.

Parameters
widthWidth of requested surface in pixels
heightHeight of requested surface in pixels
initIf TRUE, initialise buffer with colour.
colourcolour for all pixels in buffer.
Returns
void* Success - Handle to surface. Failure - NULL (or zero)
void STB_OSDMhegDestroySurface ( void *  surface)

This function destroys surface and all data allocated by STB_OSDMhegCreateSurface()

Parameters
surfaceHandle of surface returned by STB_OSDMhegCreateSurface
Returns
void
void STB_OSDMhegFillRectangle ( S_RECTANGLE pRect,
U32BIT  colour,
E_BLIT_OP  bflg 
)

Draw a filled rectangle on OSD back buffer in the location given. Where pixel colour is less than four bytes, use least significant bits in 'colour'. 'rect' can be part of the screen or the entire screen.

Parameters
rectrectangle on screen - with top,left starting position
colourcolour for all pixels in rectangle.
bflgOperation - COPY or ALPHA BLEND
Returns
void
void STB_OSDMhegFillSurface ( void *  surface,
S_RECTANGLE pRect,
U32BIT  colour,
E_BLIT_OP  bflg 
)

Draw a filled rectangle on surface in the location given. Where pixel colour is less than four bytes, use least significant bits in 'colour'.

Parameters
surfacehandle returned by STB_OSDMhegCreateSurface
rectrectangle on screen - with top,left starting position
colourcolour for all pixels in rectangle.
bflgOperation - COPY or ALPHA BLEND
Returns
void
void* STB_OSDMhegLockBuffer ( void *  surface,
U32BIT *  pPitch 
)

Converts hardware surface handle returned by STB_OSDMhegCreateSurface() to buffer address that the engine needs in order to draw the MHEG object. This function can inform HW that the engine needs write access to buffer. MHEG5 will use the return address and 'pitch' (or stride) value to locate pixel data. Before calling this function, 'pitch' is initialised to width as given by STB_OSDMhegCreateSurface(), but platform can alter this here.

Parameters
surfaceHandle of surface returned by STB_OSDMhegCreateSurface
pitchwidth in bytes of one line of pixel data in buffer
Returns
void* Address of the buffer
void STB_OSDMhegSetPalette ( U16BIT  index,
U16BIT  number,
const U32BIT *  argb 
)

Sets Colour Palette array of up to 256 values, for single byte colour depth. This palette being an array of 'U32BIT' (8 Alpha, 8 Red, 8 Green, 8 Blue).

Parameters
index
numberSize of palette array
argbpointer to palette array
void* STB_OSDMhegSetResolution ( U16BIT  width,
U16BIT  height,
U8BIT  bits 
)

Sets the size of the OSD to be used by MHEG engine. The return must be a surface handle for the entire screen back-buffer. The Engine will draw to the surface using STB_OSDMhegBlitStretch, which would be equivalent to it using STB_OSDMhegBlitBitmap() without stretching.

Parameters
widthWidth of MHEG OSD resolution
heightHeight of MHEG OSD resolution
bitsNumber of bits per pixel
Returns
Surface handle of MHEG OSD layer
void STB_OSDMhegUnlockBuffer ( void *  surface)

This function informs HW that MHEG5 is finished writing to the buffer.

Parameters
surfaceHandle of surface returned by STB_OSDMhegCreateSurface
Returns
void
void STB_OSDMhegUpdate ( void  )

Commit OSD changes to the screen - changes given by previous calls to STB_OSDMhegDrawRectangle() and STB_OSDMhegDrawBitmap().

Returns
void