[go: up one dir, main page]

CN115700734A - Layer composition method and device, electronic equipment and storage medium - Google Patents

Layer composition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115700734A
CN115700734A CN202211336795.4A CN202211336795A CN115700734A CN 115700734 A CN115700734 A CN 115700734A CN 202211336795 A CN202211336795 A CN 202211336795A CN 115700734 A CN115700734 A CN 115700734A
Authority
CN
China
Prior art keywords
layer
pixel point
synthesized
blank
value
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202211336795.4A
Other languages
Chinese (zh)
Inventor
贺晨
刘海
黄文彦
刘致宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Ziguang Zhanrui Technology Co ltd
Original Assignee
Xi'an Ziguang Zhanrui Technology Co ltd
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 Xi'an Ziguang Zhanrui Technology Co ltd filed Critical Xi'an Ziguang Zhanrui Technology Co ltd
Priority to CN202211336795.4A priority Critical patent/CN115700734A/en
Publication of CN115700734A publication Critical patent/CN115700734A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The embodiment of the application provides a layer synthesis method, a layer synthesis device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a second layer, a blank layer and a plurality of first layers, wherein the second layer is subjected to specific processing, the hierarchy of the second layer is positioned between the hierarchies of the plurality of first layers, the hierarchy of the blank layer is the same as that of the second layer, and the color value of a pixel point in the blank layer is a preset value; synthesizing the plurality of first layers and the blank layers to obtain first synthesized layers; and overlapping the first synthetic image layer and the second image layer to obtain a second synthetic image layer. When the middle layer needs to be subjected to specific processing, a plurality of layers can be synthesized.

Description

