WO2011035568A1 - Method, apparatus and set-top-box for realizing semitransparent effect on video layer for image layer - Google Patents

Method, apparatus and set-top-box for realizing semitransparent effect on video layer for image layer Download PDF

Info

Publication number
WO2011035568A1
WO2011035568A1 PCT/CN2010/071183 CN2010071183W WO2011035568A1 WO 2011035568 A1 WO2011035568 A1 WO 2011035568A1 CN 2010071183 W CN2010071183 W CN 2010071183W WO 2011035568 A1 WO2011035568 A1 WO 2011035568A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
sub
image
displayed
unit
Prior art date
Application number
PCT/CN2010/071183
Other languages
French (fr)
Chinese (zh)
Inventor
江峰
Original Assignee
深圳市同洲电子股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市同洲电子股份有限公司 filed Critical 深圳市同洲电子股份有限公司
Publication of WO2011035568A1 publication Critical patent/WO2011035568A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/272Means for inserting a foreground image in a background image, i.e. inlay, outlay

Definitions

  • the present invention relates to the field of graphics, and in particular, to a method, apparatus and set top box for realizing translucency of an image layer on a video layer.
  • the RGB three primary color values are generally used to define the color of each pixel, and the alpha channel value is added to represent the brightness ratio of the pixel.
  • the pixel point can be presented. Transparency changes.
  • the value of the above Alpha channel is between 0 and 1, 0 is completely transparent, 1 is completely opaque, and the value between 0 and 1 represents different degrees of transparency. For example, if the transparency is 5, 0 means completely transparent. 0.2 represents 20% transparency, 0.4 represents 40% transparency, and so on.
  • the source data is usually read and the read source data is written into a piece of video memory, and the display device driver reads from the display memory and refreshes to the screen at intervals, and then displays the source data representative. image.
  • the color mode of the memory is generally determined by the chip. On a 16-bit chip, 16 bits are used to define the color of one pixel, which can represent 2 16 colors.
  • the commonly used 16-bit color mode is ARGB1555, that is, the RGB three primary colors each occupy 5 bits, and the alpha channel value occupies 1 bit.
  • the color mode determines the final display of the image. In AGB1555 mode, because the alpha channel value can only be represented by one bit, a pixel can only be displayed as completely transparent or completely opaque.
  • the images viewed by the user on the screen of the TV terminal are based on the principle described above, and are set in the set top box.
  • the display device driver reads the target data from the video memory and refreshes it onto the screen of the television terminal.
  • the color mode of the memory is also determined by the chip in the set top box.
  • low-end set-top boxes use 16-bit chips and ARGB1555 color mode to save memory and reduce computational load.
  • the image viewed by the user on the screen of the television terminal belongs to the image layer, and the content of the television program viewed belongs to the video layer.
  • the image of the image layer is completely opaque,
  • the video layer in the presence area is completely obscured, or completely transparent, that is, the user cannot see the image layer image on the screen, that is, the image layer in the set top box cannot be rendered translucent on the video layer.
  • the present invention provides a method for realizing a translucent effect of an image layer on a video layer.
  • the method can be used to render a translucent effect on the video layer based on the chip of the existing set top box and its color mode.
  • the present invention provides an apparatus for effecting a translucent effect of an image layer on a video layer, which can be used to render a translucent effect over the video layer based on the chip of the existing set top box and its color mode.
  • the present invention provides a set top box comprising the above-described apparatus for effecting translucent effects of an image layer on a video layer, the set top box being capable of rendering a translucent effect over the video layer based on the existing chip and its color mode.
  • a method for implementing a semi-transparent effect of an image layer on a video layer comprising: acquiring source data corresponding to each pixel in the image to be displayed of the image layer;
  • the source data of the corresponding pixel is filled in the preset position in each sub-area, and the other position except the preset position is filled with 0;
  • the data in the filled matrix is output to the display memory for display.
  • An apparatus for implementing a semi-transparent effect of an image layer on a video layer comprising: a data source management module, configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer;
  • a first transparent processing module configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; dividing the matrix into two or more sub-regions; a processing module for each of the matrices established for the first translucent processing module The area, the preset location in the sub-area fills the source data of the corresponding pixel obtained by the data source management module, and the other locations except the preset location are filled with 0;
  • the display driver module is configured to output data in the matrix filled by the second translucent processing module to the display memory for display.
  • a set top box comprising the above apparatus for effecting a translucent effect of an image layer on a video layer, the apparatus comprising:
  • a data source management module configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer
  • a first transparent processing module configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; dividing the matrix into two or more sub-regions; a processing module, configured to fill, for each sub-region of the matrix established by the first translucent processing module, the source data of the corresponding pixel obtained by the data source management module, and other locations than the preset location in the preset position in the sub-region Filled with 0;
  • the display driver module is configured to output data in the matrix filled by the second translucent processing module to the display memory for display.
  • the obtained source data is not directly output to the display memory for display, but is converted, that is, the matrix corresponding to the image to be processed is first established, and the matrix is Divided into more than two sub-areas, secondly, part of each sub-area fills the source data of the corresponding pixel, and another part of the position is filled with 0, and then the filled matrix is output to the display memory for display, where the position of the source data is filled It will eventually appear as a completely opaque image, and the position filled with 0 will eventually appear as a completely transparent image, so that the image of the image layer will appear completely opaque and completely transparent over the video layer, thus making it overall.
  • the effect of translucent is formed, so the method of the present invention simulates the translucent effect of the image layer on the video layer.
  • the simulation is completely based on the chip and color mode of the existing set top box, and does not require additional hardware support for the source data.
  • the conversion is also simpler, which has less impact on the performance of the set-top box.
  • FIG. 1 is a flowchart of a method for implementing a semi-transparent effect of an image layer on a video layer according to the present invention
  • FIG. 2 is a flowchart of a method for dividing a sub-area in the flow shown in FIG. 3 is a flow chart of a method for filling source data in each sub-area in the flow shown in FIG. 1.
  • FIG. 4 is a schematic structural diagram of an apparatus for implementing a translucent effect of an image layer on a video layer according to the present invention. detailed description
  • FIG. 1 is a flowchart of a method for implementing a translucent effect of an image layer on a video layer according to the present invention, the process including:
  • Step 101 Acquire source data corresponding to each pixel in the image layer to be displayed.
  • Step 102 Establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed.
  • Step 103 Divide the matrix into two or more sub-regions.
  • Step 104 Fill a part of each sub-area with source data of the corresponding pixel and another part of the position with 0.
  • Step 105 Output the data in the filled matrix to the display memory for display.
  • the method provided by the present invention does not directly output the acquired source data to the display memory for display, but performs conversion processing, that is, first establishes a matrix corresponding to the image to be processed, and The matrix is divided into two or more sub-regions, and then a part of each sub-region is filled with source data of the corresponding pixel, and another portion is filled with 0, and then the filled matrix is output to the display memory for display, wherein the padding is source data.
  • the position will eventually appear as a completely opaque image, and the position filled with 0 will eventually appear as a completely transparent image, so that the image of the image layer will appear completely opaque and completely transparent over the video layer.
  • the method of the present invention simulates the effect of the image layer being translucent over the video layer.
  • the simulation is based entirely on the chip and color mode of the existing set top box, and does not require additional hardware support.
  • the conversion of source data is also simpler, which has less impact on the performance of the set-top box.
  • step 101 shown in FIG. 1 after receiving the display instruction input by the user, the graphics engine is used to place the source data corresponding to each pixel in the image to be displayed in the cache to form a The data set, the source data in the data set conforms to the color mode ARGB1555 of the chip in the set top box.
  • the graphics engine As for how to use the graphics engine to put the source data into the cache, it is common knowledge in the art, and will not be described here.
  • each position in the established matrix includes 4 data bits conforming to the color mode ARGB1555, of which 3 bits are used to fill the RGB three primary colors and 1 bit is used to fill the alpha channel values.
  • step 103 shown in FIG. 1 can be implemented by the process shown in FIG. 2, and the process includes:
  • Step 201 Obtain the number of bits n of the preset alpha channel value.
  • Step 202 Determine whether the established matrix can be divided into an integer number of identical sub-areas, if yes, execute step 204, otherwise perform step 203.
  • the width and height of the image to be displayed are the width and height of the matrix, and the image to be displayed can be obtained by the application. Wide and high values.
  • the width of the established matrix is w and the height is h.
  • each sub-area is a square with a width and a height of 2" /2 , so that it is only necessary to judge whether the established matrix is judged during judgment.
  • Step 203 Add a position in the matrix to be divided into an integer number of identical sub-areas; and perform step 204.
  • the matrix established for the image to be processed cannot be divided into an integer number of sub-regions. For example, if each sub-region is a square of 4 ⁇ 4 and the established matrix is a matrix of 16 ⁇ 19, the position in the matrix needs to be increased first, for example, forming a 16 ⁇ 20
  • the matrix can guarantee that the matrix can divide an integer number of 4x4 squares.
  • Step 204 Set the width and height of each sub-area to be 2" /2 .
  • the established matrix can be divided into two or more sub-regions. 4.
  • the step 104 shown in FIG. 1 can be implemented by the process shown in FIG. 3, where the process includes:
  • Step 301 Obtain the transparency value set by the user, a, and take [0, 1].
  • the transparency value a includes: a global transparency value al and a local transparency value a2.
  • the global transparency value a1 is for the overall transparency effect of the image to be displayed. Taking the number of bits n of the supported alpha channel value as 2, the global transparency a can be taken as 0, 0.25, 0.5, 0.75 or 1; the local transparency value a2 For the transparent effect of the local area specified in the graphic to be displayed set by the user, taking the number of bits n of the alpha channel value as 2, the local transparency value a2 may also be taken as 0, 0.25, 0.5, 0.75 or 1.
  • the user may set the local area in the image to be displayed and specify the transparency effect of the local area to be different from the overall transparency effect of the image to be displayed, thereby giving the user a different experience, but in some applications, , you can also have only global transparency values.
  • Step 302 Convert the obtained transparency value, and the converted value is identified by A.
  • a in the formula takes the global transparency value al and The product of the local transparency value a2, that is, the two values are superimposed.
  • a in the formula takes global transparency. The value is al.
  • Determining whether a divided sub-area contains a user-specified local area may first obtain an initial coordinate value of the image to be processed and the local area on the screen by the application, and a value of the width and height of the local area, due to the established The position in the matrix corresponds to the pixel point in the image to be processed, so that the obtained starting coordinate value can be used to determine where the local region starts in the matrix, and how much the size is, thereby determining the local region distribution. In which sub-areas.
  • the value obtained according to the above formula may not necessarily be an integer.
  • the method of rounding is approximated to an integer.
  • Step 303 Number each location in each sub-area in a predetermined order.
  • the predetermined order is: the position of the upper left corner in each sub-area is taken as the starting position.
  • Step 304 When the position in the matrix is not added in the process of dividing the sub-area, for each sub-area, the source data of the corresponding pixel is filled in the positions before the numbers A and A, and the position 0 after the number A is filled with 0; When the position in the matrix is added in the process of dividing the sub-area, for each sub-area, the source data of the corresponding pixel is filled in the positions before the number A and A, and does not belong to the increased position, after the number A, and belongs to the increased position. Filled with 0.
  • the added part does not belong to the image to be displayed in the image layer, but is additionally added for the convenience of dividing the sub-area, and this part cannot be finally displayed in the end.
  • the screen therefore, when filling the position in each sub-area, if it encounters the increased position, it needs to be filled with 0, in order to completely increase the part of the final display when it is completely transparent, so that no additional part is seen.
  • the filling of data in each sub-area is completed by the above steps 301 to 304.
  • the sub-area does not include the added position in the matrix, and does not include the user-specified area»0 area.
  • the number of bits of the alpha channel value is n
  • the global transparency value is 0.5
  • Table 1 The positions numbered 1 to 8 are filled with the corresponding source data, and the positions numbered 9 to 16 are respectively filled with 0, and the filled sub-region is as shown in Table 3.
  • step 105 shown in Figure 1 the display device driver invokes the drive interface of the set top box platform, writes the filled data to the specified memory address, and then performs the display in a conventional manner.
  • FIG. 5 is a schematic structural diagram of an apparatus for implementing a translucent effect of an image layer on a video layer, the apparatus comprising: a data source management module 410, a first translucent processing module 420, a second translucent processing module 430, and a display driving module 440.
  • the data source management module 410 is configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer.
  • the first translucent processing module 420 is configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; and divide the matrix into two or more sub-regions.
  • the second semi-transparent processing module 430 is configured to fill, for each sub-region of the matrix established by the first translucent processing module 420, the source data of the corresponding pixel obtained by the data source management module 410 in a part of the sub-region, and another Part of the location is filled with 0.
  • the display driving module 440 is configured to output the data in the matrix filled by the second translucent processing module 430 to the display memory for display.
  • the first translucent processing module 420 includes: a matrix establishing unit 4201, a first obtaining unit 4202, and a determining unit 4203.
  • the first obtaining unit 4202 is configured to acquire the number of bits n of the preset alpha channel value.
  • the matrix establishing unit 4201 is configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; and when the output of the determining unit 4203 is YES As a result, two or more sub-regions each having a width and a height of 2" /2 are divided in the matrix.
  • the judgment unit 4203 outputs a judgment result of No, the position in the matrix is first increased so that it can be set [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and then divide the matrix after the position is increased by two or more sub-regions whose width and height are both 2" /2 .
  • the determining unit 4203 is configured to determine whether the matrix established by the matrix establishing unit 4201 can be divided into [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and output the determination result to the matrix establishing unit 4201 .
  • the second translucent processing module 430 includes: a second obtaining unit 4301, a converting unit 4302, a numbering unit 4303, and a filling unit 4304.
  • the second obtaining unit 4301 is configured to obtain a transparency value a, a of the user setting, and [0, 1].
  • the above numbering unit 4303 is for a position number in each sub-area divided by the matrix establishing unit 4201 in a predetermined order.
  • the filling unit 4304 is configured to: when the first translucent processing module 420 does not increase the position in the matrix, fill each source region divided by the matrix establishing unit 4201, and fill the source data of the corresponding pixel point at positions before the numbers ⁇ and ⁇ Filling the position after the number A; when the first translucent processing module 420 increases the position in the matrix, each sub-area divided for the matrix establishing unit 4201, before the numbers A and A, does not belong to the addition The position fills the source data of the corresponding pixel, and is padded after the number A and the position belonging to the increment.
  • the present invention also provides a set top box including the above device for realizing a translucent effect of an image layer on a video layer, so that the set top box can render a translucent image layer on top of the video layer based on the existing chip and its color mode.
  • the specific structure of the device is the same as that described above, and will not be described again here.

Abstract

A method, apparatus and set-top-box for realizing semitransparent effect on the video layer for the image layer are provided. The method includes: acquiring a source data corresponding to every pixel point of the image to be displayed of the image layer; creating a matrix for the image to be displayed wherein the matrix includes a one to one correspondence position of the pixel points of the image to be displayed; partitioning the matrix into more than two subregions; filling the source data of corresponding pixel points in the preset positions of every subregion, and filling 0 in the other positions except for the preset positions; outputting the data of the filled matrix to the display memory for displaying.

Description

实现图像层在视频层上半透明效果的方法、 装置和机顶盒 本申请要求于 2009 年 9 月 24 日提交中国专利局、 申请号为 200910175617.6、 发明名称为"实现图像层在视频层上半透明效果的方法、 装 置和机顶盒"的中国专利申请的优先权,其全部内容通过引用结合在本申请中。 技术领域  Method, device and set top box for realizing translucent effect of image layer on video layer The application is submitted to Chinese Patent Office on September 24, 2009, application number is 200910175617.6, and the invention name is "implementing image layer on translucent effect on video layer" The priority of the method, device and set top box of the Chinese patent application is hereby incorporated by reference in its entirety. Technical field
本发明涉及图形学领域,特别涉及一种实现图像层在视频层上半透明效果 的方法、 装置和机顶盒。  The present invention relates to the field of graphics, and in particular, to a method, apparatus and set top box for realizing translucency of an image layer on a video layer.
背景技术 Background technique
在计算机图形学领域中,一般采用 RGB三原色值定义每个像素点的颜色, 同时加入 Alpha通道值来表示像素点所占的亮度比例, 当像素点的亮度比例不 同时, 可以呈现出像素点的透明度变化。 上述 Alpha通道值的取值在 0至 1之 间, 0代表完全透明, 1代表完全不透明, 0~1之间的数值代表不同的透明程 度, 例如假设透明度为 5级, 则 0代表完全透明, 0.2代表 20%透明, 0.4代表 40%透明, 以此类推。  In the field of computer graphics, the RGB three primary color values are generally used to define the color of each pixel, and the alpha channel value is added to represent the brightness ratio of the pixel. When the brightness ratio of the pixel is different, the pixel point can be presented. Transparency changes. The value of the above Alpha channel is between 0 and 1, 0 is completely transparent, 1 is completely opaque, and the value between 0 and 1 represents different degrees of transparency. For example, if the transparency is 5, 0 means completely transparent. 0.2 represents 20% transparency, 0.4 represents 40% transparency, and so on.
在计算机图形显示中,通常读取源数据、并将读取的源数据写入一块显存, 显示设备驱动每隔一段时间从该显存上读取并刷新到屏幕上,即可显示源数据 代表的图像。 显存的颜色模式一般由芯片决定, 在 16位芯片上, 使用 16比特 定义一个像素点的颜色, 可以表示 216种颜色。 常用的 16 位颜色模式为 ARGB1555 , 即 RGB三原色各占 5位, Alpha通道值占 1位。 颜色模式决定了 图像的最终显示效果, 在 AGB1555模式下, 因为 Alpha通道值只能用一位来 表示, 因此一个像素点显示出来只可能是完全透明或完全不透明。 In the computer graphic display, the source data is usually read and the read source data is written into a piece of video memory, and the display device driver reads from the display memory and refreshes to the screen at intervals, and then displays the source data representative. image. The color mode of the memory is generally determined by the chip. On a 16-bit chip, 16 bits are used to define the color of one pixel, which can represent 2 16 colors. The commonly used 16-bit color mode is ARGB1555, that is, the RGB three primary colors each occupy 5 bits, and the alpha channel value occupies 1 bit. The color mode determines the final display of the image. In AGB1555 mode, because the alpha channel value can only be represented by one bit, a pixel can only be displayed as completely transparent or completely opaque.
目前,越来越多的用户通过机顶盒收看数字电视节目, 用户在电视终端屏 幕上观看到的图像(例如使用遥控器调出的设置菜单界面 ), 就是根据上文所 述的原理, 由机顶盒中的显示设备驱动从显存中读取目标数据、刷新到电视终 端屏幕上,显存的颜色模式也由机顶盒中的芯片决定。 而目前低端机顶盒为节 省内存和降低计算量, 大部分使用 16位芯片及 ARGB1555颜色模式。 用户在 电视终端屏幕上观看到的图像属于图像层, 而收看的电视节目内容属于视频 层, 基于机顶盒的芯片及其颜色模式, 图像层的图像要么完全不透明, 即将自 身出现区域的视频层完全遮住,要么完全透明, 即用户在屏幕上看不见图像层 的图像,也就是说机顶盒中的图像层不能在视频层上呈现半透明效果。现有技 术中还不存在解决上述问题的技术方案。 At present, more and more users watch digital TV programs through the set-top box, and the images viewed by the user on the screen of the TV terminal (for example, the setting menu interface called by the remote controller) are based on the principle described above, and are set in the set top box. The display device driver reads the target data from the video memory and refreshes it onto the screen of the television terminal. The color mode of the memory is also determined by the chip in the set top box. At present, low-end set-top boxes use 16-bit chips and ARGB1555 color mode to save memory and reduce computational load. The image viewed by the user on the screen of the television terminal belongs to the image layer, and the content of the television program viewed belongs to the video layer. Based on the chip of the set top box and its color mode, the image of the image layer is completely opaque, The video layer in the presence area is completely obscured, or completely transparent, that is, the user cannot see the image layer image on the screen, that is, the image layer in the set top box cannot be rendered translucent on the video layer. There is no technical solution to solve the above problems in the prior art.
发明内容 Summary of the invention
本发明提供一种实现图像层在视频层上半透明效果的方法,使用该方法能 够基于现有机顶盒的芯片及其颜色模式,模拟图像层在视频层之上呈现半透明 效果。  The present invention provides a method for realizing a translucent effect of an image layer on a video layer. The method can be used to render a translucent effect on the video layer based on the chip of the existing set top box and its color mode.
本发明提供一种实现图像层在视频层上半透明效果的装置,使用该装置能 够基于现有机顶盒的芯片及其颜色模式,模拟图像层在视频层之上呈现半透明 效果。  The present invention provides an apparatus for effecting a translucent effect of an image layer on a video layer, which can be used to render a translucent effect over the video layer based on the chip of the existing set top box and its color mode.
本发明提供一种包括上述实现图像层在视频层上半透明效果的装置的机 顶盒, 该机顶盒能够基于现有芯片及其颜色模式,模拟图像层在视频层之上呈 现半透明效果。  The present invention provides a set top box comprising the above-described apparatus for effecting translucent effects of an image layer on a video layer, the set top box being capable of rendering a translucent effect over the video layer based on the existing chip and its color mode.
本发明的技术方案是这样实现的:  The technical solution of the present invention is implemented as follows:
一种实现图像层在视频层上半透明效果的方法, 关键在于, 该方法包括: 获取图像层的待显示图像中每个像素点对应的源数据;  A method for implementing a semi-transparent effect of an image layer on a video layer, the method comprising: acquiring source data corresponding to each pixel in the image to be displayed of the image layer;
针对待显示图像建立矩阵,该矩阵中包括与待显示图像中的像素点——对 应的位置;  Forming a matrix for the image to be displayed, the matrix including the pixel points in the image to be displayed - the corresponding position;
将所述矩阵划分为两个以上子区域;  Dividing the matrix into two or more sub-regions;
在每个子区域中的预设位置填充对应像素点的源数据、预设位置之外的其 他位置填充 0;  The source data of the corresponding pixel is filled in the preset position in each sub-area, and the other position except the preset position is filled with 0;
将填充后的矩阵中的数据输出到显存进行显示。  The data in the filled matrix is output to the display memory for display.
一种实现图像层在视频层上半透明效果的装置, 关键在于, 该装置包括: 数据源管理模块,用于获取图像层的待显示图像中每个像素点对应的源数 据;  An apparatus for implementing a semi-transparent effect of an image layer on a video layer, the device comprising: a data source management module, configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer;
第一半透明处理模块, 用于针对待显示图像建立矩阵, 该矩阵中包括与待 显示图像中的像素点——对应的位置; 将所述矩阵划分为两个以上子区域; 第二半透明处理模块,用于针对第一半透明处理模块建立的矩阵的每个子 区域, 在子区域中的预设位置填充数据源管理模块获取的对应像素点的源数 据、 预设位置之外的其他位置填充 0; a first transparent processing module, configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; dividing the matrix into two or more sub-regions; a processing module for each of the matrices established for the first translucent processing module The area, the preset location in the sub-area fills the source data of the corresponding pixel obtained by the data source management module, and the other locations except the preset location are filled with 0;
显示驱动模块,用于将第二半透明处理模块填充后的矩阵中的数据输出到 显存进行显示。  The display driver module is configured to output data in the matrix filled by the second translucent processing module to the display memory for display.
一种包括上述实现图像层在视频层上半透明效果的装置的机顶盒,所述装 置包括:  A set top box comprising the above apparatus for effecting a translucent effect of an image layer on a video layer, the apparatus comprising:
数据源管理模块,用于获取图像层的待显示图像中每个像素点对应的源数 据;  a data source management module, configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer;
第一半透明处理模块, 用于针对待显示图像建立矩阵, 该矩阵中包括与待 显示图像中的像素点——对应的位置; 将所述矩阵划分为两个以上子区域; 第二半透明处理模块,用于针对第一半透明处理模块建立的矩阵的每个子 区域, 在子区域中的预设位置填充数据源管理模块获取的对应像素点的源数 据、 预设位置之外的其他位置填充 0;  a first transparent processing module, configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; dividing the matrix into two or more sub-regions; a processing module, configured to fill, for each sub-region of the matrix established by the first translucent processing module, the source data of the corresponding pixel obtained by the data source management module, and other locations than the preset location in the preset position in the sub-region Filled with 0;
显示驱动模块,用于将第二半透明处理模块填充后的矩阵中的数据输出到 显存进行显示。  The display driver module is configured to output data in the matrix filled by the second translucent processing module to the display memory for display.
可见, 本发明提供的方法及、 装置和机顶盒中, 并不是直接将获取的源数 据输出到显存进行显示、 而是进行了转换处理, 即首先建立与待处理图像对应 的矩阵、并将该矩阵划分为两个以上子区域, 其次在每个子区域中的一部分填 充对应像素点的源数据、 另一部分位置填充 0, 然后将填充后的矩阵输出到显 存进行显示, 其中填充为源数据的位置将最终显示为完全不透明的图像, 而填 充为 0的位置将最终显示为完全透明的图像,这样图像层的图像在视频层之上 将呈现出完全不透明和完全透明区域间隔排列的情况,从而在整体上形成半透 明的效果, 因此本发明的方法模拟了图像层在视频层之上半透明的效果, 该模 拟完全基于现有机顶盒的芯片及颜色模式, 不需要额外的硬件支持,对源数据 的转换也较筒单, 对机顶盒的性能影响较小。  It can be seen that, in the method, the device and the set top box provided by the present invention, the obtained source data is not directly output to the display memory for display, but is converted, that is, the matrix corresponding to the image to be processed is first established, and the matrix is Divided into more than two sub-areas, secondly, part of each sub-area fills the source data of the corresponding pixel, and another part of the position is filled with 0, and then the filled matrix is output to the display memory for display, where the position of the source data is filled It will eventually appear as a completely opaque image, and the position filled with 0 will eventually appear as a completely transparent image, so that the image of the image layer will appear completely opaque and completely transparent over the video layer, thus making it overall. The effect of translucent is formed, so the method of the present invention simulates the translucent effect of the image layer on the video layer. The simulation is completely based on the chip and color mode of the existing set top box, and does not require additional hardware support for the source data. The conversion is also simpler, which has less impact on the performance of the set-top box.
附图说明 DRAWINGS
图 1为本发明实现图像层在视频层上半透明效果的方法的流程图; 图 2为图 1所示流程中划分子区域的方法流程图; 图 3为图 1所示流程中在每个子区域中填充源数据的方法流程图; 图 4为本发明实现图像层在视频层上半透明效果的装置的结构示意图。 具体实施方式 1 is a flowchart of a method for implementing a semi-transparent effect of an image layer on a video layer according to the present invention; FIG. 2 is a flowchart of a method for dividing a sub-area in the flow shown in FIG. 3 is a flow chart of a method for filling source data in each sub-area in the flow shown in FIG. 1. FIG. 4 is a schematic structural diagram of an apparatus for implementing a translucent effect of an image layer on a video layer according to the present invention. detailed description
为使本发明的目的和优点更加清楚,下面结合附图和实施例对本发明作进 一步的详细说明。  In order to make the objects and advantages of the present invention more comprehensible, the present invention will be further described in detail with reference to the accompanying drawings and embodiments.
图 1为本发明实现图像层在视频层上半透明效果的方法的流程图,该流程 包括:  FIG. 1 is a flowchart of a method for implementing a translucent effect of an image layer on a video layer according to the present invention, the process including:
步骤 101: 获取图像层待显示图像中每个像素点对应的源数据。  Step 101: Acquire source data corresponding to each pixel in the image layer to be displayed.
步骤 102: 针对待显示图像建立矩阵, 该矩阵中包括与待显示图像中的像 素点——对应的位置。  Step 102: Establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed.
步骤 103: 将所述矩阵划分为两个以上子区域。  Step 103: Divide the matrix into two or more sub-regions.
步骤 104: 在每个子区域中的一部分位置填充对应像素点的源数据、 另一 部分位置填充 0。  Step 104: Fill a part of each sub-area with source data of the corresponding pixel and another part of the position with 0.
步骤 105: 将填充后的矩阵中的数据输出到显存进行显示。  Step 105: Output the data in the filled matrix to the display memory for display.
通过图 1所述流程可以看出, 本发明提供的方法中, 并不是直接将获取的 源数据输出到显存进行显示、 而是进行了转换处理, 即首先建立与待处理图像 对应的矩阵、并将该矩阵划分为两个以上子区域, 其次在每个子区域中的一部 分填充对应像素点的源数据、 另一部分位置填充 0, 然后将填充后的矩阵输出 到显存进行显示, 其中填充为源数据的位置将最终显示为完全不透明的图像, 而填充为 0的位置将最终显示为完全透明的图像,这样图像层的图像在视频层 之上将呈现出完全不透明和完全透明区域间隔排列的情况,从而在整体上形成 半透明的效果, 因此本发明的方法模拟了图像层在视频层之上半透明的效果, 该模拟完全基于现有机顶盒的芯片及颜色模式, 不需要额外的硬件支持,对源 数据的转换也较筒单, 对机顶盒的性能影响较小。  It can be seen from the flow shown in FIG. 1 that the method provided by the present invention does not directly output the acquired source data to the display memory for display, but performs conversion processing, that is, first establishes a matrix corresponding to the image to be processed, and The matrix is divided into two or more sub-regions, and then a part of each sub-region is filled with source data of the corresponding pixel, and another portion is filled with 0, and then the filled matrix is output to the display memory for display, wherein the padding is source data. The position will eventually appear as a completely opaque image, and the position filled with 0 will eventually appear as a completely transparent image, so that the image of the image layer will appear completely opaque and completely transparent over the video layer. Thereby forming a translucent effect on the whole, the method of the present invention simulates the effect of the image layer being translucent over the video layer. The simulation is based entirely on the chip and color mode of the existing set top box, and does not require additional hardware support. The conversion of source data is also simpler, which has less impact on the performance of the set-top box.
下面举出本发明方法的一个实施例,分别对图 1中示出的各个步骤给出详 细的实现方式。  An embodiment of the method of the present invention is shown below, with detailed implementations of the various steps shown in Figure 1, respectively.
一、 针对图 1中所示的步骤 101 , 在接收到用户输入的显示指令后, 利用 图形引擎将待显示图像中每个像素点所对应的源数据放置在緩存中,形成一个 数据集,该数据集中的源数据符合机顶盒中芯片的颜色模式 ARGB1555。至于 如何利用图形引擎将源数据放置到緩存中,属于本领域的公知常识, 这里不再 赘述。 1. For step 101 shown in FIG. 1, after receiving the display instruction input by the user, the graphics engine is used to place the source data corresponding to each pixel in the image to be displayed in the cache to form a The data set, the source data in the data set conforms to the color mode ARGB1555 of the chip in the set top box. As for how to use the graphics engine to put the source data into the cache, it is common knowledge in the art, and will not be described here.
二、 针对图 1中所示的步骤 102, 所建立矩阵中的每个位置都包括符合颜 色模式 ARGB1555的 4个数据位, 其中 3位用于填充 RGB三原色, 1位用于 填充 Alpha通道值。  2. For step 102 shown in Fig. 1, each position in the established matrix includes 4 data bits conforming to the color mode ARGB1555, of which 3 bits are used to fill the RGB three primary colors and 1 bit is used to fill the alpha channel values.
三、 针对图 1中所示的步骤 103, 可以通过图 2所示的流程实现, 该流程 包括:  3. The step 103 shown in FIG. 1 can be implemented by the process shown in FIG. 2, and the process includes:
步骤 201: 获取预置的 Alpha通道值的位数 n。  Step 201: Obtain the number of bits n of the preset alpha channel value.
本步骤中, Alpha通道值的位数 n由设计人员预置在产品中, 该值与透明 度级数相关, 例如当 n取 2时, 代表模拟支持 2"=4级透明度, 即支持模拟显 示效果为完全不透明、 25%透明、 50%透明、 75%透明和完全透明。 为方便处 理, n设定为 2的整数倍。  In this step, the number n of the alpha channel value is preset by the designer in the product, and the value is related to the transparency level. For example, when n is 2, the simulation supports 2"=4 level transparency, that is, the simulation display effect is supported. It is completely opaque, 25% transparent, 50% transparent, 75% transparent and completely transparent. For ease of processing, n is set to an integral multiple of 2.
步骤 202: 判断建立的矩阵是否能够划分为整数个相同的子区域, 如果是 则执行步骤 204, 否则执行步骤 203。  Step 202: Determine whether the established matrix can be divided into an integer number of identical sub-areas, if yes, execute step 204, otherwise perform step 203.
本步骤中,由于建立的矩阵中的位置与待显示图像中的像素点是一一对应 的, 因此待显示图像的宽和高就是该矩阵的宽和高,通过应用程序可以获取待 显示图像的宽和高的值。  In this step, since the position in the established matrix is in one-to-one correspondence with the pixels in the image to be displayed, the width and height of the image to be displayed are the width and height of the matrix, and the image to be displayed can be obtained by the application. Wide and high values.
本步骤中, 设建立的矩阵的宽为 w、 高为 h, 为了方便处理, 假设每个子 区域都是宽、 高均为 2"/2的正方形, 这样在判断时只需判断建立的矩阵是否能 够划分出 [ 2叫 x[A/2叫个子区域, 如果是则划分为整数个子区域。 In this step, the width of the established matrix is w and the height is h. For the convenience of processing, it is assumed that each sub-area is a square with a width and a height of 2" /2 , so that it is only necessary to judge whether the established matrix is judged during judgment. Can be divided [2 called x[A/2 called sub-area, if it is divided into integer sub-areas.
步骤 203:增加所述矩阵中的位置,使其能够划分为整数个相同的子区域; 执行步骤 204。  Step 203: Add a position in the matrix to be divided into an integer number of identical sub-areas; and perform step 204.
本步骤中,针对待处理图像建立的矩阵不能划分出整数个子区域, 例如假 设每个子区域为 4x4的正方形, 而建立的矩阵为 16x19的矩阵, 则需要先增加 矩阵中的位置,例如形成 16x20的矩阵,才能保证该矩阵能够划分出整数个 4x4 正方形。 In this step, the matrix established for the image to be processed cannot be divided into an integer number of sub-regions. For example, if each sub-region is a square of 4×4 and the established matrix is a matrix of 16×19, the position in the matrix needs to be increased first, for example, forming a 16×20 The matrix can guarantee that the matrix can divide an integer number of 4x4 squares.
步骤 204: 设置每个子区域的宽和高均为 2"/2。 通过以上步骤 201~步骤 204即能够将建立的矩阵划分为两个以上子区域。 四、 针对图 1中所示的步骤 104, 可以通过图 3所示的流程实现, 该流程 包括: Step 204: Set the width and height of each sub-area to be 2" /2 . Through the above steps 201 to 204, the established matrix can be divided into two or more sub-regions. 4. The step 104 shown in FIG. 1 can be implemented by the process shown in FIG. 3, where the process includes:
步骤 301 : 获取用户设置的透明度值 a, a取 [0, 1]。  Step 301: Obtain the transparency value set by the user, a, and take [0, 1].
本步骤中, 透明度值 a包括: 全局透明度值 al和局部透明度值 a2。 其中 全局透明度值 al针对待显示图像的整体透明效果, 以模拟支持的 Alpha通道 值的位数 n取 2为例, 全局透明度 al可以取为 0、 0.25、 0.5、 0.75或 1 ; 局部 透明度值 a2 为用户设置的在待显示图形中指定的局部区域的透明效果, 以 Alpha通道值的位数 n取 2为例, 局部透明度值 a2也可以取为 0、 0.25、 0.5、 0.75或 1。  In this step, the transparency value a includes: a global transparency value al and a local transparency value a2. The global transparency value a1 is for the overall transparency effect of the image to be displayed. Taking the number of bits n of the supported alpha channel value as 2, the global transparency a can be taken as 0, 0.25, 0.5, 0.75 or 1; the local transparency value a2 For the transparent effect of the local area specified in the graphic to be displayed set by the user, taking the number of bits n of the alpha channel value as 2, the local transparency value a2 may also be taken as 0, 0.25, 0.5, 0.75 or 1.
本发明实施例中,用户可以在待显示图像中设置局部区域及指定该局部区 域的透明度效果与待显示图像的整体透明度效果不相同,从而带给用户不同的 体验, 但在某些应用场合中, 也可以只有全局透明度值。  In the embodiment of the present invention, the user may set the local area in the image to be displayed and specify the transparency effect of the local area to be different from the overall transparency effect of the image to be displayed, thereby giving the user a different experience, but in some applications, , you can also have only global transparency values.
步骤 302: 将获取的透明度值进行转换, 转换后的值以 A标识。  Step 302: Convert the obtained transparency value, and the converted value is identified by A.
本步骤中, 针对每个子区域、 按照公式 A = βχ2"对透明度值进行转换, 当 划分出的某个子区域中只包含用户指定的局部区域时,该公式中的 a取全局透 明度值 al与局部透明度值 a2的乘积, 即将这两个值进行了叠加, 当划分出的 某个子区域中既包含用户指定的局部区域, 又包括待显示图像的其他部分时, 该公式中的 a取全局透明度值 al。 In this step, for each sub-area, the transparency value is converted according to the formula A = β χ 2", and when a certain sub-area is divided into only the user-specified local area, a in the formula takes the global transparency value al and The product of the local transparency value a2, that is, the two values are superimposed. When a certain sub-region is divided into a user-specified local region and other parts of the image to be displayed, a in the formula takes global transparency. The value is al.
判断划分出的某个子区域中是否包含用户指定的局部区域,可以首先通过 应用程序获取待处理图像和局部区域在屏幕上的起始坐标值,及局部区域的宽 和高的值, 由于建立的矩阵中的位置与待处理图像中的像素点——对应, 这样 利用获取的上述起始坐标值就可以确定局部区域在该矩阵中从哪里起始、大小 具体是多少, 从而确定出局部区域分布在哪些子区域中。  Determining whether a divided sub-area contains a user-specified local area may first obtain an initial coordinate value of the image to be processed and the local area on the screen by the application, and a value of the width and height of the local area, due to the established The position in the matrix corresponds to the pixel point in the image to be processed, so that the obtained starting coordinate value can be used to determine where the local region starts in the matrix, and how much the size is, thereby determining the local region distribution. In which sub-areas.
按照上述公式得出的值可能并不一定为整数, 当得出的值不为整数时, 采 用四舍五入的方法近似为整数。  The value obtained according to the above formula may not necessarily be an integer. When the value obtained is not an integer, the method of rounding is approximated to an integer.
步骤 303: 按照预定顺序为每个子区域中的每个位置编号。  Step 303: Number each location in each sub-area in a predetermined order.
本步骤中, 预定顺序为: 将每个子区域中的左上角的位置作为起始位置, 按照从左到右、 从上到下的顺序。 In this step, the predetermined order is: the position of the upper left corner in each sub-area is taken as the starting position. Follow the order from left to right and top to bottom.
如表 1所示为对一个 4x4的子区域的编号示例。  An example of the numbering of a 4x4 sub-area is shown in Table 1.
表 1  Table 1
Figure imgf000009_0001
Figure imgf000009_0001
上述仅为一种具体的举例,在其他应用场合下,还可以设置其他的预定顺 The above is only a specific example. In other applications, other predetermined orders can be set.
5 序, 例如以每个子区域中的左上角的位置为起始位置,按照对角线的方向进行 编号, 形成如表 2所示的编号示例。 5 Order, for example, starting from the position of the upper left corner in each sub-area and numbering them in the direction of the diagonal to form an example numbered as shown in Table 2.
表 2  Table 2
Figure imgf000009_0002
Figure imgf000009_0002
步骤 304: 当划分子区域过程中未增加矩阵中的位置时,针对每个子区域, 在编号为 A及 A之前的位置填充对应像素点的源数据, 在编号 A之后的位置 0 填充 0; 当划分子区域过程中增加了矩阵中的位置时, 针对每个子区域, 在编 号为 A及 A之前、 且不属于增加的位置填充对应像素点的源数据, 在编号 A 之后、 及属于增加的位置填充 0。  Step 304: When the position in the matrix is not added in the process of dividing the sub-area, for each sub-area, the source data of the corresponding pixel is filled in the positions before the numbers A and A, and the position 0 after the number A is filled with 0; When the position in the matrix is added in the process of dividing the sub-area, for each sub-area, the source data of the corresponding pixel is filled in the positions before the number A and A, and does not belong to the increased position, after the number A, and belongs to the increased position. Filled with 0.
本步骤中,如果在划分子区域的过程中增加了矩阵中的位置, 则增加的部 分不属于图像层中待显示图像, 只是为了方便划分子区域而额外增加的, 这一 部分自然不能最终显示在屏幕上, 因此在填充每个子区域中的位置时,如果碰 到增加的位置, 需要填充为 0, 目的在于最终显示时额外增加的这部分完全透 明, 这样就看不出来额外增加的部分了。  In this step, if the position in the matrix is added in the process of dividing the sub-area, the added part does not belong to the image to be displayed in the image layer, but is additionally added for the convenience of dividing the sub-area, and this part cannot be finally displayed in the end. On the screen, therefore, when filling the position in each sub-area, if it encounters the increased position, it needs to be filled with 0, in order to completely increase the part of the final display when it is completely transparent, so that no additional part is seen.
通过上述步骤 301~步骤 304完成对每个子区域中的数据填充。 以表 1所 示子区域为例, 该子区域中不包括矩阵中增加的位置、且不包括用户指定的局 »0 部区域, 假设 Alpha通道值的位数 n为 4, 全局透明度值 al为 0.5, 则将表 1 中所示编号为 1~8的位置分别填充对应的源数据, 将编号为 9~16的位置分别 填充 0, 填充后的该子区域如表 3所示。 The filling of data in each sub-area is completed by the above steps 301 to 304. Take the sub-area shown in Table 1 as an example. The sub-area does not include the added position in the matrix, and does not include the user-specified area»0 area. Assume that the number of bits of the alpha channel value is n, and the global transparency value is 0.5, then Table 1 The positions numbered 1 to 8 are filled with the corresponding source data, and the positions numbered 9 to 16 are respectively filled with 0, and the filled sub-region is as shown in Table 3.
表 3  table 3
Figure imgf000010_0001
Figure imgf000010_0001
五、 针对图 1中所示的步骤 105 , 显示设备驱动调用机顶盒平台的驱动接 口, 把填充后的数据写入指定的显存地址, 然后按照常规方式执行显示。  5. For step 105 shown in Figure 1, the display device driver invokes the drive interface of the set top box platform, writes the filled data to the specified memory address, and then performs the display in a conventional manner.
基于以上本发明提供的方法, 本发明还提出了一种实现该方法的装置, 图 5为本发明实现图像层在视频层上半透明效果的装置的结构示意图, 该装置包 括:数据源管理模块 410、第一半透明处理模块 420、第二半透明处理模块 430 和显示驱动模块 440。  Based on the method provided by the present invention, the present invention also provides an apparatus for implementing the method, and FIG. 5 is a schematic structural diagram of an apparatus for implementing a translucent effect of an image layer on a video layer, the apparatus comprising: a data source management module 410, a first translucent processing module 420, a second translucent processing module 430, and a display driving module 440.
上述数据源管理模块 410, 用于获取图像层的待显示图像中每个像素点对 应的源数据。  The data source management module 410 is configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer.
上述第一半透明处理模块 420, 用于针对待显示图像建立矩阵, 该矩阵中 包括与待显示图像中的像素点——对应的位置;将所述矩阵划分为两个以上子 区域。  The first translucent processing module 420 is configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; and divide the matrix into two or more sub-regions.
上述第二半透明处理模块 430, 用于针对第一半透明处理模块 420建立的 矩阵的每个子区域,在子区域中的一部分位置填充数据源管理模块 410获取的 对应像素点的源数据、 另一部分位置填充 0。  The second semi-transparent processing module 430 is configured to fill, for each sub-region of the matrix established by the first translucent processing module 420, the source data of the corresponding pixel obtained by the data source management module 410 in a part of the sub-region, and another Part of the location is filled with 0.
显示驱动模块 440, 用于将第二半透明处理模块 430填充后的矩阵中的数 据输出到显存进行显示。  The display driving module 440 is configured to output the data in the matrix filled by the second translucent processing module 430 to the display memory for display.
为实现本发明方法中所描述的划分子区域, 上述第一半透明处理模块 420 包括: 矩阵建立单元 4201、 第一获取单元 4202和判断单元 4203。  In order to implement the divided sub-area described in the method of the present invention, the first translucent processing module 420 includes: a matrix establishing unit 4201, a first obtaining unit 4202, and a determining unit 4203.
上述第一获取单元 4202, 用于获取预置的 Alpha通道值的位数 n。  The first obtaining unit 4202 is configured to acquire the number of bits n of the preset alpha channel value.
上述矩阵建立单元 4201 , 用于针对待显示图像建立矩阵, 该矩阵中包括 与待显示图像中的像素点——对应的位置; 当判断单元 4203输出为是的判断 结果时, 在矩阵中划分宽和高均为 2"/2的两个以上子区域, 当判断单元 4203输 出为否的判断结果时, 先增加矩阵中的位置, 使其能够设置 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 再在增加位置后的矩阵中划分宽和高均为 2"/2的两个 以上子区域。 The matrix establishing unit 4201 is configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; and when the output of the determining unit 4203 is YES As a result, two or more sub-regions each having a width and a height of 2" /2 are divided in the matrix. When the judgment unit 4203 outputs a judgment result of No, the position in the matrix is first increased so that it can be set [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and then divide the matrix after the position is increased by two or more sub-regions whose width and height are both 2" /2 .
上述判断单元 4203 , 用于判断矩阵建立单元 4201建立的矩阵是否能够划 分为 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 将判断结果输出给矩阵建立单 元 4201。 The determining unit 4203 is configured to determine whether the matrix established by the matrix establishing unit 4201 can be divided into [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and output the determination result to the matrix establishing unit 4201 .
为实现本发明方法所描述的填充, 上述第二半透明处理模块 430包括: 第 二获取单元 4301、 转换单元 4302、 编号单元 4303和填充单元 4304。  To implement the padding described in the method of the present invention, the second translucent processing module 430 includes: a second obtaining unit 4301, a converting unit 4302, a numbering unit 4303, and a filling unit 4304.
上述第二获取单元 4301 , 用于获取用户设置的透明度值 a, a取 [0, 1]。 上述转换单元 4302, 用于按照公式 Α = αχ2"对透明度值进行转换。 The second obtaining unit 4301 is configured to obtain a transparency value a, a of the user setting, and [0, 1]. The conversion unit 4302 is configured to convert the transparency value according to the formula Α = α χ 2".
上述编号单元 4303 , 用于按照预定顺序为矩阵建立单元 4201划分的每个 子区域中的位置编号。  The above numbering unit 4303 is for a position number in each sub-area divided by the matrix establishing unit 4201 in a predetermined order.
上述填充单元 4304, 用于当第一半透明处理模块 420未增加矩阵中的位 置时, 针对矩阵建立单元 4201划分的每个子区域, 在编号为 Α及 Α之前的位 置填充对应像素点的源数据, 在编号 A之后的位置填充 0; 当第一半透明处理 模块 420增加了矩阵中的位置时,针对矩阵建立单元 4201划分的每个子区域, 在编号为 A及 A之前、 且不属于增加的位置填充对应像素点的源数据, 在编 号 A之后、 及属于增加的位置填充 0。  The filling unit 4304 is configured to: when the first translucent processing module 420 does not increase the position in the matrix, fill each source region divided by the matrix establishing unit 4201, and fill the source data of the corresponding pixel point at positions before the numbers Α and Α Filling the position after the number A; when the first translucent processing module 420 increases the position in the matrix, each sub-area divided for the matrix establishing unit 4201, before the numbers A and A, does not belong to the addition The position fills the source data of the corresponding pixel, and is padded after the number A and the position belonging to the increment.
以上本发明提供的装置, 可以按照本发明提供的方法流程执行操作, 这里 不再赘述。  The foregoing apparatus provided by the present invention can perform operations according to the method flow provided by the present invention, and details are not described herein again.
本发明还提供一种机顶盒,该机顶盒中包括上述实现图像层在视频层上半 透明效果的装置, 因此该机顶盒能够基于现有芯片及其颜色模式,模拟图像层 在视频层之上呈现半透明效果, 该装置的具体结构与上文的描述相同, 这里不 再赘述。  The present invention also provides a set top box including the above device for realizing a translucent effect of an image layer on a video layer, so that the set top box can render a translucent image layer on top of the video layer based on the existing chip and its color mode. The specific structure of the device is the same as that described above, and will not be described again here.
综上所述, 以上仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等, 均应包含在本发明的保护范围之内。  In conclusion, the above is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种实现图像层在视频层上半透明效果的方法, 其特征在于, 该方法 包括:  A method for implementing a translucent effect of an image layer on a video layer, the method comprising:
获取图像层的待显示图像中每个像素点对应的源数据;  Obtaining source data corresponding to each pixel point in the image to be displayed of the image layer;
5 针对待显示图像建立矩阵,该矩阵中包括与待显示图像中的像素点——对 应的位置;  5 establishing a matrix for the image to be displayed, the matrix including the pixel points in the image to be displayed - the corresponding position;
将所述矩阵划分为两个以上子区域;  Dividing the matrix into two or more sub-regions;
在每个子区域中的预设位置填充对应像素点的源数据、预设位置之外的其 他位置填充 0;  The source data of the corresponding pixel is filled in the preset position in each sub-area, and the other position except the preset position is filled with 0;
^ 0 将填充后的矩阵中的数据输出到显存进行显示。  ^ 0 Outputs the data in the filled matrix to the display memory for display.
2、 如权利要求 1所述的方法, 其特征在于, 所述将所述矩阵划分为两个 以上子区域包括:  2. The method according to claim 1, wherein the dividing the matrix into two or more sub-regions comprises:
获取预置的 Alpha通道值的位数 n;  Get the number of bits of the preset alpha channel value n;
判断所述矩阵是否能够划分为 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 如果是, 在矩阵中划分宽和高均为 2"/2的两个以上子区域; 否则, 先增加所述 矩阵中的位置, 使其能够划分为 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 再 在增加位置后的矩阵中划分出宽和高均为 2"/2的两个以上子区域。 It is judged whether the matrix can be divided into [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and if so, two or more widths and heights of 2" /2 are divided in the matrix Sub-region; otherwise, first increase the position in the matrix so that it can be divided into [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and then divide in the matrix after increasing the position Both the width and height are two or more sub-areas of 2" /2 .
3、 如权利要求 2所述的方法, 其特征在于, 所述在每个子区域中的预设 位置填充对应像素点的源数据、 预设位置之外的其他位置填充 0包括: The method according to claim 2, wherein the filling of the source data of the corresponding pixel in the preset position in each sub-area and the filling of the position other than the preset position comprises:
»0 获取用户设置的透明度值 a, 所述透明度值 a大于等于 0、 小于等于 1; »0 Get the transparency value set by the user a, the transparency value a is greater than or equal to 0, less than or equal to 1;
按照公式 A = αχ2"对透明度值进行转换;  Convert the transparency value according to the formula A = αχ2";
按照预定顺序为每个子区域中的每个位置编号;  Number each location in each sub-area in a predetermined order;
当所述划分中未在矩阵中增加位置时,针对每个子区域,在编号为 Α及 A 之前的位置填充对应的源数据, 在编号 A之后的位置填充 0; 当所述划分中在 »5 矩阵中增加了位置时, 针对每个子区域, 在编号为 A及 A之前、 且不属于增 加的位置填充对应的源数据, 在编号 A之后、 及属于增加的位置填充 0。  When the position is not added to the matrix in the division, for each sub-area, the corresponding source data is filled at positions before the numbers Α and A, and the position after the number A is filled with 0; when the division is at »5 When the position is added to the matrix, for each sub-area, the corresponding source data is filled before the numbers A and A, and the positions that are not added, and 0 is added after the number A and the position that belongs to the increase.
4、 如权利要求 3所述的方法, 其特征在于, 所述预定顺序为: 以每个子 区域左上角的位置为起始位置, 按照从左到右、 从上到下的顺序。 4. The method according to claim 3, wherein the predetermined order is: starting from a position in the upper left corner of each sub-area, in order from left to right and top to bottom.
5、 如权利要求 3所述的方法, 其特征在于, 获取用户设置的透明度值之 前, 该方法进一步包括: 预先在待显示图像中指定局部区域; The method of claim 3, wherein before the obtaining the transparency value set by the user, the method further comprises: pre-specifying the local area in the image to be displayed;
相应的, 所述透明度值 a包括: 针对所述待显示图像的全局透明度值 al、 和针对所述局部区域的局部透明度值 a2;  Correspondingly, the transparency value a includes: a global transparency value al for the image to be displayed, and a local transparency value a2 for the local region;
所述按照公式 Α = βχ2"对透明度值进行转换包括: 针对每个子区域, 当子 区域中只包含所述局部区域时, 所述公式 Α = αχ2"中的 a值取全局透明度值 al 与局部透明度值 a2的乘积; 当子区域中既包含所述局部区域, 又包含待显示 图像的部分时, 所述公式 Α = αχ2"中的 a值取全局透明度值 al ; 当子区域中只 包含待显示图像的部分时, 所述公式 Α = αχ2"中的 a值取全局透明度值 al。 The conversion of the transparency value according to the formula Α = β χ 2" includes: for each sub-region, when only the local region is included in the sub-region, the value of a in the formula Α = α χ 2" takes the global transparency value a1 a product of the local transparency value a2; when the sub-region contains both the local region and the portion of the image to be displayed, the value of a in the formula Α = α χ 2" takes the global transparency value a1; When only the portion of the image to be displayed is included, the value of a in the formula Α = α χ 2" takes the global transparency value a1.
6、 一种实现图像层在视频层上半透明效果的装置, 其特征在于, 该装置 包括:  6. A device for implementing a translucent effect of an image layer on a video layer, the device comprising:
数据源管理模块,用于获取图像层的待显示图像中每个像素点对应的源数 据;  a data source management module, configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer;
第一半透明处理模块, 用于针对待显示图像建立矩阵, 该矩阵中包括与待 显示图像中的像素点——对应的位置; 将所述矩阵划分为两个以上子区域; 第二半透明处理模块,用于针对第一半透明处理模块建立的矩阵的每个子 区域, 在子区域中的预设位置填充数据源管理模块获取的对应像素点的源数 据、 预设位置之外的其他位置填充 0;  a first transparent processing module, configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; dividing the matrix into two or more sub-regions; a processing module, configured to fill, for each sub-region of the matrix established by the first translucent processing module, the source data of the corresponding pixel obtained by the data source management module, and other locations than the preset location in the preset position in the sub-region Filled with 0;
显示驱动模块,用于将第二半透明处理模块填充后的矩阵中的数据输出到 显存进行显示。  The display driver module is configured to output data in the matrix filled by the second translucent processing module to the display memory for display.
7、 如权利要求 6所述的装置, 其特征在于, 所述第一半透明处理模块包 括:  7. The apparatus according to claim 6, wherein the first translucent processing module comprises:
第一获取单元, 用于获取预置的 Alpha通道值的位数 n;  a first obtaining unit, configured to obtain a number n of preset alpha channel values;
矩阵建立单元, 用于针对待显示图像建立矩阵, 该矩阵中包括与待显示图 像中的像素点一一对应的位置; 当判断单元输出的判断结果为是时,在矩阵中 划分宽和高均为 2"/2的两个以上子区域, 当判断单元输出的判断结果为否时, 先增加矩阵中的位置,使其能够设置 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 再在增加位置后的矩阵中划分出宽和高均为 2"/2的两个以上子区域; 判断单元, 用于判断矩阵建立单元建立的矩阵是否能够划分为 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 将判断结果输出给矩阵建立单元。 a matrix establishing unit, configured to establish a matrix for the image to be displayed, where the matrix includes a position one-to-one corresponding to the pixel points in the image to be displayed; when the judgment result output by the determining unit is yes, the width and height are divided in the matrix For two or more sub-areas of 2" /2 , when the judgment result of the judgment unit output is no, first increase the position in the matrix so that it can set [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and then divide more than two sub-regions whose width and height are 2" /2 in the matrix after the position is increased; The judging unit is configured to judge whether the matrix established by the matrix establishing unit can be divided into [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and output the judgment result to the matrix establishing unit.
8、 如权利要求 7所述的装置, 其特征在于, 所述第二半透明处理模块包 括:  8. The apparatus of claim 7, wherein the second translucent processing module comprises:
5 第二获取单元, 用于获取用户设置的透明度值 a, 所述透明度值 a大于等 于 0、 小于等于 1 ;  a second obtaining unit, configured to obtain a transparency value a set by the user, where the transparency value a is greater than 0, less than or equal to 1;
转换单元, 用于按照公式 Α = βχ2"对透明度值进行转换; a conversion unit for converting the transparency value according to the formula Α = β χ 2";
编号单元,用于按照预定顺序为矩阵建立单元划分的每个子区域中的位置 编号;  a numbering unit for establishing a position number in each sub-area divided by the unit for the matrix in a predetermined order;
0 填充单元, 用于当第一半透明处理模块未增加矩阵中的位置时, 针对矩阵 建立单元划分的每个子区域, 在编号为 Α及 Α之前的位置填充对应像素点的 源数据, 在编号 A之后的位置填充 0; 当第一半透明处理模块增加了矩阵中的 位置时, 针对矩阵建立单元划分的每个子区域, 在编号为 A及 A之前、 且不 属于增加的位置填充对应像素点的源数据, 在编号 A之后、 及属于增加的位 置填充 0。  0 padding unit, used to fill the source data of the corresponding pixel point at the position before the number Α and 每个, when the first translucent processing module does not increase the position in the matrix, and fill in the source data of the corresponding pixel point at the position before the number Α and , The position after A is padded with 0; when the first translucent processing module increases the position in the matrix, each sub-region divided for the matrix establishment unit is filled with corresponding pixels before the numbers A and A, and not belonging to the added position. Source data, padded with 0 after number A, and belonging to the added position.
9、 一种机顶盒, 其特征在于, 包括实现图像层在视频层上半透明效果的 装置, 该装置包括:  9. A set top box, comprising: means for effecting a translucent effect of an image layer on a video layer, the apparatus comprising:
数据源管理模块,用于获取图像层的待显示图像中每个像素点对应的源数 据;  a data source management module, configured to acquire source data corresponding to each pixel in the image to be displayed of the image layer;
»0 第一半透明处理模块, 用于针对待显示图像建立矩阵, 该矩阵中包括与待 显示图像中的像素点——对应的位置; 将所述矩阵划分为两个以上子区域; 第二半透明处理模块,用于针对第一半透明处理模块建立的矩阵的每个子 区域, 在子区域中的预设位置填充数据源管理模块获取的对应像素点的源数 据、 预设位置之外的其他位置填充 0;  The first half transparent processing module is configured to establish a matrix for the image to be displayed, where the matrix includes a position corresponding to a pixel point in the image to be displayed; dividing the matrix into two or more sub-regions; a semi-transparent processing module, configured to fill each sub-region of the matrix established by the first translucent processing module, and fill the source data of the corresponding pixel obtained by the data source management module and the preset position in the preset position in the sub-region Other positions are filled with 0;
15 显示驱动模块,用于将第二半透明处理模块填充后的矩阵中的数据输出到 显存进行显示。 The display driver module is configured to output the data in the matrix filled by the second translucent processing module to the display memory for display.
10、 如权利要求 9所述的机顶盒, 其特征在于, 所述第一半透明处理模块 包括: 第一获取单元, 用于获取预置的 Alpha通道值的位数 n; The set top box according to claim 9, wherein the first translucent processing module comprises: a first obtaining unit, configured to obtain a bit number n of the preset alpha channel value;
矩阵建立单元, 用于针对待显示图像建立矩阵, 该矩阵中包括与待显示图 像中的像素点一一对应的位置; 当判断单元输出的判断结果为是时,在矩阵中 划分宽和高均为 2"/2的两个以上子区域, 当判断单元输出的判断结果为否时, 5 先增加矩阵中的位置,使其能够设置 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 再在增加位置后的矩阵中划分出宽和高均为 2"/2的两个以上子区域; a matrix establishing unit, configured to establish a matrix for the image to be displayed, where the matrix includes a position one-to-one corresponding to the pixel points in the image to be displayed; when the judgment result output by the determining unit is yes, the width and height are divided in the matrix For two or more sub-areas of 2" /2 , when the judgment result of the judgment unit output is No, 5 first increase the position in the matrix so that it can set [matrix width / 2" /2 ] X [matrix height / 2 " /2 ] sub-regions, and then divide two or more sub-regions whose width and height are both 2" /2 in the matrix after the position is increased;
判断单元, 用于判断矩阵建立单元建立的矩阵是否能够划分为 [矩阵宽 / 2"/2 ] X [矩阵高 / 2"/2 ]个子区域, 将判断结果输出给矩阵建立单元。 The judging unit is configured to judge whether the matrix established by the matrix establishing unit can be divided into [matrix width / 2" /2 ] X [matrix height / 2" /2 ] sub-regions, and output the judgment result to the matrix establishing unit.
11、 如权利要求 10所述的机顶盒, 其特征在于, 所述第二半透明处理模 0 块包括:  The set top box according to claim 10, wherein the second translucent processing module 0 comprises:
第二获取单元, 用于获取用户设置的透明度值 a, 所述透明度值 a大于等 于 0、 小于等于 1; a second obtaining unit, configured to obtain a transparency value a set by the user, where the transparency value a is greater than or equal to 0 and less than or equal to 1;
转换单元, 用于按照公式 Α = βχ2"对透明度值进行转换; a conversion unit for converting the transparency value according to the formula Α = β χ 2";
编号单元,用于按照预定顺序为矩阵建立单元划分的每个子区域中的位置 ^5 编号;  a numbering unit for locating a position ^5 in each sub-area of the unit division in a predetermined order;
填充单元, 用于当第一半透明处理模块未增加矩阵中的位置时, 针对矩阵 建立单元划分的每个子区域, 在编号为 Α及 Α之前的位置填充对应像素点的 源数据, 在编号 A之后的位置填充 0; 当第一半透明处理模块增加了矩阵中的 位置时, 针对矩阵建立单元划分的每个子区域, 在编号为 A及 A之前、 且不 »0 属于增加的位置填充对应像素点的源数据, 在编号 A之后、 及属于增加的位 置填充 0。  a padding unit, configured to: when the first translucent processing module does not increase the position in the matrix, fill each of the sub-areas divided by the matrix establishment unit, and fill the source data of the corresponding pixel point at a position before the numbers Α and ,, at number A. The subsequent position is filled with 0; when the first translucent processing module increases the position in the matrix, each sub-region divided for the matrix establishment unit is filled with corresponding pixels before the numbers A and A, and not »0 belongs to the increased position The source data of the point, padded with 0 after the number A and belonging to the added position.
PCT/CN2010/071183 2009-09-24 2010-03-22 Method, apparatus and set-top-box for realizing semitransparent effect on video layer for image layer WO2011035568A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2009101756176A CN101668144B (en) 2009-09-24 2009-09-24 Method for realizing semitransparent effect of image layer on video layer, device and set top box
CN200910175617.6 2009-09-24

Publications (1)

Publication Number Publication Date
WO2011035568A1 true WO2011035568A1 (en) 2011-03-31

Family

ID=41804556

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/071183 WO2011035568A1 (en) 2009-09-24 2010-03-22 Method, apparatus and set-top-box for realizing semitransparent effect on video layer for image layer

Country Status (3)

Country Link
CN (1) CN101668144B (en)
HK (1) HK1140336A1 (en)
WO (1) WO2011035568A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101668144B (en) * 2009-09-24 2011-08-17 深圳市同洲电子股份有限公司 Method for realizing semitransparent effect of image layer on video layer, device and set top box
CN102446364B (en) 2011-09-05 2017-04-12 中兴通讯股份有限公司 Image processing method, device and terminal based on transparency
CN102395008A (en) * 2011-11-21 2012-03-28 深圳市茁壮网络股份有限公司 Color key processing method
CN102917272A (en) * 2012-09-04 2013-02-06 苏州汉辰数字科技有限公司 Method for cross nested display of application program
CN103024294B (en) * 2012-09-20 2016-04-27 深圳市茁壮网络股份有限公司 Chroma key implementation method and device
CN105898614A (en) * 2015-08-21 2016-08-24 乐视致新电子科技(天津)有限公司 Screen menu transparency setting method and device and chip
CN109803163B (en) * 2017-11-16 2021-07-09 腾讯科技(深圳)有限公司 Image display method and device and storage medium
CN111601140A (en) * 2020-04-28 2020-08-28 西安万像电子科技有限公司 Method and device for remotely playing video

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6259810B1 (en) * 1997-04-15 2001-07-10 Microsoft Corporation Method and system of decoding compressed image data
JP2004048605A (en) * 2002-07-15 2004-02-12 Sharp Corp Image processing method, image processing program, recording medium thereof, image processing device, and image processing system
CN101179676A (en) * 2007-12-13 2008-05-14 北京中星微电子有限公司 Fixed image extracting method and apparatus in television picture
CN101668144A (en) * 2009-09-24 2010-03-10 深圳市同洲电子股份有限公司 Method for realizing semitransparent effect of image layer on video layer, device and set top box

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6259810B1 (en) * 1997-04-15 2001-07-10 Microsoft Corporation Method and system of decoding compressed image data
JP2004048605A (en) * 2002-07-15 2004-02-12 Sharp Corp Image processing method, image processing program, recording medium thereof, image processing device, and image processing system
CN101179676A (en) * 2007-12-13 2008-05-14 北京中星微电子有限公司 Fixed image extracting method and apparatus in television picture
CN101668144A (en) * 2009-09-24 2010-03-10 深圳市同洲电子股份有限公司 Method for realizing semitransparent effect of image layer on video layer, device and set top box

Also Published As

Publication number Publication date
HK1140336A1 (en) 2010-10-08
CN101668144A (en) 2010-03-10
CN101668144B (en) 2011-08-17

Similar Documents

Publication Publication Date Title
WO2011035568A1 (en) Method, apparatus and set-top-box for realizing semitransparent effect on video layer for image layer
US10832462B2 (en) Image synthesis method, image chip, and image device
US5295235A (en) Polygon engine for updating computer graphic display employing compressed bit map data
JP6652937B2 (en) Multiple display pipelines driving split displays
JP2020533710A (en) Image stitching method and device, storage medium
KR102055467B1 (en) Virtual surface allocation
CN103247068B (en) A kind of rendering intent and device
WO2023010851A1 (en) Webgl-based graphics rendering method, apparatus and system
EP3364289A1 (en) Display switching method for terminal, and terminal
WO2012113923A1 (en) Display list mechanism and scalable display engine structures
CN101778226A (en) High-definition image sawtooth-prevention method, device and digital television receiving terminal
US20120127193A1 (en) User Interface Pipe Scalers with Active Regions
US10133711B2 (en) Display apparatus and control method thereof
CN111901660A (en) Image display method, terminal, electronic equipment and storage medium
CN109389558A (en) A kind of method and device for eliminating image border sawtooth
JP2006251000A (en) Display controller capable of superimposed display
CN111698491B (en) Multi-projection image display method and device, electronic equipment and storage medium
CN101753856A (en) Method and device for processing character display and equipment comprising device
CN101815184A (en) Image display method and device applied to television
CN108509112B (en) Menu display method and device, display equipment and storage medium
JP2006301029A (en) On-screen display apparatus and on-screen display creating method
TW201901620A (en) Rendering method and device
JP2006303631A (en) On-screen display device and on-screen display generation method
JP2023550764A (en) Methods, devices, smart terminals and media for creating panoramic images based on large displays
CN102184070A (en) Method and device for displaying cursor of hardware support

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10818262

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02/07/12)

122 Ep: pct application non-entry in european phase

Ref document number: 10818262

Country of ref document: EP

Kind code of ref document: A1