MHEG5 1.0
DTVKit MHEG5 1.0 API Documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tmcolor.h File Reference

Definition of colour type for MHEG5 - settings and conversions. More...

#include "mh5base.h"
#include "osdtypes.h"

Go to the source code of this file.

Data Structures

struct  S_MHEG_OSD_COLOUR_MAP
 

Macros

#define DEFAULTTEXTCOLOR   "\xff\xff\xff\x00", 4
 
#define TRANSPARENTCOLOR   "\xff\xff\xff\xff", 4
 
#define BLACKCOLOR   "\x00\x00\x00\x00", 4
 
#define DEFAULTSLIDERCOLOR   "\xff\xff\xff\x00", 4
 
#define DEFAULTBUTTONCOLOR   "\x50\x50\x50\x00", 4
 
#define DEFAULTHIGHLIGHTCOLOR   "\xff\xff\xff\x00", 4
 
#define DEFAULTDESKTOPCOLOUR   "\x00\x00\x00\x00", 4
 
#define RGB(r, g, b)   (0xff000000 | ((r) << 16) | ((g) << 8) | (b))
 
#define RGBT(r, g, b, t)   ((((t) ^ 0xff) << 24) | ((r) << 16) | ((g) << 8) | (b))
 
#define GetRValue(osdcolour)   (((osdcolour) >> 16) & 0xff)
 
#define GetGValue(osdcolour)   (((osdcolour) >> 8) & 0xff)
 
#define GetBValue(osdcolour)   ((osdcolour) & 0xff)
 
#define GetTValue(osdcolour)   (((osdcolour) >> 24) ^ 0xff)
 
#define GetAValue(osdcolour)   ((osdcolour) >> 24)
 
#define GetYValue(red, green, blue)   ((U8BIT) (((77 * red + 150 * green + 29 * blue) / 256)))
 
#define GetCBValue(red, green, blue)   ((U8BIT)((-44 * red - 87 * green + 131 * blue) / 256 + 128))
 
#define GetCRValue(red, green, blue)   ((U8BIT)((131 * red - 110 * green - 21 * blue) / 256 + 128))
 
#define GetMixValue(transparency)   ((255 - transparency) / (255 / 63))
 
#define DESKTOP_COLOUR   (RGBT(0, 0, 0, 0))
 
#define FULLY_TRANSPARENT   (RGBT(0, 0, 0, 255))
 

Enumerations

enum  E_MHEG_COLOURS {
  MHEG_COLOUR_CYAN, MHEG_COLOUR_CYAN1, MHEG_COLOUR_CYAN2, MHEG_COLOUR_CYAN3,
  MHEG_COLOUR_CYAN4, MHEG_COLOUR_DARKCYAN, MHEG_COLOUR_YELLOW, MHEG_COLOUR_YELLOW1,
  MHEG_COLOUR_YELLOW2, MHEG_COLOUR_YELLOW3, MHEG_COLOUR_YELLOW4, MHEG_COLOUR_DARKYELLOW,
  MHEG_COLOUR_MAGENTA, MHEG_COLOUR_MAGENTA1, MHEG_COLOUR_MAGENTA2, MHEG_COLOUR_MAGENTA3,
  MHEG_COLOUR_MAGENTA4, MHEG_COLOUR_DARKMAGENTA, MHEG_COLOUR_RED, MHEG_COLOUR_RED1,
  MHEG_COLOUR_RED2, MHEG_COLOUR_RED3, MHEG_COLOUR_RED4, MHEG_COLOUR_DARKRED,
  MHEG_COLOUR_GREEN, MHEG_COLOUR_GREEN1, MHEG_COLOUR_GREEN2, MHEG_COLOUR_GREEN3,
  MHEG_COLOUR_GREEN4, MHEG_COLOUR_DARKGREEN, MHEG_COLOUR_BLUE, MHEG_COLOUR_BLUE1,
  MHEG_COLOUR_BLUE2, MHEG_COLOUR_BLUE3, MHEG_COLOUR_BLUE4, MHEG_COLOUR_DARKBLUE,
  MHEG_COLOUR_BLACK, MHEG_COLOUR_GRAY, MHEG_COLOUR_GREY, MHEG_COLOUR_WHITE,
  MHEG_COLOUR_TRANSPARENT
}
 

Functions

OSDColor OSDgetColour (const char *colour, int len)
 Converts an MHEG5 colour value to an OSDColor type. More...
 
MHEG5String OSDsetColour (OSDColor colour)
 Converts an OSDColor type into an MHEG5 colour value For UK1 profile only RGBTCOLOR is defined. More...
 

Detailed Description

Definition of colour type for MHEG5 - settings and conversions.

Date
08/11/2001
Author
iwillis

