osd.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
  2. /*
  3. * osd.h - DEPRECATED On Screen Display API
  4. *
  5. * NOTE: should not be used on future drivers
  6. *
  7. * Copyright (C) 2001 Ralph Metzler <[email protected]>
  8. * & Marcus Metzler <[email protected]>
  9. * for convergence integrated media GmbH
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Lesser Public License
  13. * as published by the Free Software Foundation; either version 2.1
  14. * of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24. *
  25. */
  26. #ifndef _DVBOSD_H_
  27. #define _DVBOSD_H_
  28. #include <linux/compiler.h>
  29. typedef enum {
  30. /* All functions return -2 on "not open" */
  31. OSD_Close = 1, /* () */
  32. /*
  33. * Disables OSD and releases the buffers
  34. * returns 0 on success
  35. */
  36. OSD_Open, /* (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) */
  37. /*
  38. * Opens OSD with this size and bit depth
  39. * returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
  40. */
  41. OSD_Show, /* () */
  42. /*
  43. * enables OSD mode
  44. * returns 0 on success
  45. */
  46. OSD_Hide, /* () */
  47. /*
  48. * disables OSD mode
  49. * returns 0 on success
  50. */
  51. OSD_Clear, /* () */
  52. /*
  53. * Sets all pixel to color 0
  54. * returns 0 on success
  55. */
  56. OSD_Fill, /* (color) */
  57. /*
  58. * Sets all pixel to color <col>
  59. * returns 0 on success
  60. */
  61. OSD_SetColor, /* (color,R{x0},G{y0},B{x1},opacity{y1}) */
  62. /*
  63. * set palette entry <num> to <r,g,b>, <mix> and <trans> apply
  64. * R,G,B: 0..255
  65. * R=Red, G=Green, B=Blue
  66. * opacity=0: pixel opacity 0% (only video pixel shows)
  67. * opacity=1..254: pixel opacity as specified in header
  68. * opacity=255: pixel opacity 100% (only OSD pixel shows)
  69. * returns 0 on success, -1 on error
  70. */
  71. OSD_SetPalette, /* (firstcolor{color},lastcolor{x0},data) */
  72. /*
  73. * Set a number of entries in the palette
  74. * sets the entries "firstcolor" through "lastcolor" from the array "data"
  75. * data has 4 byte for each color:
  76. * R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
  77. */
  78. OSD_SetTrans, /* (transparency{color}) */
  79. /*
  80. * Sets transparency of mixed pixel (0..15)
  81. * returns 0 on success
  82. */
  83. OSD_SetPixel, /* (x0,y0,color) */
  84. /*
  85. * sets pixel <x>,<y> to color number <col>
  86. * returns 0 on success, -1 on error
  87. */
  88. OSD_GetPixel, /* (x0,y0) */
  89. /* returns color number of pixel <x>,<y>, or -1 */
  90. OSD_SetRow, /* (x0,y0,x1,data) */
  91. /*
  92. * fills pixels x0,y through x1,y with the content of data[]
  93. * returns 0 on success, -1 on clipping all pixel (no pixel drawn)
  94. */
  95. OSD_SetBlock, /* (x0,y0,x1,y1,increment{color},data) */
  96. /*
  97. * fills pixels x0,y0 through x1,y1 with the content of data[]
  98. * inc contains the width of one line in the data block,
  99. * inc<=0 uses blockwidth as linewidth
  100. * returns 0 on success, -1 on clipping all pixel
  101. */
  102. OSD_FillRow, /* (x0,y0,x1,color) */
  103. /*
  104. * fills pixels x0,y through x1,y with the color <col>
  105. * returns 0 on success, -1 on clipping all pixel
  106. */
  107. OSD_FillBlock, /* (x0,y0,x1,y1,color) */
  108. /*
  109. * fills pixels x0,y0 through x1,y1 with the color <col>
  110. * returns 0 on success, -1 on clipping all pixel
  111. */
  112. OSD_Line, /* (x0,y0,x1,y1,color) */
  113. /*
  114. * draw a line from x0,y0 to x1,y1 with the color <col>
  115. * returns 0 on success
  116. */
  117. OSD_Query, /* (x0,y0,x1,y1,xasp{color}}), yasp=11 */
  118. /*
  119. * fills parameters with the picture dimensions and the pixel aspect ratio
  120. * returns 0 on success
  121. */
  122. OSD_Test, /* () */
  123. /*
  124. * draws a test picture. for debugging purposes only
  125. * returns 0 on success
  126. * TODO: remove "test" in final version
  127. */
  128. OSD_Text, /* (x0,y0,size,color,text) */
  129. OSD_SetWindow, /* (x0) set window with number 0<x0<8 as current */
  130. OSD_MoveWindow, /* move current window to (x0, y0) */
  131. OSD_OpenRaw, /* Open other types of OSD windows */
  132. } OSD_Command;
  133. typedef struct osd_cmd_s {
  134. OSD_Command cmd;
  135. int x0;
  136. int y0;
  137. int x1;
  138. int y1;
  139. int color;
  140. void __user *data;
  141. } osd_cmd_t;
  142. /* OSD_OpenRaw: set 'color' to desired window type */
  143. typedef enum {
  144. OSD_BITMAP1, /* 1 bit bitmap */
  145. OSD_BITMAP2, /* 2 bit bitmap */
  146. OSD_BITMAP4, /* 4 bit bitmap */
  147. OSD_BITMAP8, /* 8 bit bitmap */
  148. OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
  149. OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
  150. OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
  151. OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
  152. OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
  153. OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
  154. OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
  155. OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
  156. OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
  157. OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
  158. OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
  159. OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
  160. OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
  161. OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
  162. OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
  163. OSD_CURSOR /* Cursor */
  164. } osd_raw_window_t;
  165. typedef struct osd_cap_s {
  166. int cmd;
  167. #define OSD_CAP_MEMSIZE 1 /* memory size */
  168. long val;
  169. } osd_cap_t;
  170. #define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
  171. #define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t)
  172. #endif