You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.1 KiB

  1. /* Copyright 2017 Jason Williams
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef COLOR_H
  17. #define COLOR_H
  18. #include <stdint.h>
  19. #include <stdbool.h>
  20. #if defined(__GNUC__)
  21. #define PACKED __attribute__ ((__packed__))
  22. #else
  23. #define PACKED
  24. #endif
  25. #if defined(_MSC_VER)
  26. #pragma pack( push, 1 )
  27. #endif
  28. typedef struct PACKED
  29. {
  30. uint8_t r;
  31. uint8_t g;
  32. uint8_t b;
  33. } RGB;
  34. typedef struct PACKED
  35. {
  36. uint8_t h;
  37. uint8_t s;
  38. uint8_t v;
  39. } HSV;
  40. #if defined(_MSC_VER)
  41. #pragma pack( pop )
  42. #endif
  43. RGB hsv_to_rgb( HSV hsv );
  44. #endif // COLOR_H