Layer composition method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a layer composition method and device, electronic equipment and a storage medium.
Background
Display interfaces of electronic devices having an image display function, such as mobile phones and televisions, are generally obtained by synthesizing a plurality of layers.
When a certain middle layer of the plurality of layers needs to perform certain processing such as synthesized picture quality enhancement, frame interpolation, and/or HDR using a Display Processing Unit (DPU), the other layers (the first layer) except the middle layer cannot perform the synthesizing processing, and thus the plurality of layers cannot be synthesized.
Disclosure of Invention
The embodiment of the application relates to a layer synthesis method, a layer synthesis device, electronic equipment and a storage medium, wherein specific processing is required to be performed on a middle layer, and a plurality of layers can be synthesized.
In a first aspect, an embodiment of the present application provides a layer processing method, including:
acquiring a second layer, a blank layer and a plurality of first layers, wherein the second layer is specially processed, the hierarchy of the second layer is located between the hierarchies of the plurality of first layers, the hierarchy of the blank layer is the same as the hierarchy of the second layer, and the color value of a pixel point in the blank layer is a preset value;
synthesizing the plurality of first layers and the blank layer to obtain a first synthesized layer;
and overlapping the first synthesized layer and the second synthesized layer to obtain a second synthesized layer.
In a possible implementation manner, synthesizing the plurality of first image layers and the blank image layer to obtain a first synthesized image layer includes:
performing synthesis processing on at least one first layer which is hierarchically in front of the blank layer to obtain a third synthesized layer;
synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer;
and synthesizing the fourth synthesized image layer and at least one first image layer which is positioned behind the blank image layer at the hierarchy level to obtain the first synthesized image layer.
In a possible implementation manner, synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer includes:
acquiring a first transparency value of the third synthesized layer and a second transparency value of the blank layer, wherein the second transparency value is a transparency value of the second layer;
and determining the color value of each pixel point in the fourth synthetic layer according to the first transparency value, the color value of each pixel point in the third synthetic layer, the second transparency value and the color value of each pixel point in the blank layer.
In a possible implementation manner, determining, for any first pixel point in the third synthesized layer, a color value of each pixel point in the fourth synthesized layer according to the first transparency value, the color value of each pixel point in the third synthesized layer, the second transparency value, and the color value of each pixel point in the blank layer includes:
determining a second pixel point in the blank layer, wherein the pixel position of the second pixel point is the same as the pixel position of the first pixel point on the display screen;
and determining the color value of a third pixel point according to the product of the color value of the first pixel point and the first transparency value and the sum of the product of the color value of the second pixel point and the second transparency value, wherein the third pixel point is a pixel point in the fourth synthetic layer, and the pixel positions of the third pixel point and the first pixel point on the display screen are the same.
In a possible implementation manner, the obtaining a second synthesized layer by performing an overlay process on the first synthesized layer and the second layer includes:
acquiring a second transparency value of the second layer and a third transparency value of a fifth synthetic layer, wherein the fifth synthetic layer is obtained by synthesizing at least one first layer with a hierarchy behind the hierarchy of the second layer;
and determining the color value of each pixel point in the second synthetic layer according to the color value of each pixel point in the first synthetic layer, the second transparency value, the third transparency value and the color value of each pixel point in the second synthetic layer.
In a possible implementation manner, for any one fourth pixel point in the first synthesized layer, determining a color value of each pixel point in the second synthesized layer according to the color value of each pixel point in the first synthesized layer, the second transparency value, the third transparency value, and the color value of each pixel point in the second layer includes:
determining a fifth pixel point in the second layer, wherein the pixel position of the fifth pixel point is the same as the pixel position of the fourth pixel point on the display screen;
determining the fourth transparency value according to the third transparency value, wherein the sum of the fourth transparency value and the third transparency value is equal to 1;
determining the color value of a sixth pixel point according to the product of the fourth transparency value, the second transparency and the color value of the fifth pixel point and the sum of the color values of the fourth pixel point;
and the sixth pixel point is a pixel point in the second synthesized layer, and the pixel position of the sixth pixel point is the same as the pixel position of the fourth pixel point on the display screen.
In a possible implementation manner, the obtaining a second synthesized layer by performing an overlay process on the first synthesized layer and the second layer includes:
determining a seventh pixel point in the first synthesized layer;
if no pixel point with the same pixel position as the seventh pixel point on the display screen exists in the second image layer, determining the color value of the seventh pixel point as the color value of an eighth pixel point;
the eighth pixel point is a pixel point in the second synthesized layer, and the pixel position of the eighth pixel point is the same as the pixel position of the seventh pixel point on the display screen.
In a second aspect, an embodiment of the present application provides a layer composition apparatus, including an obtaining module, a composition processing module, and a superposition processing module, where,
the acquiring module is used for acquiring a second layer, a blank layer and a plurality of first layers, wherein the second layer is subjected to specific processing, the second layer is located among the plurality of first layers, the level of the blank layer is the same as that of the second layer, and the color value of a pixel point in the blank layer is a preset value;
the synthesis processing module is configured to perform synthesis processing on the plurality of first layers and the blank layer to obtain a first synthesis layer;
and the superposition processing module is used for carrying out superposition processing on the first synthetic image layer and the second image layer to obtain a second synthetic image layer.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the method of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method of the first aspect is implemented.
In a fifth aspect, the present application provides a computer program product comprising a computer program that, when executed by a processor, implements the method of the first aspect.
In a sixth aspect, an embodiment of the present application provides a chip, where a computer program is stored on the chip, and when the computer program is executed by the chip, the method according to the first aspect is implemented.
In one possible embodiment, the chip is a chip in a chip module.
The embodiment of the application provides a layer synthesis method, a layer synthesis device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a second layer, a blank layer and a plurality of first layers, wherein the second layer is subjected to specific processing, the hierarchy of the second layer is positioned between the hierarchies of the plurality of first layers, the hierarchy of the blank layer is the same as that of the second layer, and the color value of a pixel point in the blank layer is a preset value; synthesizing the plurality of first layers and the blank layers to obtain first synthesized layers; and overlapping the first synthetic image layer and the second image layer to obtain a second synthetic image layer. By adding the blank layer, the problem that the levels of the plurality of first layers are discontinuous can be solved, and the technical problem that the plurality of layers cannot be synthesized is further solved; meanwhile, because the color values of the pixel points in the blank layers are preset values, the color values of the first synthesized layers are only the synthesized values of the color values of the plurality of first layers, and the correctness of the color values of the finally synthesized second synthesized layers can be further ensured.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a layer composition method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a sequence of a plurality of layers in a Z-axis according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another layer composition method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a layer composition apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
It should be noted that, although the terms "first", "second", and the like are used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. Alternatively, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present application.
It will be understood that the terms "comprises" and "comprising" indicate the presence of the previously mentioned features, steps, operations, but do not preclude the presence, or addition of one or more other features, steps, operations.
For ease of understanding, an application scenario to which the embodiment of the present application is applied is described below with reference to fig. 1.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. Referring to fig. 1, the layer composition apparatus includes a DPU, a 2D accelerator, and a GPU, and the layer composition apparatus may complete a process from generation of a layer to an on-screen display through the DPU, the 2D accelerator, and the GPU. The GPU can draw the image layers, the GPU/2D accelerator/DPU can synthesize the image layers, and the DPU can send the synthesized image layers to the display screen for displaying.
When a GPU/2D accelerator is used to synthesize a plurality of layers, the plurality of layers are generally layers with continuous hierarchy, and when a certain middle layer needs to use a DPU to perform some specific processes such as synthesized image quality enhancement, frame interpolation, and/or HDR, other layers (first layers) except the middle layer cannot be synthesized using the GPU, which may result in that the plurality of layers cannot be synthesized.
Two composite paths, such as an On Screen Display (OSD) path and a video path, may be included in the DPU. When multiple layers are synthesized by using a DPU, the multiple layers are generally layers with continuous hierarchy, and when a certain middle layer needs to perform certain processing such as some synthesized image quality enhancement, frame interpolation, and/or HDR using a video channel, other layers (first layers) except the middle layer cannot be synthesized by using an OSD channel, so that multiple layers cannot be synthesized.
In order to avoid the foregoing technical problem, an embodiment of the present application provides a layer processing method, where a blank layer having the same hierarchy as a middle layer is synthesized with multiple first layers to obtain a first synthesized layer, and then the first synthesized layer is synthesized with a specially processed middle layer (a second layer) to obtain a second synthesized layer.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may exist independently or may be combined with each other, and description of the same or similar contents is not repeated in different embodiments.
Fig. 2 is a schematic flowchart of a layer synthesis method according to an embodiment of the present application. Referring to fig. 2, the method may include:
s201, obtaining a second image layer, a blank image layer and a plurality of first image layers.
The execution main body of the embodiment of the application may be an electronic device with a layer composition function, and may also be a layer composition device disposed in the electronic device. The layer synthesizing device may be implemented by software, or may be implemented by a combination of software and hardware.
The second layer is a layer subjected to specific processing, and the hierarchy of the second layer is located among the hierarchies of the plurality of first layers.
The level of the blank layer is the same as that of the second layer, and the color value of the pixel point in the blank layer is a preset value; the preset value may be 0.
In one possible implementation, the color value may be a red (R) value, a green (G) value, or a blue (B) value.
The specific processing may be processing such as picture quality enhancement, frame interpolation, and/or HDR.
The second layer may be a video (video) layer.
The first layer may be a layer that does not require special processing. For example, the first layer may be a common User Interface (UI) layer.
The second layer and the plurality of first layers can be synthesized into a synthesized layer, wherein the hierarchy of the second layer is a middle hierarchy, namely the second layer is not a top layer or a bottom layer; the plurality of first layers comprise a top layer and a bottom layer.
A hierarchy may be used to describe the front-to-back order of layers in a vertical direction of the plane of the display screen.
The larger the hierarchy of layers, the more forward the layers are in the vertical direction of the display screen plane may be represented.
For example, a hierarchy may be described in Z-order (order). There is a Z-axis in the vertical direction of the screen plane and all layers are ordered front to back according to the coordinates on the Z-axis.
Fig. 3 is a schematic diagram of an order of a plurality of layers on a Z axis according to an embodiment of the present application. Referring to fig. 3, the screen includes layer 2, layer 1, and layer 0 in the order from top to bottom when displayed on the screen. The Z-orders of layer 0, layer 1 and layer 2 are respectively represented as 0,1,2, that is, the hierarchy of layer 0, layer 1 and layer 2 is 0,1,2.
The blank layer may also be referred to as a palette layer.
In a possible implementation, a specific layer and a plurality of first layers that need to be synthesized may be obtained first, and then a blank layer may be created according to layer information of the specific layer.
Before the plurality of first layers are subjected to synthesis processing, a blank layer can be created according to layer information of a specific layer; or when a plurality of first layers are subjected to synthesis processing, a blank layer may be created according to layer information of a specific layer.
In a possible implementation, a specific layer, a blank layer and a plurality of first layers that need to be synthesized may be obtained first, and then, the layer information of the blank layer may be modified according to the layer information of the specific layer.
Before the synthesis processing is performed on the plurality of first layers, modifying the layer information of the blank white layer according to the layer information of the specific layer; or when a plurality of first layers are subjected to synthesis processing, modifying the layer information of the blank white layer according to the layer information of the specific layer.
The finally obtained layer information of the blank layer is the same as that of the specific layer, and the only difference is the color value of each pixel point. That is to say, the layer information of the blank layer is the same as that of the second layer, and the only difference is the color value of each pixel point.
The layer information may refer to information such as a size, a hierarchy, and a transparency value of a layer.
In a possible implementation, after the specific layer is obtained, specific processing needs to be performed on the specific layer to obtain the second layer.
In a possible implementation, the specific processing of the specific layer and the synthesizing processing of the plurality of first layers may be executed simultaneously or may not be executed simultaneously, which is not limited in this application.
S202, synthesizing the plurality of first layers and the blank layer to obtain a first synthesized layer.
The blank layer and the plurality of first layers may be sent to a GPU, a 2D accelerator, or an OSD channel in a DPU for synthesis processing.
The compositing process may be an alpha blending (alpha blending) process.
The composition processing may refer to composition sequentially in order from the lower level to the higher level of the layer.
For example, if there are three layers, the levels are 0,1 and 2, the layer with level 0 and the layer with level 1 may be synthesized to obtain a synthesized layer 1; and then, synthesizing the layer with the level 2 with the synthesized layer 1 to obtain a synthesized layer 2.
Before the synthesis processing, the pixel position of the pixel point of each layer on the display screen needs to be judged, and during the synthesis processing, the color value of the pixel point in the same pixel position of the display screen in the multiple layers is synthesized.
And S203, overlapping the first synthesized layer and the second synthesized layer to obtain a second synthesized layer.
The color values of the pixel points in the same pixel position of the display screen in the first synthesized layer and the second synthesized layer may be subjected to superposition processing.
The first synthesized layer and the second layer may be subjected to an overlay process using a DPU.
In the embodiment shown in fig. 2, a second layer and a plurality of first layers are obtained, where the second layer is a layer subjected to specific processing, and a hierarchy of the second layer is located between hierarchies of the plurality of first layers; creating a blank layer, wherein the hierarchy of the blank layer is the same as that of the second layer, and the color value of a pixel point in the blank layer is a preset value; synthesizing the plurality of first layers and the blank layers to obtain first synthesized layers; and overlapping the first synthesized layer and the second synthesized layer to obtain a second synthesized layer. By adding the blank layer, the problem that the levels of the plurality of first layers are discontinuous can be solved, and the technical problem that the plurality of layers cannot be synthesized is further solved; meanwhile, because the color values of the pixel points in the blank layers are preset values, the color values of the first synthesized layer are only the synthesized values of the color values of the plurality of first layers, and then the color values of the first synthesized layer and the color values of the second layer are used for superposition processing, so that the correctness of the finally synthesized color values of the second synthesized layer can be ensured.
On the basis of the embodiment shown in fig. 2, the following describes the process of layer composition in detail with reference to fig. 4.
Fig. 4 is a schematic flowchart of another layer composition method according to an embodiment of the present application. Referring to fig. 4, the method may include:
s401, obtaining a second layer, a blank layer and a plurality of first layers.
It should be noted that the execution process of S401 may refer to the execution process of S201, and is not described herein again.
S402, at least one first layer in front of the blank layer in the hierarchy is subjected to synthesis processing to obtain a third synthesized layer.
A hierarchy that precedes the hierarchy of the whitespace layer may be represented as a hierarchy that is less than the hierarchy of the whitespace layer.
If the number of the first layers with the levels before the level of the blank layer is 1, the first layers with the levels before the level of the blank layer can be directly used for the next step without synthesis.
If the number of the first layers before the level of the blank layer is multiple, alpha blending may be performed on the multiple first layers sequentially from low to high according to the level of the layers, so as to obtain a third composite layer.
Before alpha blending, transparency values of each layer need to be set, and the transparency values can be expressed as alpha values.
And carrying out alpha mixing on the color values of the pixel points at the same pixel position of the display screen in each layer according to the transparency value.
And S403, synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer.
In a possible implementation, the third synthesized layer and the blank layer may be synthesized in the following manner to obtain a fourth synthesized layer:
acquiring a first transparency value of a third synthetic layer and a second transparency value of a blank layer, wherein the second transparency value is the transparency value of the second layer; and determining the color value of each pixel point in the fourth synthetic layer according to the first transparency value, the color value of each pixel point in the third synthetic layer, the second transparency value and the color value of each pixel point in the blank layer.
In a possible implementation, determining, for any one first pixel point in the third synthesized layer, a color value of each pixel point in the fourth synthesized layer according to the first transparency value, the color value of each pixel point in the third synthesized layer, the second transparency value, and the color value of each pixel point in the blank layer, includes:
determining a second pixel point in the blank layer, wherein the pixel position of the second pixel point is the same as the pixel position of the first pixel point on the display screen; and determining the color value of a third pixel point according to the product of the color value of the first pixel point and the first transparency value and the sum of the product of the color value of the second pixel point and the second transparency value, wherein the third pixel point is a pixel point in a fourth synthetic layer, and the pixel positions of the third pixel point and the first pixel point on the display screen are the same.
In a possible implementation, the color value of each pixel point in the fourth synthesized layer may be determined by the following formula: (1- α 1) × p0+ α 1*P Air conditioner
Wherein α 1 is the second transparency value of the blank layer, (1- α 1) is the first transparency value of the third synthesized layer, P0 is the color value of a certain first pixel point in the third synthesized layer, and P Air conditioner And the color value of a second pixel point in the blank layer corresponding to the position of the first pixel point in the third synthesized layer is obtained.
In the step, only the color value of the pixel point in the third synthetic layer is calculated, but the color value of the pixel point in the blank layer is not calculated, and P can be calculated Air conditioner The setting is implemented as 0, that is, the color value = (1- α 1) × p0 of each pixel point in the fourth composition layer.
S404, synthesizing the fourth synthesized image layer and at least one first image layer which is positioned behind the blank image layer in the hierarchy of the fourth synthesized image layer to obtain a first synthesized image layer.
A level after a level of a blank layer may also be represented as a level greater than the level of the blank layer
If the number of the first layers with the levels behind the level of the blank layer is 1, the color value of each pixel point in the first synthesized layer can be determined by the following formula: (1- α 2) (1- α 1) × p0+ α 2 × p2.
Wherein α 1 is a second transparency value of a blank layer, (1- α 1) is a first transparency value of a third synthetic layer, α 2 is a transparency value of a layer 2, p0 is a color value of a certain first pixel point in the third synthetic layer, and p2 is a color value of a pixel point corresponding to a pixel point position in a fourth synthetic layer in the layer 2; wherein, the layer 2 is a first layer whose hierarchy is behind the hierarchy of the blank layer.
If the number of the first layers after the level of the blank layer is multiple, alpha blending may be performed on the fourth synthesized layer and the multiple first layers in sequence from low to high according to the level of the layers, so as to obtain the first synthesized layer.
S405, overlapping the first synthetic image layer and the second image layer to obtain a second synthetic image layer.
In one possible implementation, the second synthesis layer may be obtained by:
acquiring a second transparency value of the second layer and a third transparency value of the fifth synthetic layer; and determining the color value of each pixel point in the second synthetic layer according to the color value of each pixel point in the first synthetic layer, the second transparency value, the third transparency value and the color value of each pixel point in the second synthetic layer.
And the fifth synthetic image layer is obtained by synthesizing at least one first image layer with a hierarchy behind the hierarchy of the second image layer.
If the number of the first layers with the hierarchy behind the hierarchy of the second layer is 1, the first layers may be referred to as top layers, and the transparency value of the top layers may be directly used as the third transparency value.
If the number of the first layers with the hierarchies behind the hierarchy of the second layer is multiple, the first layers with the hierarchies behind the hierarchy of the second layer may be synthesized to obtain a fifth synthesized layer, and then the third transparency value of the fifth synthesized layer is determined.
In a possible implementation, for any fourth pixel point in the first synthesized layer, determining the color value of each pixel point in the second synthesized layer according to the color value of each pixel point in the first synthesized layer, the second transparency value, the third transparency value, and the color value of each pixel point in the second layer, includes:
determining a fifth pixel point in the second layer, wherein the pixel positions of the fifth pixel point and the fourth pixel point on the display screen are the same; determining a fourth transparency value according to the third transparency value, wherein the sum of the fourth transparency value and the third transparency value is equal to 1; determining the color value of the sixth pixel point according to the product of the fourth transparency value, the second transparency and the color value of the fifth pixel point and the sum of the color values of the fourth pixel point; and the sixth pixel point is a pixel point in the second synthesized layer, and the pixel position of the sixth pixel point and the pixel position of the fourth pixel point on the display screen are the same.
In one possible implementation, the color value of each pixel point in the second synthesized layer may be determined by the following formula: blend _ out0+ (1- α 3) × α 1 × p1; α 1 is a second transparency value of the second layer, α 3 is a third transparency value of the fifth synthesis layer, and (1- α 3) is a fourth transparency value, p1 is a color value of a fifth pixel in the second layer, and blend _ out0 is a color value of a fourth pixel in the first synthesis layer, where the fifth pixel and the fourth pixel have the same pixel position on the display screen.
And on the basis of the color value of the fourth pixel point in the first synthesized layer, adding the product of the color value of the fifth pixel point corresponding to the fourth pixel point in the second layer, the transparency value of the second layer and the transparency value of the layer with the hierarchy behind the second layer, and calculating the color value of the pixel point in the final synthesized layer so as to ensure the correctness of the color value of the pixel point in the final synthesized layer.
In a possible implementation, the obtaining the second synthesized layer by performing the overlay processing on the first synthesized layer and the second layer in the following manner includes:
determining a seventh pixel point in the first synthesized layer; if no pixel point with the same pixel position as the seventh pixel point on the display screen exists in the second layer, determining the color value of the seventh pixel point as the color value of the eighth pixel point; and the eighth pixel point is a pixel point in the second synthesized layer, and the pixel position of the eighth pixel point is the same as the pixel position of the seventh pixel point on the display screen.
In the embodiment shown in fig. 4, a second layer, a blank layer, and multiple first layers are obtained, where the second layer is a layer subjected to specific processing, and a hierarchy of the second layer is located between hierarchies of the multiple first layers; synthesizing at least one first layer which is hierarchically before the blank layer to obtain a third synthesized layer; synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer; synthesizing the fourth synthesized image layer and at least one first image layer at the level behind the blank image layer to obtain a first synthesized image layer; and overlapping the first synthesized layer and the second synthesized layer to obtain a second synthesized layer. By adding the blank layer, the problem that the levels of the plurality of first layers are discontinuous can be solved, and the technical problem that the plurality of layers cannot be synthesized is further solved; meanwhile, because the color values of the pixel points in the blank layers are preset values, the color values of the first synthesized layers are only the synthesized values of the color values of the plurality of first layers, and then the color values of the first synthesized layers and the color values of the second layers are used for superposition processing, so that the accuracy of the color values of the second synthesized layers which are finally synthesized can be ensured.
For ease of understanding, the following takes the example of three layers composing the second composed layer, and the layer composition process is described in detail.
The three layers are sequentially a layer 0, a layer 1 and a layer 2 according to the sequence from low to high, wherein the color value of the pixel point of the layer 0 is represented by P0, the color value of the pixel point of the layer 1 is represented by P1, the transparency value of the layer 1 is represented by alpha 1, the color value of the pixel point of the layer 2 is represented by P2, and the transparency value of the layer 2 is represented by alpha 2; the layer 1 is a layer subjected to specific processing.
S1, constructing 1 blank layer.
The transparency value of the blank layer is equal to that of the layer 1, the color value of the pixel point of the blank layer is set to be 0, and the level of the blank layer is the same as that of the layer 1.
And S2, carrying out alpha mixing processing on the blank layer and the layer 0 to obtain a synthetic layer 1.
The color values = (1- α 1) × p0+ α 1*0= (1- α 1) × p0 at the pixels in the composition layer 1.
And S3, carrying out alpha mixing processing on the synthetic image layer 1 and the image layer 2 to obtain a synthetic image layer 2.
The color values = (1- α 2) × (1- α 1) × p0+ α 2 × p2 of the pixels of the composition layer 2.
And S4, firstly carrying out PQ processing on the layer 1, and then carrying out superposition processing on the layer 1 and the synthetic layer 2 to obtain a synthetic layer 3.
The color values = (1- α 2) × (1- α 1) × p0+ α 2 × p2+ (1- α 2) × α 1 × p1 of the pixels of the synthesized layer 3.
It should be noted that the pixel points in the different layers all refer to pixel points with the same pixel position on the display screen.
Fig. 5 is a schematic structural diagram of a layer composition apparatus according to an embodiment of the present disclosure. Referring to fig. 5, the apparatus 10 includes an acquisition module 11, a synthesis processing module 12, and a superposition processing module 13, wherein,
the obtaining module 11 is configured to obtain a second layer, a blank layer and a plurality of first layers, where the second layer is a layer subjected to specific processing, the second layer is located between the plurality of first layers, the level of the blank layer is the same as that of the second layer, and a color value of a pixel point in the blank layer is a preset value;
a synthesis processing module 12, configured to perform synthesis processing on the plurality of first layers and the blank layer to obtain a first synthesis layer;
and the superposition processing module 13 is configured to perform superposition processing on the first synthesized layer and the second synthesized layer to obtain a second synthesized layer.
In a possible implementation, the synthesis processing module 12 is specifically configured to:
performing synthesis processing on at least one first layer which is hierarchically in front of the blank layer to obtain a third synthesized layer;
synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer;
and synthesizing the fourth synthesized image layer and at least one first image layer which is positioned behind the blank image layer at the hierarchy level to obtain the first synthesized image layer.
In a possible embodiment, the synthesis processing module 12 is specifically configured to:
acquiring a first transparency value of the third synthesized layer and a second transparency value of the blank layer, wherein the second transparency value is a transparency value of the second layer;
and determining the color value of each pixel point in the fourth synthesized layer according to the first transparency value, the color value of each pixel point in the third synthesized layer, the second transparency value and the color value of each pixel point in the blank layer.
In a possible implementation manner, for any one first pixel point in the third synthesized layer, the synthesis processing module 13 is specifically configured to:
determining a second pixel point in the blank layer, wherein the pixel position of the second pixel point is the same as the pixel position of the first pixel point on the display screen;
and determining the color value of a third pixel point according to the product of the color value of the first pixel point and the first transparency value and the sum of the product of the color value of the second pixel point and the second transparency value, wherein the third pixel point is a pixel point in the fourth synthetic layer, and the pixel positions of the third pixel point and the first pixel point on the display screen are the same.
In a possible implementation, the superimposition processing module 13 is specifically configured to:
acquiring a second transparency value of the second layer and a third transparency value of a fifth synthetic layer, wherein the fifth synthetic layer is obtained by synthesizing at least one first layer with a hierarchy behind the hierarchy of the second layer;
and determining the color value of each pixel point in the second synthetic layer according to the color value of each pixel point in the first synthetic layer, the second transparency value, the third transparency value and the color value of each pixel point in the second synthetic layer.
In a possible implementation manner, for any fourth pixel point in the first synthesized layer, the overlap processing module 13 is specifically configured to:
determining a fifth pixel point in the second layer, wherein the pixel position of the fifth pixel point is the same as the pixel position of the fourth pixel point on the display screen;
determining the fourth transparency value according to the third transparency value, wherein the sum of the fourth transparency value and the third transparency value is equal to 1;
determining the color value of a sixth pixel point according to the product of the fourth transparency value, the second transparency and the color value of the fifth pixel point and the sum of the color values of the fourth pixel point;
and the sixth pixel point is a pixel point in the second synthesized layer, and the pixel position of the sixth pixel point is the same as the pixel position of the fourth pixel point on the display screen.
In a possible implementation, the superposition processing module 13 is specifically configured to:
determining a seventh pixel point in the first synthesized layer;
if no pixel point with the same pixel position as the seventh pixel point on the display screen exists in the second image layer, determining the color value of the seventh pixel point as the color value of an eighth pixel point;
the eighth pixel point is a pixel point in the second synthesized layer, and the pixel position of the eighth pixel point is the same as the pixel position of the seventh pixel point on the display screen.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 6, the electronic device 20 may include: a transceiver 21, a memory 22, a processor 23. The transceiver 21 may include: a transmitter and/or a receiver. The transmitter may also be referred to as a sender, a transmitter, a sending port or a sending interface, and the like, and the receiver may also be referred to as a receiver, a receiving port or a receiving interface, and the like. The transceiver 321, the memory 22, and the processor 23 are illustratively connected to each other via a bus 24.
The memory 22 is used for storing program instructions;
the processor 23 is configured to execute the program instructions stored in the memory, so as to enable the electronic device 20 to execute any one of the image layer synthesizing methods shown above.
The transceiver 21 is configured to perform a transceiving function of the electronic device 20 in the layer composition method.
The electronic device 20 may be a chip, a module, an Integrated Development Environment (IDE), or the like.
An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the computer-readable storage medium is used for implementing the layer composition method.
Embodiments of the present application further provide a computer program product, where the computer program product may be executed by a processor, and when the computer program product is executed, the above image layer synthesis method may be implemented.
The embodiment of the application provides a chip, wherein a computer program is stored on the chip, and when the computer program is executed by the chip, the layer composition method is realized.
In one possible embodiment, the chip is a chip in a chip module.
The layer synthesis apparatus, the electronic device, the computer-readable storage medium, and the computer program product according to the embodiments of the application may implement the technical solutions shown in the above layer synthesis method embodiments, and their implementation principles and beneficial effects are similar, which are not described herein again.
All or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The aforementioned program may be stored in a readable memory. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only Memory (ROM), random Access Memory (RAM), flash Memory, hard Disk, solid state Disk, magnetic Tape (Magnetic Tape), floppy Disk (flexible Disk), optical Disk (Optical Disk), and any combination thereof.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to encompass such modifications and variations.

