initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / linux / dvb / osd.h
blobcdaff25eccc3f06c0803101221a422f71e230935
1 /*
2 * osd.h
4 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
5 * & Marcus Metzler <marcus@convergence.de>
6 for convergence integrated media GmbH
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.
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.
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.
24 #ifndef _DVBOSD_H_
25 #define _DVBOSD_H_
27 #include <linux/compiler.h>
29 typedef enum {
30 // All functions return -2 on "not open"
31 OSD_Close=1, // ()
32 // Disables OSD and releases the buffers
33 // returns 0 on success
34 OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
35 // Opens OSD with this size and bit depth
36 // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
37 OSD_Show, // ()
38 // enables OSD mode
39 // returns 0 on success
40 OSD_Hide, // ()
41 // disables OSD mode
42 // returns 0 on success
43 OSD_Clear, // ()
44 // Sets all pixel to color 0
45 // returns 0 on success
46 OSD_Fill, // (color)
47 // Sets all pixel to color <col>
48 // returns 0 on success
49 OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
50 // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
51 // R,G,B: 0..255
52 // R=Red, G=Green, B=Blue
53 // opacity=0: pixel opacity 0% (only video pixel shows)
54 // opacity=1..254: pixel opacity as specified in header
55 // opacity=255: pixel opacity 100% (only OSD pixel shows)
56 // returns 0 on success, -1 on error
57 OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
58 // Set a number of entries in the palette
59 // sets the entries "firstcolor" through "lastcolor" from the array "data"
60 // data has 4 byte for each color:
61 // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
62 OSD_SetTrans, // (transparency{color})
63 // Sets transparency of mixed pixel (0..15)
64 // returns 0 on success
65 OSD_SetPixel, // (x0,y0,color)
66 // sets pixel <x>,<y> to color number <col>
67 // returns 0 on success, -1 on error
68 OSD_GetPixel, // (x0,y0)
69 // returns color number of pixel <x>,<y>, or -1
70 OSD_SetRow, // (x0,y0,x1,data)
71 // fills pixels x0,y through x1,y with the content of data[]
72 // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
73 OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
74 // fills pixels x0,y0 through x1,y1 with the content of data[]
75 // inc contains the width of one line in the data block,
76 // inc<=0 uses blockwidth as linewidth
77 // returns 0 on success, -1 on clipping all pixel
78 OSD_FillRow, // (x0,y0,x1,color)
79 // fills pixels x0,y through x1,y with the color <col>
80 // returns 0 on success, -1 on clipping all pixel
81 OSD_FillBlock, // (x0,y0,x1,y1,color)
82 // fills pixels x0,y0 through x1,y1 with the color <col>
83 // returns 0 on success, -1 on clipping all pixel
84 OSD_Line, // (x0,y0,x1,y1,color)
85 // draw a line from x0,y0 to x1,y1 with the color <col>
86 // returns 0 on success
87 OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
88 // fills parameters with the picture dimensions and the pixel aspect ratio
89 // returns 0 on success
90 OSD_Test, // ()
91 // draws a test picture. for debugging purposes only
92 // returns 0 on success
93 // TODO: remove "test" in final version
94 OSD_Text, // (x0,y0,size,color,text)
95 OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
96 OSD_MoveWindow, // move current window to (x0, y0)
97 } OSD_Command;
99 typedef struct osd_cmd_s {
100 OSD_Command cmd;
101 int x0;
102 int y0;
103 int x1;
104 int y1;
105 int color;
106 void __user *data;
107 } osd_cmd_t;
110 #define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
112 #endif