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