Claims (11)

1. A method for layer composition, comprising:
acquiring a second layer, a blank layer and a plurality of first layers, wherein the second layer is subjected to specific processing, the hierarchy of the second layer is located between the hierarchies of the plurality of first layers, the hierarchy of the blank layer is the same as the hierarchy of the second layer, and the color value of a pixel point in the blank layer is a preset value;
synthesizing the plurality of first layers and the blank layer to obtain a first synthesized layer;
and overlapping the first synthesized layer and the second synthesized layer to obtain a second synthesized layer.
2. The method according to claim 1, wherein synthesizing the plurality of first layers and the blank layer to obtain a first synthesized layer comprises:
performing synthesis processing on at least one first layer which is hierarchically in front of the blank layer to obtain a third synthesized layer;
synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer;
and synthesizing the fourth synthesized image layer and at least one first image layer which is positioned behind the blank image layer at the hierarchy level to obtain the first synthesized image layer.
3. The method according to claim 2, wherein synthesizing the third synthesized layer and the blank layer to obtain a fourth synthesized layer comprises:
acquiring a first transparency value of the third synthesized layer and a second transparency value of the blank layer, wherein the second transparency value is a transparency value of the second layer;
and determining the color value of each pixel point in the fourth synthetic layer according to the first transparency value, the color value of each pixel point in the third synthetic layer, the second transparency value and the color value of each pixel point in the blank layer.
4. The method according to claim 3, wherein determining, for any first pixel point in the third synthesized layer, a color value of each pixel point in the fourth synthesized layer according to the first transparency value, the color value of each pixel point in the third synthesized layer, the second transparency value, and the color value of each pixel point in the blank layer comprises:
determining a second pixel point in the blank layer, wherein the pixel position of the second pixel point is the same as the pixel position of the first pixel point on the display screen;
and determining the color value of a third pixel point according to the product of the color value of the first pixel point and the first transparency value and the sum of the product of the color value of the second pixel point and the second transparency value, wherein the third pixel point is a pixel point in the fourth synthetic layer, and the pixel positions of the third pixel point and the first pixel point on the display screen are the same.
5. The method according to any one of claims 1 to 4, wherein performing an overlay process on the first synthesized layer and the second layer to obtain a second synthesized layer includes:
acquiring a second transparency value of the second layer and a third transparency value of a fifth synthetic layer, wherein the fifth synthetic layer is obtained by synthesizing at least one first layer with a hierarchy behind the hierarchy of the second layer;
and determining the color value of each pixel point in the second synthetic layer according to the color value of each pixel point in the first synthetic layer, the second transparency value, the third transparency value and the color value of each pixel point in the second synthetic layer.
6. The method according to claim 5, wherein determining, for any fourth pixel point in the first synthesized layer, a color value of each pixel point in the second synthesized layer according to the color value of each pixel point in the first synthesized layer, the second transparency value, the third transparency value, and the color value of each pixel point in the second layer, comprises:
determining a fifth pixel point in the second layer, wherein the pixel position of the fifth pixel point is the same as the pixel position of the fourth pixel point on the display screen;
determining the fourth transparency value according to the third transparency value, wherein the sum of the fourth transparency value and the third transparency value is equal to 1;
determining the color value of a sixth pixel point according to the product of the fourth transparency value, the second transparency and the color value of the fifth pixel point and the sum of the color values of the fourth pixel point;
and the sixth pixel point is a pixel point in the second synthesized layer, and the pixel position of the sixth pixel point is the same as the pixel position of the fourth pixel point on the display screen.
7. The method according to any one of claims 1 to 4, wherein superimposing the first synthesized layer and the second layer to obtain a second synthesized layer comprises:
determining a seventh pixel point in the first synthesized layer;
if no pixel point with the same pixel position as the seventh pixel point on the display screen exists in the second image layer, determining the color value of the seventh pixel point as the color value of an eighth pixel point;
the eighth pixel point is a pixel point in the second synthesized layer, and the pixel position of the eighth pixel point is the same as the pixel position of the seventh pixel point on the display screen.
8. The layer composition device is characterized by comprising an acquisition module, a composition processing module and an overlay processing module, wherein,
the acquiring module is used for acquiring a second layer, a blank layer and a plurality of first layers, wherein the second layer is subjected to specific processing, the second layer is located among the plurality of first layers, the level of the blank layer is the same as that of the second layer, and the color value of a pixel point in the blank layer is a preset value;
the synthesis processing module is configured to perform synthesis processing on the plurality of first image layers and the blank image layer to obtain a first synthesis image layer;
and the superposition processing module is used for carrying out superposition processing on the first synthetic image layer and the second image layer to obtain a second synthetic image layer.
9. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored by the memory causes the processor to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, perform the method of any one of claims 1 to 7.
11. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202211336795.4A 2022-10-28 2022-10-28 Layer composition method and device, electronic equipment and storage medium Pending CN115700734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211336795.4A CN115700734A (en) 2022-10-28 2022-10-28 Layer composition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211336795.4A CN115700734A (en) 2022-10-28 2022-10-28 Layer composition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115700734A true CN115700734A (en) 2023-02-07

