NinjaFlight
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
color.h
Go to the documentation of this file.
1
/*
2
* This file is part of Ninjaflight.
3
*
4
* Ninjaflight is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* Ninjaflight is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
typedef
enum
{
21
RGB_RED
= 0,
22
RGB_GREEN
,
23
RGB_BLUE
24
}
colorComponent_e
;
25
26
#define RGB_COLOR_COMPONENT_COUNT (RGB_BLUE + 1)
27
28
typedef
union
{
29
struct
{
30
uint8_t
r
;
31
uint8_t
g
;
32
uint8_t
b
;
33
} rgb;
34
uint8_t
raw
[
RGB_COLOR_COMPONENT_COUNT
];
35
}
rgbColor24bpp_t
;
36
37
#define HSV_HUE_MAX 359
38
#define HSV_SATURATION_MAX 255
39
#define HSV_VALUE_MAX 255
40
41
typedef
enum
{
42
HSV_HUE
= 0,
43
HSV_SATURATION
,
44
HSV_VALUE
45
}
hsvColorComponent_e
;
46
47
#define HSV_COLOR_COMPONENT_COUNT (HSV_VALUE + 1)
48
49
typedef
struct
hsvColor_s
{
50
uint16_t
h
;
// 0 - 359
51
uint8_t
s
;
// 0 - 255
52
uint8_t
v
;
// 0 - 255
53
}
hsvColor_t
;
RGB_COLOR_COMPONENT_COUNT
#define RGB_COLOR_COMPONENT_COUNT
Definition:
color.h:26
hsvColor_t
struct hsvColor_s hsvColor_t
hsvColor_s::h
uint16_t h
Definition:
color.h:50
RGB_RED
Definition:
color.h:21
hsvColor_s::s
uint8_t s
Definition:
color.h:51
rgbColor24bpp_t
Definition:
color.h:28
HSV_VALUE
Definition:
color.h:44
colorComponent_e
colorComponent_e
Definition:
color.h:20
HSV_HUE
Definition:
color.h:42
HSV_SATURATION
Definition:
color.h:43
hsvColor_s::v
uint8_t v
Definition:
color.h:52
RGB_BLUE
Definition:
color.h:23
rgbColor24bpp_t::b
uint8_t b
Definition:
color.h:32
RGB_GREEN
Definition:
color.h:22
rgbColor24bpp_t::r
uint8_t r
Definition:
color.h:30
rgbColor24bpp_t::g
uint8_t g
Definition:
color.h:31
raw
int16_t raw[2]
Definition:
accelerometer.h:51
hsvColor_s
Definition:
color.h:49
hsvColorComponent_e
hsvColorComponent_e
Definition:
color.h:41
src
main
common
color.h
Generated on Mon Dec 12 2016 15:48:45 for NinjaFlight by
1.8.7