mirror of
https://github.com/nodemcu/nodemcu-firmware.git
synced 2025-01-30 21:12:55 +08:00
526d21dab4
The PR removed the bulk of non-newlib headers from the NodeMCU source base. app/libc has now been cut down to the bare minimum overrides to shadow the corresponding functions in the SDK's libc. The old c_xyz.h headerfiles have been nuked in favour of the standard <xyz.h> headers, with a few exceptions over in sdk-overrides. Again, shipping a libc.a without headers is a terrible thing to do. We're still living on a prayer that libc was configured the same was as a default-configured xtensa gcc toolchain assumes it is. That part I cannot do anything about, unfortunately, but it's no worse than it has been before. This enables our source files to compile successfully using the standard header files, and use the typical malloc()/calloc()/realloc()/free(), the strwhatever()s and memwhatever()s. These end up, through macro and linker magic, mapped to the appropriate SDK or ROM functions.
40 lines
839 B
C
40 lines
839 B
C
#ifndef APP_MODULES_COLOR_UTILS_H_
|
|
#define APP_MODULES_COLOR_UTILS_H_
|
|
|
|
#include "module.h"
|
|
#include "lauxlib.h"
|
|
#include "lmem.h"
|
|
#include "platform.h"
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
#include <string.h>
|
|
#include "user_interface.h"
|
|
#include "osapi.h"
|
|
|
|
/**
|
|
* Convert hsv to grb
|
|
* hue is 0-360, sat and val are 0-255
|
|
*/
|
|
uint32_t hsv2grb(uint16_t hue, uint8_t sat, uint8_t val);
|
|
/**
|
|
* Convert hsv to grbw
|
|
* hue is 0-360, sat and val are 0-255
|
|
*/
|
|
uint32_t hsv2grbw(uint16_t hue, uint8_t sat, uint8_t val);
|
|
/**
|
|
* Convert grb to hsv
|
|
* g, r, b are 0-255
|
|
*/
|
|
uint32_t grb2hsv(uint8_t g, uint8_t r, uint8_t b);
|
|
|
|
|
|
/**
|
|
* The color wheel function provides colors from r -> g -> b -> r.
|
|
* They are fully saturated and with full brightness.
|
|
* degree is from 0-360
|
|
*/
|
|
uint32_t color_wheel(uint16_t degree);
|
|
|
|
|
|
#endif /* APP_MODULES_COLOR_UTILS_H_ */
|