Family

ID=85120948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211336795.4A Pending CN115700734A (en) 2022-10-28 2022-10-28 Layer composition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115700734A (en)

Similar Documents

Publication Publication Date Title
US8619092B2 (en) Image processing apparatus and graphics memory unit
US5923333A (en) Fast alpha transparency rendering method
JP3885262B2 (en) Method for mixing a plurality of pixels on a texture map, and a plurality of pixel mixing circuit and image processing apparatus using the same
US10389995B2 (en) Apparatus and method for synthesizing additional information while rendering object in 3D graphic-based terminal
JP4240395B2 (en) Image composition apparatus, electronic device, image composition method, control program, and readable recording medium
CN104461573B (en) A kind of control process method of view level
CN104361556A (en) Image synthesis method, image chip and image equipment
CN103680470A (en) Large screen control image display method and system
CN110913262A (en) Image superposition method and device
TW201439969A (en) Rendering method and device
US20240357055A1 (en) Frame Interpolation Method and Apparatus, and Electronic Device
CN111754607A (en) Picture processing method and device, electronic equipment and computer readable storage medium
US6275241B1 (en) High speed image drawing apparatus for displaying three dimensional images
CN112053419B (en) Image superposition processing method and device, storage medium and electronic device
CN103513947B (en) The method and information processing system of information processing
US20190043249A1 (en) Method and apparatus for blending layers within a graphics display component
EP1408453A1 (en) Rendering method
CN115700734A (en) Layer composition method and device, electronic equipment and storage medium
JP2018537870A (en) Color gamut mapping method and apparatus
US20090184977A1 (en) Multi-format support for surface creation in a graphics processing system
CN108093245A (en) A kind of Multiple-screen integration method, system, device and computer readable storage medium
CN104142758B (en) A kind of embedded window management method and device
US20230214963A1 (en) Data processing method and apparatus, and electronic device
JP2003173453A (en) Drawing processing method, its device, semiconductor device, drawing processing program, and storage medium
JP3068590B1 (en) Two-dimensional image processing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination