MHEG5
18.9.0
MHEG5 Documentation
Main Page
Related Pages
Classes
Files
File List
File Members
source
core
inc
tmcolor.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3
* Copyright © 2004 Ocean Blue Software Ltd
4
* Copyright © 2000 Koninklijke Philips Electronics N.V
5
*
6
* This file is part of a DTVKit Software Component
7
* You are permitted to copy, modify or distribute this file subject to the terms
8
* of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9
*
10
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12
* OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13
*
14
* If you or your organisation is not a member of DTVKit then you have access
15
* to this source code outside of the terms of the licence agreement
16
* and you are expected to delete this and any associated files immediately.
17
* Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18
*******************************************************************************/
26
#ifndef _TMCOLOR_H
27
#define _TMCOLOR_H
28
29
/*---includes for this file--------------------------------------------------*/
30
31
#include "
mh5base.h
"
32
#include "
osdtypes.h
"
33
34
/*---Constant and macro definitions for public use---------------------------*/
35
36
#define DEFAULTTEXTCOLOR "\xff\xff\xff\x00", 4
37
#define TRANSPARENTCOLOR "\xff\xff\xff\xff", 4
38
#define BLACKCOLOR "\x00\x00\x00\x00", 4
39
#define DEFAULTSLIDERCOLOR "\xff\xff\xff\x00", 4
40
#define DEFAULTBUTTONCOLOR "\x50\x50\x50\x00", 4
41
#define DEFAULTHIGHLIGHTCOLOR "\xff\xff\xff\x00", 4
42
#define DEFAULTDESKTOPCOLOUR "\x00\x00\x00\x00", 4
43
44
/* Macros to convert from discrete red, green, blue and transparent values to
45
* OSDColor values
46
*/
47
#define RGB(r, g, b) (0xff000000 | ((r) << 16) | ((g) << 8) | (b))
48
#define RGBT(r, g, b, t) ((((t) ^ 0xff) << 24) | ((r) << 16) | ((g) << 8) | (b))
49
50
/* Macros to extract red, green, blue, transparent and alpha values from an
51
* OSDColor value
52
*/
53
54
#define GetRValue(osdcolour) (((osdcolour) >> 16) & 0xff)
55
#define GetGValue(osdcolour) (((osdcolour) >> 8) & 0xff)
56
#define GetBValue(osdcolour) ((osdcolour) & 0xff)
57
#define GetTValue(osdcolour) (((osdcolour) >> 24) ^ 0xff)
58
#define GetAValue(osdcolour) ((osdcolour) >> 24)
59
60
#define GetYValue(red, green, blue) ((U8BIT) (((77 * red + 150 * green + 29 * blue) / 256)))
61
#define GetCBValue(red, green, blue) ((U8BIT)((-44 * red - 87 * green + 131 * blue) / 256 + 128))
62
#define GetCRValue(red, green, blue) ((U8BIT)((131 * red - 110 * green - 21 * blue) / 256 + 128))
63
#define GetMixValue(transparency) ((255 - transparency) / (255 / 63))
64
65
/* Desktop colour is displayed at the bottom of the MHEG-5 display stack */
66
#define DESKTOP_COLOUR (RGBT(0, 0, 0, 0))
67
68
/* Fully transparent OSDColor type */
69
#define FULLY_TRANSPARENT (RGBT(0, 0, 0, 255))
70
71
/*---Enumerations for public use---------------------------------------------*/
72
73
/*---Global type defs for public use-----------------------------------------*/
74
typedef
enum
75
{
76
MHEG_COLOUR_CYAN
,
77
MHEG_COLOUR_CYAN1
,
78
MHEG_COLOUR_CYAN2
,
79
MHEG_COLOUR_CYAN3
,
80
MHEG_COLOUR_CYAN4
,
81
MHEG_COLOUR_DARKCYAN
,
82
MHEG_COLOUR_YELLOW
,
83
MHEG_COLOUR_YELLOW1
,
84
MHEG_COLOUR_YELLOW2
,
85
MHEG_COLOUR_YELLOW3
,
86
MHEG_COLOUR_YELLOW4
,
87
MHEG_COLOUR_DARKYELLOW
,
88
MHEG_COLOUR_MAGENTA
,
89
MHEG_COLOUR_MAGENTA1
,
90
MHEG_COLOUR_MAGENTA2
,
91
MHEG_COLOUR_MAGENTA3
,
92
MHEG_COLOUR_MAGENTA4
,
93
MHEG_COLOUR_DARKMAGENTA
,
94
MHEG_COLOUR_RED
,
95
MHEG_COLOUR_RED1
,
96
MHEG_COLOUR_RED2
,
97
MHEG_COLOUR_RED3
,
98
MHEG_COLOUR_RED4
,
99
MHEG_COLOUR_DARKRED
,
100
MHEG_COLOUR_GREEN
,
101
MHEG_COLOUR_GREEN1
,
102
MHEG_COLOUR_GREEN2
,
103
MHEG_COLOUR_GREEN3
,
104
MHEG_COLOUR_GREEN4
,
105
MHEG_COLOUR_DARKGREEN
,
106
MHEG_COLOUR_BLUE
,
107
MHEG_COLOUR_BLUE1
,
108
MHEG_COLOUR_BLUE2
,
109
MHEG_COLOUR_BLUE3
,
110
MHEG_COLOUR_BLUE4
,
111
MHEG_COLOUR_DARKBLUE
,
112
MHEG_COLOUR_BLACK
,
113
MHEG_COLOUR_GRAY
,
114
MHEG_COLOUR_GREY
,
115
MHEG_COLOUR_WHITE
,
116
MHEG_COLOUR_TRANSPARENT
117
}
E_MHEG_COLOURS
;
118
119
typedef
struct
120
{
121
U8BIT
transparancy
;
122
U8BIT
red
;
123
U8BIT
green
;
124
U8BIT
blue
;
125
}
S_MHEG_OSD_COLOUR_MAP
;
126
127
/*---Global variable declarations for public use-----------------------------*/
128
129
/*---Global Function prototypes for public use-------------------------------*/
130
138
OSDColor
OSDgetColour
(
const
char
*colour,
int
len
);
139
146
MHEG5String
OSDsetColour
(
OSDColor
colour);
147
148
149
#endif
/*_TMCOLOR_H*/
mh5base.h
Basis MHEG5 data types.
MHEG_COLOUR_CYAN1
Definition:
tmcolor.h:77
MHEG_COLOUR_BLUE2
Definition:
tmcolor.h:108
MHEG_COLOUR_GREEN3
Definition:
tmcolor.h:103
MHEG_COLOUR_CYAN
Definition:
tmcolor.h:76
MHEG_COLOUR_MAGENTA1
Definition:
tmcolor.h:89
MHEG_COLOUR_GREY
Definition:
tmcolor.h:114
MHEG_COLOUR_GREEN
Definition:
tmcolor.h:100
MHEG_COLOUR_MAGENTA4
Definition:
tmcolor.h:92
E_MHEG_COLOURS
E_MHEG_COLOURS
Definition:
tmcolor.h:74
sMHEG5String
Definition:
mh5base.h:82
MHEG_COLOUR_RED
Definition:
tmcolor.h:94
OSDColor
U32BIT OSDColor
Definition:
osdtypes.h:41
MHEG_COLOUR_DARKGREEN
Definition:
tmcolor.h:105
MHEG_COLOUR_YELLOW2
Definition:
tmcolor.h:84
MHEG_COLOUR_DARKRED
Definition:
tmcolor.h:99
MHEG_COLOUR_DARKBLUE
Definition:
tmcolor.h:111
MHEG_COLOUR_MAGENTA3
Definition:
tmcolor.h:91
U8BIT
uint8_t U8BIT
Definition:
techtype.h:82
OSDgetColour
OSDColor OSDgetColour(const char *colour, int len)
Converts an MHEG5 colour value to an OSDColor type.
Definition:
tmcolor.c:53
MHEG_COLOUR_YELLOW1
Definition:
tmcolor.h:83
MHEG_COLOUR_BLUE3
Definition:
tmcolor.h:109
MHEG_COLOUR_YELLOW4
Definition:
tmcolor.h:86
MHEG_COLOUR_CYAN3
Definition:
tmcolor.h:79
MHEG_COLOUR_MAGENTA
Definition:
tmcolor.h:88
MHEG_COLOUR_DARKYELLOW
Definition:
tmcolor.h:87
MHEG_COLOUR_DARKCYAN
Definition:
tmcolor.h:81
MHEG_COLOUR_RED3
Definition:
tmcolor.h:97
MHEG_COLOUR_GREEN1
Definition:
tmcolor.h:101
MHEG_COLOUR_BLUE1
Definition:
tmcolor.h:107
osdtypes.h
Define OSD types.
len
int len
Definition:
mh5gate.c:57
S_MHEG_OSD_COLOUR_MAP::red
U8BIT red
Definition:
tmcolor.h:122
OSDsetColour
MHEG5String OSDsetColour(OSDColor colour)
Converts an OSDColor type into an MHEG5 colour value For UK1 profile only RGBTCOLOR is defined...
Definition:
tmcolor.c:210
S_MHEG_OSD_COLOUR_MAP::blue
U8BIT blue
Definition:
tmcolor.h:124
MHEG_COLOUR_GREEN4
Definition:
tmcolor.h:104
MHEG_COLOUR_BLUE
Definition:
tmcolor.h:106
MHEG_COLOUR_BLUE4
Definition:
tmcolor.h:110
MHEG_COLOUR_BLACK
Definition:
tmcolor.h:112
MHEG_COLOUR_TRANSPARENT
Definition:
tmcolor.h:116
S_MHEG_OSD_COLOUR_MAP::green
U8BIT green
Definition:
tmcolor.h:123
MHEG_COLOUR_DARKMAGENTA
Definition:
tmcolor.h:93
MHEG_COLOUR_RED4
Definition:
tmcolor.h:98
MHEG_COLOUR_CYAN4
Definition:
tmcolor.h:80
MHEG_COLOUR_WHITE
Definition:
tmcolor.h:115
S_MHEG_OSD_COLOUR_MAP::transparancy
U8BIT transparancy
Definition:
tmcolor.h:121
S_MHEG_OSD_COLOUR_MAP
Definition:
tmcolor.h:119
MHEG_COLOUR_RED1
Definition:
tmcolor.h:95
MHEG_COLOUR_RED2
Definition:
tmcolor.h:96
MHEG_COLOUR_MAGENTA2
Definition:
tmcolor.h:90
MHEG_COLOUR_YELLOW
Definition:
tmcolor.h:82
MHEG_COLOUR_GRAY
Definition:
tmcolor.h:113
MHEG_COLOUR_GREEN2
Definition:
tmcolor.h:102
MHEG_COLOUR_YELLOW3
Definition:
tmcolor.h:85
MHEG_COLOUR_CYAN2
Definition:
tmcolor.h:78
Generated by
1.8.11