OSD module,On the video stream we can superimpose pictures, bitmap,line,rectangular box.
More...
|
enum | IMPOsdColour {
OSD_BLACK = 0xff000000,
OSD_WHITE = 0xffffffff,
OSD_RED = 0xffff0000,
OSD_GREEN = 0xff00ff00,
OSD_BLUE = 0xff0000ff
} |
| OSD color type, color format is bgra. More...
|
|
enum | IMPOsdRgnType {
OSD_REG_INV = 0,
OSD_REG_LINE = 1,
OSD_REG_RECT = 2,
OSD_REG_BITMAP = 3,
OSD_REG_COVER = 4,
OSD_REG_PIC = 5
} |
| OSD region type. More...
|
|
|
int | IMP_OSD_CreateGroup (int grpNum) |
| create OSD group More...
|
|
int | IMP_OSD_DestroyGroup (int grpNum) |
| destory OSD group More...
|
|
int | IMP_OSD_AttachToGroup (IMPCell *from, IMPCell *to) |
| Adding OSD group to the system. More...
|
|
IMPRgnHandle | IMP_OSD_CreateRgn (IMPOSDRgnAttr *prAttr) |
| Create OSD region. More...
|
|
void | IMP_OSD_DestroyRgn (IMPRgnHandle handle) |
| Destory OSD region. More...
|
|
int | IMP_OSD_RegisterRgn (IMPRgnHandle handle, int grpNum, IMPOSDGrpRgnAttr *pgrAttr) |
| Register OSD region. More...
|
|
int | IMP_OSD_UnRegisterRgn (IMPRgnHandle handle, int grpNum) |
| Register OSD region. More...
|
|
int | IMP_OSD_SetRgnAttr (IMPRgnHandle handle, IMPOSDRgnAttr *prAttr) |
| Set region properties. More...
|
|
int | IMP_OSD_SetRgnAttrWithTimestamp (IMPRgnHandle handle, IMPOSDRgnAttr *prAttr, IMPOSDRgnTimestamp *prTs) |
| Set region properties and effective time. More...
|
|
int | IMP_OSD_GetRgnAttr (IMPRgnHandle handle, IMPOSDRgnAttr *prAttr) |
| Get region attribute. More...
|
|
int | IMP_OSD_UpdateRgnAttrData (IMPRgnHandle handle, IMPOSDRgnAttrData *prAttrData) |
| Update the regional data attribute, only for OSD_REG_BITMAP and OSD_REG_PIC regional types. More...
|
|
int | IMP_OSD_SetGrpRgnAttr (IMPRgnHandle handle, int grpNum, IMPOSDGrpRgnAttr *pgrAttr) |
| Set OSD group region attributes. More...
|
|
int | IMP_OSD_GetGrpRgnAttr (IMPRgnHandle handle, int grpNum, IMPOSDGrpRgnAttr *pgrAttr) |
| Get OSD group region attributes. More...
|
|
int | IMP_OSD_ShowRgn (IMPRgnHandle handle, int grpNum, int showFlag) |
| Set whether the group region is displayed or not. More...
|
|
int | IMP_OSD_Start (int grpNum) |
| Set start OSD group display. More...
|
|
int | IMP_OSD_Stop (int grpNum) |
| Set the display to stop the OSD group. More...
|
|
OSD module,On the video stream we can superimpose pictures, bitmap,line,rectangular box.
1 module introduction
The full name of OSD is On-Screen Display. The module function is to superimpose lines, pictures and other information on each source.
2 The related concepts
2.1 Region
Region is a superimposed area, in the API Rgn. each Region has a certain image information, after superimposing each OSD module, and the background image into a picture. For the image superimposition, you can also achieve the Alpha effect. For a detailed description of the various types please refer to 2.1 Region type.
2.1 Region type
There are several types of Region, respectively as:
OSD_REG_LINE:line
OSD_REG_RECT:rectangle
OSD_REG_BITMAP:bitmap
OSD_REG_COVER:cover
OSD_REG_PIC:picture
Among them, the difference between the bitmap and the picture is that the bitmap image is only a single color coverage, while the picture is a RGBA image Alpha superimposition.
3 Module function
OSD module support line, rectangular box, bitmap superimposition, rectangle cover and image superimposition. WE use software to achieve Line, rectangular box and bitmap; We use Hardware to achieve rectangle cover and image superimposition.
4 Module use
The use of OSD generally has the following steps
- create the OSD group
- bind OSD groups to the system
- create the OSD region
- register the OSD region to the OSD group
- Set the attributes of OSD group region and OSD region.
- set OSD function switch
OSD color type, color format is bgra.
Enumerator |
---|
OSD_BLACK |
black
|
OSD_WHITE |
white
|
OSD_RED |
red
|
OSD_GREEN |
green
|
OSD_BLUE |
blue
|
OSD region type.
Enumerator |
---|
OSD_REG_INV |
undefined region type
|
OSD_REG_LINE |
line
|
OSD_REG_RECT |
rectangle
|
OSD_REG_BITMAP |
dot matrix image
|
OSD_REG_COVER |
rectangle cover
|
OSD_REG_PIC |
picture, suitable for Logo or time stamp
|
Adding OSD group to the system.
- Parameters
-
[in] | from | OSD unit |
[in] | to | Other unit in the system |
- Return values
-
- Attention
- no.
int IMP_OSD_CreateGroup |
( |
int |
grpNum | ) |
|
create OSD group
- Parameters
-
[in] | grpNum | OSD group number, range: [0, NR_MAX_OSD_GROUPS - 1] |
- Return values
-
- Attention
- no.
Create OSD region.
- Parameters
-
[in] | prAttr | OSD region attribute |
- Return values
-
greater | than or equal to 0 success |
less | than 0 failure |
- Attention
- no.
int IMP_OSD_DestroyGroup |
( |
int |
grpNum | ) |
|
destory OSD group
- Parameters
-
[in] | grpNum | OSD group number, range: [0, NR_MAX_OSD_GROUPS - 1] |
- Return values
-
- Attention
- no.
Destory OSD region.
- Parameters
-
[in] | prAttr | region handle, IMP_OSD_CreateRgn return value |
- Return values
-
- Attention
- no.
Get OSD group region attributes.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | grpNum | OSD group number |
[out] | pgrAttr | OSD group region attributes |
- Return values
-
- Attention
- no.
Get region attribute.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[out] | prAttr | OSD region attribute |
- Return values
-
- Attention
- no.
Register OSD region.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | grpNum | OSD group number |
[in] | pgrAttr | OSD group display attribute |
- Return values
-
- Attention
- no.
Set OSD group region attributes.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | grpNum | OSD group number |
[in] | pgrAttr | OSD group region attributes |
- Return values
-
- Attention
- no.
Set region properties.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | prAttr | OSD region attribute |
- Return values
-
- Attention
- no.
Set region properties and effective time.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | prAttr | OSD region attribute |
[in] | prTs | effective time |
- Return values
-
- Attention
- 无。
int IMP_OSD_ShowRgn |
( |
IMPRgnHandle |
handle, |
|
|
int |
grpNum, |
|
|
int |
showFlag |
|
) |
| |
Set whether the group region is displayed or not.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | grpNum | OSD group number |
[in] | showFlag | OSD group region display switch |
- Return values
-
- Attention
- no.
int IMP_OSD_Start |
( |
int |
grpNum | ) |
|
Set start OSD group display.
- Parameters
-
[in] | grpNum | OSD group number |
- Return values
-
- Attention
- no.
int IMP_OSD_Stop |
( |
int |
grpNum | ) |
|
Set the display to stop the OSD group.
- Parameters
-
[in] | grpNum | OSD group number |
- Return values
-
- Attention
- no.
int IMP_OSD_UnRegisterRgn |
( |
IMPRgnHandle |
handle, |
|
|
int |
grpNum |
|
) |
| |
Register OSD region.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | grpNum | OSD group number |
- Return values
-
- Attention
- no.
Update the regional data attribute, only for OSD_REG_BITMAP and OSD_REG_PIC regional types.
- Parameters
-
[in] | handle | region handle, IMP_OSD_CreateRgn return value |
[in] | prAttrData | OSD regional data attributes |
- Return values
-
- Attention
- no.