Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
0002 /*
0003  * osd.h - DEPRECATED On Screen Display API
0004  *
0005  * NOTE: should not be used on future drivers
0006  *
0007  * Copyright (C) 2001 Ralph  Metzler <ralph@convergence.de>
0008  *                  & Marcus Metzler <marcus@convergence.de>
0009  *                    for convergence integrated media GmbH
0010  *
0011  * This program is free software; you can redistribute it and/or
0012  * modify it under the terms of the GNU General Lesser Public License
0013  * as published by the Free Software Foundation; either version 2.1
0014  * of the License, or (at your option) any later version.
0015  *
0016  * This program is distributed in the hope that it will be useful,
0017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0019  * GNU General Public License for more details.
0020  *
0021  * You should have received a copy of the GNU Lesser General Public License
0022  * along with this program; if not, write to the Free Software
0023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
0024  *
0025  */
0026 
0027 #ifndef _DVBOSD_H_
0028 #define _DVBOSD_H_
0029 
0030 #include <linux/compiler.h>
0031 
0032 typedef enum {
0033     /* All functions return -2 on "not open" */
0034     OSD_Close = 1,  /* () */
0035     /*
0036      * Disables OSD and releases the buffers
0037      * returns 0 on success
0038      */
0039     OSD_Open,   /* (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) */
0040     /*
0041      * Opens OSD with this size and bit depth
0042      * returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
0043      */
0044     OSD_Show,   /* () */
0045     /*
0046      * enables OSD mode
0047      * returns 0 on success
0048      */
0049     OSD_Hide,   /* () */
0050     /*
0051      * disables OSD mode
0052      * returns 0 on success
0053      */
0054     OSD_Clear,  /* () */
0055     /*
0056      * Sets all pixel to color 0
0057      * returns 0 on success
0058      */
0059     OSD_Fill,   /* (color) */
0060     /*
0061      * Sets all pixel to color <col>
0062      * returns 0 on success
0063      */
0064     OSD_SetColor,   /* (color,R{x0},G{y0},B{x1},opacity{y1}) */
0065     /*
0066      * set palette entry <num> to <r,g,b>, <mix> and <trans> apply
0067      * R,G,B: 0..255
0068      * R=Red, G=Green, B=Blue
0069      * opacity=0:      pixel opacity 0% (only video pixel shows)
0070      * opacity=1..254: pixel opacity as specified in header
0071      * opacity=255:    pixel opacity 100% (only OSD pixel shows)
0072      * returns 0 on success, -1 on error
0073      */
0074     OSD_SetPalette, /* (firstcolor{color},lastcolor{x0},data) */
0075     /*
0076      * Set a number of entries in the palette
0077      * sets the entries "firstcolor" through "lastcolor" from the array "data"
0078      * data has 4 byte for each color:
0079      * R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
0080      */
0081     OSD_SetTrans,   /* (transparency{color}) */
0082     /*
0083      * Sets transparency of mixed pixel (0..15)
0084      * returns 0 on success
0085      */
0086     OSD_SetPixel,   /* (x0,y0,color) */
0087     /*
0088      * sets pixel <x>,<y> to color number <col>
0089      * returns 0 on success, -1 on error
0090      */
0091     OSD_GetPixel,   /* (x0,y0) */
0092     /* returns color number of pixel <x>,<y>,  or -1 */
0093     OSD_SetRow, /* (x0,y0,x1,data) */
0094     /*
0095      * fills pixels x0,y through  x1,y with the content of data[]
0096      * returns 0 on success, -1 on clipping all pixel (no pixel drawn)
0097      */
0098     OSD_SetBlock,   /* (x0,y0,x1,y1,increment{color},data) */
0099     /*
0100      * fills pixels x0,y0 through  x1,y1 with the content of data[]
0101      * inc contains the width of one line in the data block,
0102      * inc<=0 uses blockwidth as linewidth
0103      * returns 0 on success, -1 on clipping all pixel
0104      */
0105     OSD_FillRow,    /* (x0,y0,x1,color) */
0106     /*
0107      * fills pixels x0,y through  x1,y with the color <col>
0108      * returns 0 on success, -1 on clipping all pixel
0109      */
0110     OSD_FillBlock,  /* (x0,y0,x1,y1,color) */
0111     /*
0112      * fills pixels x0,y0 through  x1,y1 with the color <col>
0113      * returns 0 on success, -1 on clipping all pixel
0114      */
0115     OSD_Line,   /* (x0,y0,x1,y1,color) */
0116     /*
0117      * draw a line from x0,y0 to x1,y1 with the color <col>
0118      * returns 0 on success
0119      */
0120     OSD_Query,  /* (x0,y0,x1,y1,xasp{color}}), yasp=11 */
0121     /*
0122      * fills parameters with the picture dimensions and the pixel aspect ratio
0123      * returns 0 on success
0124      */
0125     OSD_Test,       /* () */
0126     /*
0127      * draws a test picture. for debugging purposes only
0128      * returns 0 on success
0129      * TODO: remove "test" in final version
0130      */
0131     OSD_Text,   /* (x0,y0,size,color,text) */
0132     OSD_SetWindow,  /* (x0) set window with number 0<x0<8 as current */
0133     OSD_MoveWindow, /* move current window to (x0, y0) */
0134     OSD_OpenRaw,    /* Open other types of OSD windows */
0135 } OSD_Command;
0136 
0137 typedef struct osd_cmd_s {
0138     OSD_Command cmd;
0139     int x0;
0140     int y0;
0141     int x1;
0142     int y1;
0143     int color;
0144     void __user *data;
0145 } osd_cmd_t;
0146 
0147 /* OSD_OpenRaw: set 'color' to desired window type */
0148 typedef enum {
0149     OSD_BITMAP1,           /* 1 bit bitmap */
0150     OSD_BITMAP2,           /* 2 bit bitmap */
0151     OSD_BITMAP4,           /* 4 bit bitmap */
0152     OSD_BITMAP8,           /* 8 bit bitmap */
0153     OSD_BITMAP1HR,         /* 1 Bit bitmap half resolution */
0154     OSD_BITMAP2HR,         /* 2 bit bitmap half resolution */
0155     OSD_BITMAP4HR,         /* 4 bit bitmap half resolution */
0156     OSD_BITMAP8HR,         /* 8 bit bitmap half resolution */
0157     OSD_YCRCB422,          /* 4:2:2 YCRCB Graphic Display */
0158     OSD_YCRCB444,          /* 4:4:4 YCRCB Graphic Display */
0159     OSD_YCRCB444HR,        /* 4:4:4 YCRCB graphic half resolution */
0160     OSD_VIDEOTSIZE,        /* True Size Normal MPEG Video Display */
0161     OSD_VIDEOHSIZE,        /* MPEG Video Display Half Resolution */
0162     OSD_VIDEOQSIZE,        /* MPEG Video Display Quarter Resolution */
0163     OSD_VIDEODSIZE,        /* MPEG Video Display Double Resolution */
0164     OSD_VIDEOTHSIZE,       /* True Size MPEG Video Display Half Resolution */
0165     OSD_VIDEOTQSIZE,       /* True Size MPEG Video Display Quarter Resolution*/
0166     OSD_VIDEOTDSIZE,       /* True Size MPEG Video Display Double Resolution */
0167     OSD_VIDEONSIZE,        /* Full Size MPEG Video Display */
0168     OSD_CURSOR             /* Cursor */
0169 } osd_raw_window_t;
0170 
0171 typedef struct osd_cap_s {
0172     int  cmd;
0173 #define OSD_CAP_MEMSIZE         1  /* memory size */
0174     long val;
0175 } osd_cap_t;
0176 
0177 
0178 #define OSD_SEND_CMD            _IOW('o', 160, osd_cmd_t)
0179 #define OSD_GET_CAPABILITY      _IOR('o', 161, osd_cap_t)
0180 
0181 #endif