Macro Definition Documentation

#define BLACKCOLOR   "\x00\x00\x00\x00", 4
#define DEFAULTBUTTONCOLOR   "\x50\x50\x50\x00", 4
#define DEFAULTDESKTOPCOLOUR   "\x00\x00\x00\x00", 4
#define DEFAULTHIGHLIGHTCOLOR   "\xff\xff\xff\x00", 4
#define DEFAULTSLIDERCOLOR   "\xff\xff\xff\x00", 4
#define DEFAULTTEXTCOLOR   "\xff\xff\xff\x00", 4
#define DESKTOP_COLOUR   (RGBT(0, 0, 0, 0))
#define FULLY_TRANSPARENT   (RGBT(0, 0, 0, 255))
#define GetAValue (   osdcolour)    ((osdcolour) >> 24)
#define GetBValue (   osdcolour)    ((osdcolour) & 0xff)
#define GetCBValue (   red,
  green,
  blue 
)    ((U8BIT)((-44 * red - 87 * green + 131 * blue) / 256 + 128))
#define GetCRValue (   red,
  green,
  blue 
)    ((U8BIT)((131 * red - 110 * green - 21 * blue) / 256 + 128))
#define GetGValue (   osdcolour)    (((osdcolour) >> 8) & 0xff)
#define GetMixValue (   transparency)    ((255 - transparency) / (255 / 63))
#define GetRValue (   osdcolour)    (((osdcolour) >> 16) & 0xff)
#define GetTValue (   osdcolour)    (((osdcolour) >> 24) ^ 0xff)
#define GetYValue (   red,
  green,
  blue 
)    ((U8BIT) (((77 * red + 150 * green + 29 * blue) / 256)))
#define RGB (   r,
  g,
 
)    (0xff000000 | ((r) << 16) | ((g) << 8) | (b))
#define RGBT (   r,
  g,
  b,
 
)    ((((t) ^ 0xff) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define TRANSPARENTCOLOR   "\xff\xff\xff\xff", 4

Enumeration Type Documentation

Enumerator
MHEG_COLOUR_CYAN 
MHEG_COLOUR_CYAN1 
MHEG_COLOUR_CYAN2 
MHEG_COLOUR_CYAN3 
MHEG_COLOUR_CYAN4 
MHEG_COLOUR_DARKCYAN 
MHEG_COLOUR_YELLOW 
MHEG_COLOUR_YELLOW1 
MHEG_COLOUR_YELLOW2 
MHEG_COLOUR_YELLOW3 
MHEG_COLOUR_YELLOW4 
MHEG_COLOUR_DARKYELLOW 
MHEG_COLOUR_MAGENTA 
MHEG_COLOUR_MAGENTA1 
MHEG_COLOUR_MAGENTA2 
MHEG_COLOUR_MAGENTA3 
MHEG_COLOUR_MAGENTA4 
MHEG_COLOUR_DARKMAGENTA 
MHEG_COLOUR_RED 
MHEG_COLOUR_RED1 
MHEG_COLOUR_RED2 
MHEG_COLOUR_RED3 
MHEG_COLOUR_RED4 
MHEG_COLOUR_DARKRED 
MHEG_COLOUR_GREEN 
MHEG_COLOUR_GREEN1 
MHEG_COLOUR_GREEN2 
MHEG_COLOUR_GREEN3 
MHEG_COLOUR_GREEN4 
MHEG_COLOUR_DARKGREEN 
MHEG_COLOUR_BLUE 
MHEG_COLOUR_BLUE1 
MHEG_COLOUR_BLUE2 
MHEG_COLOUR_BLUE3 
MHEG_COLOUR_BLUE4 
MHEG_COLOUR_DARKBLUE 
MHEG_COLOUR_BLACK 
MHEG_COLOUR_GRAY 
MHEG_COLOUR_GREY 
MHEG_COLOUR_WHITE 
MHEG_COLOUR_TRANSPARENT 

Function Documentation

OSDColor OSDgetColour ( const char *  colour,
int  len 
)

Converts an MHEG5 colour value to an OSDColor type.

Parameters
colourPointer to an array of bytes that specify the MHEG5 colour
lenLength of the colour parameter
Returns
OSDColor representation of the specified colour

Converts an MHEG5 colour value to an OSDColor type.

Parameters
colourPointer to an array of bytes that specify the MHEG5 colour
lenLength of the colour parameter
Returns
OSDColor representation of the specified colour
MHEG5String OSDsetColour ( OSDColor  colour)

Converts an OSDColor type into an MHEG5 colour value For UK1 profile only RGBTCOLOR is defined.

Parameters
colourOSDColor to convert
Returns
MHEG5 colour representation of the specified colour