MHEG5  18.9.0
MHEG5 Documentation
Classes | Typedefs | Functions
mg_bitmap.c File Reference

Implementation of Bitmap functionality. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "glue_memory.h"
#include "glue_debug.h"
#include "osd_utils.h"
#include "mg_ctxt.h"
#include "stb_osd.h"
#include "decoder.h"

Go to the source code of this file.

Classes

struct  S_COLOUR
 

Typedefs

typedef U32BIT HD4Color
 

Functions

S_COLOUR MeanArgbCol (S_COLOUR cola, U32BIT weighta, S_COLOUR colb, U32BIT weightb)
 
void * DEC_OSDCreateBmpSurf (U32BIT s_width, U32BIT s_height, U32BIT i_width, U32BIT i_height, S_IMAGE *image, U32BIT *pStride)
 This creates a hardware surface of size using STB_OSDMhegCreateSurface() with s_width and s_height, and fills the surface with the IMAGE data. The bitmap must be stretched or shrunk onto surface with image size (i_width,i_height) When surface size is greater than image size, then the bitmap is 'tiled' to fill the surface. Otherwise sizes will be equal. Implementations may choose to ignore requested surface size and leave MHEG5 to do the tiling (where graphic memory is limited). If so, 'tiled' should be set to FALSE, and use (i_width,i_height) for surface size. Colour format of resulting surface is as used in the call to MHEG5_Open() with 'ColourDepth' in setup config. More...
 

Detailed Description

Implementation of Bitmap functionality.

Date
28/05/2009
Author
Adam Sturtridge

Definition in file mg_bitmap.c.

Typedef Documentation

typedef U32BIT HD4Color

Definition at line 43 of file mg_bitmap.c.

Function Documentation

void* DEC_OSDCreateBmpSurf ( U32BIT  s_width,
U32BIT  s_height,
U32BIT  i_width,
U32BIT  i_height,
S_IMAGE image,
U32BIT pStride 
)

This creates a hardware surface of size using STB_OSDMhegCreateSurface() with s_width and s_height, and fills the surface with the IMAGE data. The bitmap must be stretched or shrunk onto surface with image size (i_width,i_height) When surface size is greater than image size, then the bitmap is 'tiled' to fill the surface. Otherwise sizes will be equal. Implementations may choose to ignore requested surface size and leave MHEG5 to do the tiling (where graphic memory is limited). If so, 'tiled' should be set to FALSE, and use (i_width,i_height) for surface size. Colour format of resulting surface is as used in the call to MHEG5_Open() with 'ColourDepth' in setup config.

Parameters
s_widthWidth of requested surface in pixels
s_heightHeight of requested surface in pixels
i_widthWidth of image on surface in pixels
i_heightHeight of image on surface in pixels
imageimage structure returned by DEC_DecodePNG() or DEC_DecodeJPG()
pitchwidth of returned buffer in bytes.
Returns
void* Success - Handle to surface. Failure - NULL (or zero)

Definition at line 1397 of file mg_bitmap.c.

S_COLOUR MeanArgbCol ( S_COLOUR  cola,
U32BIT  weighta,
S_COLOUR  colb,
U32BIT  weightb 
)

Definition at line 58 of file mg_bitmap.c.