| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | | - * osd.h |
|---|
| 3 | + * osd.h - DEPRECATED On Screen Display API |
|---|
| 4 | + * |
|---|
| 5 | + * NOTE: should not be used on future drivers |
|---|
| 4 | 6 | * |
|---|
| 5 | 7 | * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de> |
|---|
| 6 | 8 | * & Marcus Metzler <marcus@convergence.de> |
|---|
| .. | .. |
|---|
| 28 | 30 | #include <linux/compiler.h> |
|---|
| 29 | 31 | |
|---|
| 30 | 32 | typedef enum { |
|---|
| 31 | | - // All functions return -2 on "not open" |
|---|
| 32 | | - OSD_Close=1, // () |
|---|
| 33 | | - // Disables OSD and releases the buffers |
|---|
| 34 | | - // returns 0 on success |
|---|
| 35 | | - OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) |
|---|
| 36 | | - // Opens OSD with this size and bit depth |
|---|
| 37 | | - // returns 0 on success, -1 on DRAM allocation error, -2 on "already open" |
|---|
| 38 | | - OSD_Show, // () |
|---|
| 39 | | - // enables OSD mode |
|---|
| 40 | | - // returns 0 on success |
|---|
| 41 | | - OSD_Hide, // () |
|---|
| 42 | | - // disables OSD mode |
|---|
| 43 | | - // returns 0 on success |
|---|
| 44 | | - OSD_Clear, // () |
|---|
| 45 | | - // Sets all pixel to color 0 |
|---|
| 46 | | - // returns 0 on success |
|---|
| 47 | | - OSD_Fill, // (color) |
|---|
| 48 | | - // Sets all pixel to color <col> |
|---|
| 49 | | - // returns 0 on success |
|---|
| 50 | | - OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1}) |
|---|
| 51 | | - // set palette entry <num> to <r,g,b>, <mix> and <trans> apply |
|---|
| 52 | | - // R,G,B: 0..255 |
|---|
| 53 | | - // R=Red, G=Green, B=Blue |
|---|
| 54 | | - // opacity=0: pixel opacity 0% (only video pixel shows) |
|---|
| 55 | | - // opacity=1..254: pixel opacity as specified in header |
|---|
| 56 | | - // opacity=255: pixel opacity 100% (only OSD pixel shows) |
|---|
| 57 | | - // returns 0 on success, -1 on error |
|---|
| 58 | | - OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data) |
|---|
| 59 | | - // Set a number of entries in the palette |
|---|
| 60 | | - // sets the entries "firstcolor" through "lastcolor" from the array "data" |
|---|
| 61 | | - // data has 4 byte for each color: |
|---|
| 62 | | - // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel |
|---|
| 63 | | - OSD_SetTrans, // (transparency{color}) |
|---|
| 64 | | - // Sets transparency of mixed pixel (0..15) |
|---|
| 65 | | - // returns 0 on success |
|---|
| 66 | | - OSD_SetPixel, // (x0,y0,color) |
|---|
| 67 | | - // sets pixel <x>,<y> to color number <col> |
|---|
| 68 | | - // returns 0 on success, -1 on error |
|---|
| 69 | | - OSD_GetPixel, // (x0,y0) |
|---|
| 70 | | - // returns color number of pixel <x>,<y>, or -1 |
|---|
| 71 | | - OSD_SetRow, // (x0,y0,x1,data) |
|---|
| 72 | | - // fills pixels x0,y through x1,y with the content of data[] |
|---|
| 73 | | - // returns 0 on success, -1 on clipping all pixel (no pixel drawn) |
|---|
| 74 | | - OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data) |
|---|
| 75 | | - // fills pixels x0,y0 through x1,y1 with the content of data[] |
|---|
| 76 | | - // inc contains the width of one line in the data block, |
|---|
| 77 | | - // inc<=0 uses blockwidth as linewidth |
|---|
| 78 | | - // returns 0 on success, -1 on clipping all pixel |
|---|
| 79 | | - OSD_FillRow, // (x0,y0,x1,color) |
|---|
| 80 | | - // fills pixels x0,y through x1,y with the color <col> |
|---|
| 81 | | - // returns 0 on success, -1 on clipping all pixel |
|---|
| 82 | | - OSD_FillBlock, // (x0,y0,x1,y1,color) |
|---|
| 83 | | - // fills pixels x0,y0 through x1,y1 with the color <col> |
|---|
| 84 | | - // returns 0 on success, -1 on clipping all pixel |
|---|
| 85 | | - OSD_Line, // (x0,y0,x1,y1,color) |
|---|
| 86 | | - // draw a line from x0,y0 to x1,y1 with the color <col> |
|---|
| 87 | | - // returns 0 on success |
|---|
| 88 | | - OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11 |
|---|
| 89 | | - // fills parameters with the picture dimensions and the pixel aspect ratio |
|---|
| 90 | | - // returns 0 on success |
|---|
| 91 | | - OSD_Test, // () |
|---|
| 92 | | - // draws a test picture. for debugging purposes only |
|---|
| 93 | | - // returns 0 on success |
|---|
| 94 | | -// TODO: remove "test" in final version |
|---|
| 95 | | - OSD_Text, // (x0,y0,size,color,text) |
|---|
| 96 | | - OSD_SetWindow, // (x0) set window with number 0<x0<8 as current |
|---|
| 97 | | - OSD_MoveWindow, // move current window to (x0, y0) |
|---|
| 98 | | - OSD_OpenRaw, // Open other types of OSD windows |
|---|
| 33 | + /* All functions return -2 on "not open" */ |
|---|
| 34 | + OSD_Close = 1, /* () */ |
|---|
| 35 | + /* |
|---|
| 36 | + * Disables OSD and releases the buffers |
|---|
| 37 | + * returns 0 on success |
|---|
| 38 | + */ |
|---|
| 39 | + OSD_Open, /* (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) */ |
|---|
| 40 | + /* |
|---|
| 41 | + * Opens OSD with this size and bit depth |
|---|
| 42 | + * returns 0 on success, -1 on DRAM allocation error, -2 on "already open" |
|---|
| 43 | + */ |
|---|
| 44 | + OSD_Show, /* () */ |
|---|
| 45 | + /* |
|---|
| 46 | + * enables OSD mode |
|---|
| 47 | + * returns 0 on success |
|---|
| 48 | + */ |
|---|
| 49 | + OSD_Hide, /* () */ |
|---|
| 50 | + /* |
|---|
| 51 | + * disables OSD mode |
|---|
| 52 | + * returns 0 on success |
|---|
| 53 | + */ |
|---|
| 54 | + OSD_Clear, /* () */ |
|---|
| 55 | + /* |
|---|
| 56 | + * Sets all pixel to color 0 |
|---|
| 57 | + * returns 0 on success |
|---|
| 58 | + */ |
|---|
| 59 | + OSD_Fill, /* (color) */ |
|---|
| 60 | + /* |
|---|
| 61 | + * Sets all pixel to color <col> |
|---|
| 62 | + * returns 0 on success |
|---|
| 63 | + */ |
|---|
| 64 | + OSD_SetColor, /* (color,R{x0},G{y0},B{x1},opacity{y1}) */ |
|---|
| 65 | + /* |
|---|
| 66 | + * set palette entry <num> to <r,g,b>, <mix> and <trans> apply |
|---|
| 67 | + * R,G,B: 0..255 |
|---|
| 68 | + * R=Red, G=Green, B=Blue |
|---|
| 69 | + * opacity=0: pixel opacity 0% (only video pixel shows) |
|---|
| 70 | + * opacity=1..254: pixel opacity as specified in header |
|---|
| 71 | + * opacity=255: pixel opacity 100% (only OSD pixel shows) |
|---|
| 72 | + * returns 0 on success, -1 on error |
|---|
| 73 | + */ |
|---|
| 74 | + OSD_SetPalette, /* (firstcolor{color},lastcolor{x0},data) */ |
|---|
| 75 | + /* |
|---|
| 76 | + * Set a number of entries in the palette |
|---|
| 77 | + * sets the entries "firstcolor" through "lastcolor" from the array "data" |
|---|
| 78 | + * data has 4 byte for each color: |
|---|
| 79 | + * R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel |
|---|
| 80 | + */ |
|---|
| 81 | + OSD_SetTrans, /* (transparency{color}) */ |
|---|
| 82 | + /* |
|---|
| 83 | + * Sets transparency of mixed pixel (0..15) |
|---|
| 84 | + * returns 0 on success |
|---|
| 85 | + */ |
|---|
| 86 | + OSD_SetPixel, /* (x0,y0,color) */ |
|---|
| 87 | + /* |
|---|
| 88 | + * sets pixel <x>,<y> to color number <col> |
|---|
| 89 | + * returns 0 on success, -1 on error |
|---|
| 90 | + */ |
|---|
| 91 | + OSD_GetPixel, /* (x0,y0) */ |
|---|
| 92 | + /* returns color number of pixel <x>,<y>, or -1 */ |
|---|
| 93 | + OSD_SetRow, /* (x0,y0,x1,data) */ |
|---|
| 94 | + /* |
|---|
| 95 | + * fills pixels x0,y through x1,y with the content of data[] |
|---|
| 96 | + * returns 0 on success, -1 on clipping all pixel (no pixel drawn) |
|---|
| 97 | + */ |
|---|
| 98 | + OSD_SetBlock, /* (x0,y0,x1,y1,increment{color},data) */ |
|---|
| 99 | + /* |
|---|
| 100 | + * fills pixels x0,y0 through x1,y1 with the content of data[] |
|---|
| 101 | + * inc contains the width of one line in the data block, |
|---|
| 102 | + * inc<=0 uses blockwidth as linewidth |
|---|
| 103 | + * returns 0 on success, -1 on clipping all pixel |
|---|
| 104 | + */ |
|---|
| 105 | + OSD_FillRow, /* (x0,y0,x1,color) */ |
|---|
| 106 | + /* |
|---|
| 107 | + * fills pixels x0,y through x1,y with the color <col> |
|---|
| 108 | + * returns 0 on success, -1 on clipping all pixel |
|---|
| 109 | + */ |
|---|
| 110 | + OSD_FillBlock, /* (x0,y0,x1,y1,color) */ |
|---|
| 111 | + /* |
|---|
| 112 | + * fills pixels x0,y0 through x1,y1 with the color <col> |
|---|
| 113 | + * returns 0 on success, -1 on clipping all pixel |
|---|
| 114 | + */ |
|---|
| 115 | + OSD_Line, /* (x0,y0,x1,y1,color) */ |
|---|
| 116 | + /* |
|---|
| 117 | + * draw a line from x0,y0 to x1,y1 with the color <col> |
|---|
| 118 | + * returns 0 on success |
|---|
| 119 | + */ |
|---|
| 120 | + OSD_Query, /* (x0,y0,x1,y1,xasp{color}}), yasp=11 */ |
|---|
| 121 | + /* |
|---|
| 122 | + * fills parameters with the picture dimensions and the pixel aspect ratio |
|---|
| 123 | + * returns 0 on success |
|---|
| 124 | + */ |
|---|
| 125 | + OSD_Test, /* () */ |
|---|
| 126 | + /* |
|---|
| 127 | + * draws a test picture. for debugging purposes only |
|---|
| 128 | + * returns 0 on success |
|---|
| 129 | + * TODO: remove "test" in final version |
|---|
| 130 | + */ |
|---|
| 131 | + OSD_Text, /* (x0,y0,size,color,text) */ |
|---|
| 132 | + OSD_SetWindow, /* (x0) set window with number 0<x0<8 as current */ |
|---|
| 133 | + OSD_MoveWindow, /* move current window to (x0, y0) */ |
|---|
| 134 | + OSD_OpenRaw, /* Open other types of OSD windows */ |
|---|
| 99 | 135 | } OSD_Command; |
|---|
| 100 | 136 | |
|---|
| 101 | 137 | typedef struct osd_cmd_s { |
|---|