osd.h 5.6 KB

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