v4l2-tpg-colors.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * v4l2-tpg-colors.h - Color definitions for the test pattern generator
  3. *
  4. * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  5. *
  6. * This program is free software; you may redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  11. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  13. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  14. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  15. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. * SOFTWARE.
  18. */
  19. #ifndef _V4L2_TPG_COLORS_H_
  20. #define _V4L2_TPG_COLORS_H_
  21. struct color {
  22. unsigned char r, g, b;
  23. };
  24. struct color16 {
  25. int r, g, b;
  26. };
  27. enum tpg_color {
  28. TPG_COLOR_CSC_WHITE,
  29. TPG_COLOR_CSC_YELLOW,
  30. TPG_COLOR_CSC_CYAN,
  31. TPG_COLOR_CSC_GREEN,
  32. TPG_COLOR_CSC_MAGENTA,
  33. TPG_COLOR_CSC_RED,
  34. TPG_COLOR_CSC_BLUE,
  35. TPG_COLOR_CSC_BLACK,
  36. TPG_COLOR_75_YELLOW,
  37. TPG_COLOR_75_CYAN,
  38. TPG_COLOR_75_GREEN,
  39. TPG_COLOR_75_MAGENTA,
  40. TPG_COLOR_75_RED,
  41. TPG_COLOR_75_BLUE,
  42. TPG_COLOR_100_WHITE,
  43. TPG_COLOR_100_YELLOW,
  44. TPG_COLOR_100_CYAN,
  45. TPG_COLOR_100_GREEN,
  46. TPG_COLOR_100_MAGENTA,
  47. TPG_COLOR_100_RED,
  48. TPG_COLOR_100_BLUE,
  49. TPG_COLOR_100_BLACK,
  50. TPG_COLOR_TEXTFG,
  51. TPG_COLOR_TEXTBG,
  52. TPG_COLOR_RANDOM,
  53. TPG_COLOR_RAMP,
  54. TPG_COLOR_MAX = TPG_COLOR_RAMP + 256
  55. };
  56. extern const struct color tpg_colors[TPG_COLOR_MAX];
  57. extern const unsigned short tpg_rec709_to_linear[255 * 16 + 1];
  58. extern const unsigned short tpg_linear_to_rec709[255 * 16 + 1];
  59. extern const struct color16 tpg_csc_colors[V4L2_COLORSPACE_DCI_P3 + 1]
  60. [V4L2_XFER_FUNC_SMPTE2084 + 1]
  61. [TPG_COLOR_CSC_BLACK + 1];
  62. #endif