CN113791861A - Window fuzzy transparent display method and device, electronic equipment and storage medium - Google Patents

Window fuzzy transparent display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113791861A
CN113791861A CN202111352196.7A CN202111352196A CN113791861A CN 113791861 A CN113791861 A CN 113791861A CN 202111352196 A CN202111352196 A CN 202111352196A CN 113791861 A CN113791861 A CN 113791861A
Authority
CN
China
Prior art keywords
window
transparent area
data
fuzzy
fuzzy transparent
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.)
Granted
Application number
CN202111352196.7A
Other languages
Chinese (zh)
Other versions
CN113791861B (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing Jingling Information System 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 Beijing Jingling Information System Technology Co Ltd filed Critical Beijing Jingling Information System Technology Co Ltd
Priority to CN202111352196.7A priority Critical patent/CN113791861B/en
Publication of CN113791861A publication Critical patent/CN113791861A/en
Application granted granted Critical
Publication of CN113791861B publication Critical patent/CN113791861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a window fuzzy transparent display method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: in the process of drawing a frame of a first window, determining that the first window has a fuzzy transparent area; determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the fuzzy transparent area information is used for describing the range of the fuzzy transparent area in the first window; and drawing the frame of the first window according to the data of the fuzzy transparent area. The window fuzzy transparent display method, the window fuzzy transparent display device, the electronic equipment and the storage medium can carry out fuzzy transparent display on partial areas of windows, and the problem that local fuzziness cannot be realized by an application with local fuzziness requirements among the windows is solved.

Description

Window fuzzy transparent display method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computer display, in particular to a window fuzzy transparent display method and device, electronic equipment and a storage medium.
Background
The window fuzzy transparent display is a display mode that a window with a lower position is seen in an upper window through the positions of two overlapped windows in a display interface of an operating system. This display system is also called a ground glass display system because it exhibits a transparent ground glass effect.
In the prior art, only the whole window can be subjected to window fuzzy transparent display. However, in practical applications, there is a need to perform a blurred transparent display only on a partial area of the window. The prior art fails to address this need.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a window fuzzy transparent display method, a device, electronic equipment and a storage medium.
The invention provides a window fuzzy transparent display method, which comprises the following steps:
in the process of drawing a frame of a first window, determining that the first window has a fuzzy transparent area;
determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and drawing the frame of the first window according to the data of the fuzzy transparent area.
According to the window fuzzy transparent display method provided by the invention, the data of the fuzzy transparent area in the first window is determined according to the previously received fuzzy transparent area information, and the method comprises the following steps:
judging whether the data of the fuzzy transparent area in the first window changes or not according to the pre-received fuzzy transparent area information;
under the condition of change, acquiring data to be processed of a first window and data to be processed of a second window according to the information of the fuzzy transparent area; the data to be processed in the first window is original data of a fuzzy transparent area in the first window, and the data to be processed in the second window is data of an area corresponding to the fuzzy transparent area in the second window; the second window is a window which has an overlapping relation with the first window, and the first window is a window at the upper position and the second window is a window at the lower position;
and calculating the data of the fuzzy transparent area in the first window according to the data to be processed of the first window and the data to be processed of the second window.
According to the window fuzzy transparent display method provided by the invention, the judging whether the data of the fuzzy transparent area in the first window changes or not comprises the following steps:
and when the data to be processed of the first window changes and/or the data to be processed of the second window changes, determining that the data of the fuzzy transparent area in the first window changes.
According to the window fuzzy transparent display method provided by the invention, the data of the fuzzy transparent area in the first window is determined according to the previously received fuzzy transparent area information, and the method comprises the following steps:
judging whether the data of the fuzzy transparent area in the first window changes or not according to the pre-received fuzzy transparent area information;
and in the case of no change, taking the previously stored data of the fuzzy transparent area in the first window as the data of the fuzzy transparent area in the current first window.
According to the window fuzzy transparent display method provided by the invention, the method further comprises the following steps:
a command containing information of the obscured transparent areas is received before drawing the frame of the first window.
According to the window fuzzy transparent display method provided by the invention, the command containing the fuzzy transparent area information is realized by extending the Wayland protocol.
According to the window fuzzy transparent display method provided by the invention, after the data of the fuzzy transparent area in the first window is determined, the method further comprises the following steps:
storing data of the obscured transparent areas in the first window.
According to the window fuzzy transparent display method provided by the invention, after the data of the fuzzy transparent area in the first window is stored, the method further comprises the following steps:
and deleting the stored data of the fuzzy transparent area in the first window according to the received closing command of the first window.
According to the window fuzzy transparent display method provided by the invention, after the data of the fuzzy transparent area in the first window is stored, the method further comprises the following steps:
deleting the stored data of the designated fuzzy transparent area in the first window according to the received emptying command of the designated fuzzy transparent area in the first window.
The invention also provides a window fuzzy transparent display device, which comprises:
the device comprises a fuzzy transparent area determining module, a fuzzy transparent area determining module and a fuzzy transparent area determining module, wherein the fuzzy transparent area determining module is used for determining that a fuzzy transparent area exists in a first window in the process of drawing a frame of the first window;
the fuzzy transparent area data determining module is used for determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and the frame drawing module is used for drawing the frame of the first window according to the data of the fuzzy transparent area.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the window fuzzy transparent display method.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the window fuzzy transparent display method as described.
According to the window fuzzy transparent display method, device, electronic equipment and storage medium, the range of the fuzzy transparent area is set in the window to be drawn, so that the data of the fuzzy transparent area are obtained, and finally the drawing of the fuzzy transparent area is realized in the process of drawing the window. The invention can carry out fuzzy transparent display on partial areas of the windows, and overcomes the problem that the application with the local fuzzy requirement between the windows can not realize the local fuzzy.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a window fuzzy transparent display method provided by the present invention;
FIG. 2 is a schematic structural diagram of a window-obscuring transparent display apparatus according to the present invention;
fig. 3 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a display interface of a computer operating system such as Windows and Linux, or in a display interface of an intelligent terminal operating system such as iOS and Android, when two Windows are overlapped in position, a window positioned below can be seen through an upper window in position, and such a display mode is called as a transparent window (or a semitransparent window). On the basis of the transparent display mode, fuzzy transparency can be realized. The mode in which the blur transparent display window performs a blur transparent display is also referred to as a frosted glass display mode because the blur transparent window performs a frosted glass effect during a display process.
The principle of the fuzzy transparent display of the window is as follows: and taking the values of the pixels around the pixel and calculating the average value according to the fuzzy range of each pixel in the foreground image corresponding to the upper window and the background image corresponding to the lower window, taking the calculated average value as the value of the pixel, finally fusing the pixels at the corresponding positions in the foreground image and the background image, and replacing the value of the pixel at the corresponding position in the foreground image with the fused result.
For exampleAnd a certain pixel point in the foreground image corresponding to the upper window in the overlapping windowaThe fuzzy range includes 8 pixels around the fuzzy rangea1、a2、a3、a4、a5、a6、a7、a8. According to pixel pointaAnd the respective pixel values of the peripheral 8 pixel points, and an average value can be calculated
Figure 696691DEST_PATH_IMAGE001
(ii) a Similarly, the same position pixel point in the background image corresponding to the lower window with the position in the overlapped window can be calculatedbAverage value of (2)
Figure 901408DEST_PATH_IMAGE002
. Then to the average value
Figure 772412DEST_PATH_IMAGE001
And average value
Figure 378974DEST_PATH_IMAGE002
Fusing (e.g. calculating the average value of the two), and obtaining the result
Figure 310021DEST_PATH_IMAGE003
Replacement pixela. The above operation is repeatedly performed on a plurality of pixel points positioned in the upper window, and the window mode display can be realized.
In the prior art, only the whole window can be subjected to inter-window fuzzy transparent display. However, in practical applications, there is a need to perform a blurred transparent display only on a partial area of the window. The prior art fails to address this need.
In addition, when the window blurred transparent display is realized, data of the blurred transparent area needs to be calculated. This computational process consumes a great deal of computer power, which can result in reduced fluency of the operating system.
The window fuzzy transparent display method, device, electronic equipment and storage medium of the present invention are described below with reference to fig. 1 to 3.
Fig. 1 is a flowchart of a window fuzzy transparent display method provided by the present invention, as shown in fig. 1, the method includes:
step 101, in the process of drawing the frame of the first window, determining that the first window has a fuzzy transparent area.
The window fuzzy transparent display method provided by the invention is applied to a window manager. The window manager is a program for managing windows in the operating system, and can draw the windows, determine the positions of the windows in the main interface of the operating system, and provide an interface for operating the window program for a user.
In this embodiment, the first window is any one of the windows to be drawn. The size and position of the first window and the type of the corresponding application are not limited in this embodiment.
The blurred transparent area is an area displayed in the blurred transparent display manner in the first window. The shape and size of the opaque region are not limited in this embodiment. Generally, the opaque transparent regions are rectangular, but in other embodiments, they may be circular, semi-circular, triangular, hexagonal, star-shaped, and the like. The fuzzy transparent area can be the whole window or a partial area of the window.
When drawing the frame corresponding to the first window, the window manager needs to determine whether a fuzzy transparent area exists in the first window. If the fuzzy transparent area exists, the first window is indicated to be in a frosted glass state when at least one part of the area is displayed, and if the fuzzy transparent area does not exist, the first window can be normally displayed.
The determination of whether the first window has a blurred transparent area may be based on two conditions. The condition is that whether the first window to be drawn overlaps with the other drawn windows or not; the second condition is whether a fuzzy transparent display mode is set in the attribute information of the first window. Only if both conditions are met can it be determined that the first window has a blurred transparent area.
It can be known from the principle of window fuzzy transparent display that a precondition that window fuzzy transparent display can occur is that two windows with overlapped positions exist, and therefore, it is necessary to determine whether a first window overlaps with other drawn windows at the overlapped positions. However, the overlapping of the first window and other drawn windows does not mean that the first window inevitably generates the phenomenon that the windows are blurred and transparent. For example, when the first window overlaps with other windows in position, the first window may also be a position overlapping portion that covers other windows that have been drawn. Therefore, it is necessary to set a blur transparent display mode in the attribute information of the first window. Only when the fuzzy transparent display mode is started, the first window can be drawn in the fuzzy transparent display mode.
It should be noted that, in this step, it is only necessary to determine whether the first window has the blurred transparent area, and it is not necessary to determine the specific position of the blurred transparent area.
And step 102, determining data of the fuzzy transparent area in the first window according to the pre-received fuzzy transparent area information.
In this embodiment, the blurred transparent area information is used to describe the range of the blurred transparent area in the first window. The range includes both the shape and the size of the obscured transparent area.
The specific expression of the fuzzy transparent area information is related to the shape of the fuzzy transparent area. Taking the most common rectangle as an example, when the blurred transparent area is a rectangle, the blurred transparent area information may include coordinate values (x, y) of the upper left corner of the rectangle, a width value width of the rectangle, and a height value height of the rectangle. The coordinate value may be a coordinate value in a main interface coordinate system of the operating system, for example, the main interface coordinate system of the operating system is a coordinate system with a point at the lower left corner of the main interface of the operating system as an origin; or coordinate values in a coordinate system of the first window to be drawn, for example, the coordinate system of the first window is a coordinate system with a point at the lower left corner of the first window to be drawn as an origin. In the present embodiment, the coordinate system to which the coordinate values belong is not limited. The transformation of coordinate values in different coordinate systems can be realized by coordinate transformation by those skilled in the art.
The fuzzy transparent area information can be obtained from the outside in advance, such as by means of a command. In this embodiment, the manner of acquiring the blur transparent area information is not limited.
From the blurred transparent area information, an extent of the blurred transparent area in the first window may be determined. According to the principle of the fuzzy transparent display, the data of the fuzzy transparent area in the first window can be obtained. The data of the blurred transparent area describes the value of each pixel within the range of the blurred transparent area, so that the blurred transparent area can be rendered in a subsequent step based on the data of the blurred transparent area.
It should be noted that the number of the blurred transparent areas in the first window is not limited to one. And under the condition that the number of the fuzzy transparent areas is more than one, acquiring fuzzy transparent area information corresponding to each fuzzy transparent area, and further determining data of the fuzzy transparent areas corresponding to each fuzzy transparent area.
And 103, drawing the frame of the first window according to the data of the fuzzy transparent area.
In a previous step, data of the blurred transparent areas in the first window have been obtained, from which data the frames of the first window may be drawn in this step.
Specifically, when the first window is a fuzzy transparent area, the whole first window can be drawn according to the data of the fuzzy transparent area; when one part of the first window is a fuzzy transparent area and the other part is a normal display area, the fuzzy transparent area in the first window can be drawn according to the data of the fuzzy transparent area, and the normal display area (namely, the non-fuzzy transparent display part) of the first window can be drawn according to the original data corresponding to the first window.
How to draw the frame of the first window from the data is common knowledge of a person skilled in the art and therefore the description is not repeated here.
According to the window fuzzy transparent display method, the range of the fuzzy transparent area is set in the window to be drawn, so that the data of the fuzzy transparent area are obtained, and finally the drawing of the fuzzy transparent area is realized in the process of drawing the window. The window fuzzy transparent display method provided by the invention can be used for carrying out fuzzy transparent display on partial areas of windows, and the problem that local fuzziness cannot be realized by an application with local fuzziness requirements among windows is solved.
Based on any one of the foregoing embodiments, in this embodiment, the determining data of the blurred transparent area in the first window according to the previously received blurred transparent area information includes:
judging whether the data of the fuzzy transparent area in the first window changes or not according to the pre-received fuzzy transparent area information;
under the condition of change, acquiring data to be processed of a first window and data to be processed of a second window according to the information of the fuzzy transparent area; the data to be processed in the first window is original data of a fuzzy transparent area in the first window, and the data to be processed in the second window is data of an area corresponding to the fuzzy transparent area in the second window; the second window is a window which has an overlapping relation with the first window, and the first window is a window at the upper position and the second window is a window at the lower position;
and calculating the data of the fuzzy transparent area in the first window according to the data to be processed of the first window and the data to be processed of the second window.
In the present embodiment, a description is given of how to generate data of a blurred transparent area from the blurred transparent area information.
According to the principle of the fuzzy transparent display mode, it can be known that a large amount of calculation is needed to calculate the data of the fuzzy transparent area, so that a large amount of calculation resources are consumed. In fact, the content of the window is not necessarily changed every moment, so if the data in the fuzzy transparent area is judged once to be changed or not in the process of drawing the frame of the first window every time, and then the data in the fuzzy transparent area is calculated only under the condition of the change, the calculation amount is reduced, and the calculation resources are saved.
For this reason, in the present embodiment, first, the range of the blurred transparent area in the first window is determined based on the received blurred transparent area information. For example, the range of the blurred transparent area in the first window is determined according to the coordinate information of the blurred transparent area.
Then, after determining the range of the fuzzy transparent area in the first window, the data to be processed in the first window and the corresponding data to be processed in the second window can be obtained.
The first window to-be-processed data is original data of the fuzzy transparent area in the first window. The raw data described herein refers to data that has not been subjected to the blur transparent display process.
The second window is a window having a positional overlapping relationship with the first window, and the second window is positioned below the first window. In the blurred transparent display, the data in the background image comes from the second window. Based on the position of the fuzzy transparent area in the first window and the relative position relationship between the first window and the second window, the corresponding area of the fuzzy transparent area in the second window can be obtained. The coordinate range value of the fuzzy transparent area in the operating system main interface coordinate system should be the same as the coordinate range value of the corresponding area in the operating system main interface coordinate system. The data of the corresponding region, such as the pixel value of each pixel point in the corresponding region, is the data to be processed in the second window.
And then, judging whether the data of the fuzzy transparent area in the first window changes or not based on the obtained data to be processed of the first window and the obtained data to be processed of the second window.
Since the data of the blurred transparent area in the first window is not really obtained when this step is executed, it is not possible to directly compare the data with the data of the blurred transparent area at the previous time to determine whether the data has changed. In this embodiment, the determination is made by using the previously obtained first window data to be processed and the second window data to be processed.
Specifically, the first window to-be-processed data and the second window to-be-processed data are both temporal. For example, as the content to be displayed in the first window changes, the data to be processed in the first window at the first time may not be the same as the data to be processed in the first window at the second time. Therefore, whether the data to be processed in the first window changes or not can be judged through comparison between the data to be processed in the first window at the current moment and the data to be processed in the first window at the previous moment. Similarly, whether the data to be processed in the second window changes or not can be judged by comparing the data to be processed in the second window at the current moment with the data to be processed in the second window at the previous moment. The current time refers to the time when the current frame of the first window is drawn; the previous time instant is the time instant at which the previous frame of the first window was drawn. For example, assuming that a frame of a window is drawn every 0.02 seconds, a time 0.02 seconds earlier than the current time is the previous time.
In addition to the situation that the content displayed by the first window changes to cause the change of the data to be processed in the first window, and the content displayed by the second window changes to cause the change of the data to be processed in the second window, the data to be processed in the first window and the data to be processed in the second window may also change due to the change of the range of the fuzzy transparent area.
For example, the content displayed in the first window changes from content a to content B, which may cause the data to be processed in the first window to change. For another example, the content displayed in the second window changes from content C to content D, which may cause the data to be processed in the second window to change. For another example, the side length of the square fuzzy transparent area is enlarged from 5 cm to 10 cm, in such a case, even if the content displayed in the first window and the content displayed in the second window are not changed, the data to be processed in the first window and the data to be processed in the second window still change.
Because the data required by the window drawing is usually stored in the cache for a period of time, the data to be processed of the first window at different moments before and after and the data to be processed of the second window at different moments before and after can be conveniently obtained. The comparison of the data to be processed of the first window at different moments before and after and the comparison of the data to be processed of the second window at different moments before and after can be realized only by simple operation, such as subtraction operation, so that the operation of judging whether the data to be processed of the first window changes and the operation of judging whether the data to be processed of the second window changes can be realized only by a small amount of computing resources.
After the judgment results of whether the data to be processed in the first window changes or not and whether the data to be processed in the second window changes or not are obtained, whether the data in the fuzzy transparent area in the first window changes or not can be further judged.
According to the principle of fuzzy transparent display, the data of the fuzzy transparent area is simultaneously related to the data to be processed of the first window and the data to be processed of the second window. Therefore, as long as at least one of the first window to-be-processed data and the second window to-be-processed data is changed, the data of the blurred transparent area is changed.
It is particularly noted that if the currently rendered frame of the first window is the first frame of the first window, this means that no data has been previously generated for the blurred transparent area in the first window. In this case, the data of the blurred transparent area is inevitably changed.
In the case of a change, the data of the blurred transparent area in the first window may be calculated based on the current data to be processed of the first window and the current data to be processed of the second window. The specific calculation method can be referred to the foregoing principle of window fuzzy transparent display, and therefore, the description is not repeated here.
The window fuzzy transparent display method determines whether the data in the fuzzy transparent area needs to be calculated in real time by judging whether the data in the fuzzy transparent area changes in advance, thereby being beneficial to reducing unnecessary calculation amount and reducing meaningless occupation of calculation resources.
Based on any one of the foregoing embodiments, in this embodiment, the determining data of the blurred transparent area in the first window according to the previously received blurred transparent area information includes:
judging whether the data of the fuzzy transparent area in the first window is changed compared with the previously stored data of the fuzzy transparent area in the first window or not according to the pre-received fuzzy transparent area information;
and in the case of no change, taking the previously stored data of the fuzzy transparent area in the first window as the data of the fuzzy transparent area in the current first window.
In the previous embodiment, the determination process of whether the data of the blurred transparent area in the first window changes and the corresponding operation in the case of the change have been described. In this embodiment, an operation in the case where data in the blur transparent area is not changed will be mainly described.
The data of the blurred transparent area is unchanged, which means that if the data of the blurred transparent area at the previous time has been stored, the previously stored data of the blurred transparent area in the first window is the same as the data of the blurred transparent area in the first window at the current time. Therefore, the data of the fuzzy transparent area in the first window does not need to be calculated in real time, and can be directly read from the memory, so that the data calculation amount can be effectively reduced.
The previously stored data of the blurred transparent area in the first window in this embodiment refers to the saved data of the blurred transparent area in the latest version of the first window. In the following embodiments, a process of storing data of the blur transparent area will be explained.
The window fuzzy transparent display method determines whether the data in the fuzzy transparent area needs to be calculated in real time by judging whether the data in the fuzzy transparent area changes in advance, and can obtain the data in the fuzzy transparent area by using the stored data under the condition that the data does not change, thereby being beneficial to reducing unnecessary calculation amount and reducing meaningless occupation of calculation resources.
Based on any one of the above embodiments, in this embodiment, the method further includes:
a command containing information of the obscured transparent areas is received before drawing the frame of the first window.
In the previous embodiments, it was assumed that the window manager had previously obtained the obscured transparent region information. In this embodiment, a description is given of how the window manager obtains the information of the blurred transparent area.
As an alternative implementation, the window manager receives a command containing the fuzzy transparent area information, so as to obtain the fuzzy transparent area information. In this embodiment, the command containing the fuzzy transparent area information is implemented by extending the Wayland protocol.
For example, the command containing the fuzzy transparent area information is defined as follows:
wl_surface_blur(surface, id, x, y,width, height);
wherein id is an identification number of the fuzzy transparent area, and the identification number should have uniqueness; x and y are coordinate values of the upper left corner of the fuzzy transparent area; width is the width value of the blurred transparent area and height is the height value of the blurred area.
The commands may be transmitted based on the Wayland protocol.
The command containing the fuzzy transparent area information is not limited to the above mentioned Wayland protocol, but may also be implemented based on other existing protocols, such as protocol buffer protocol or protocol based on xml, json, etc. format.
The window fuzzy transparent display method provided by the invention can transmit the command containing the fuzzy transparent area information to the window manager through expanding the existing Wayland protocol, so that the window manager can realize the fuzzy transparent display of the window based on the fuzzy transparent area information.
Based on any one of the above embodiments, in this embodiment, after the determining the data of the blurred transparent area in the first window, the method further includes:
storing data of the obscured transparent areas in the first window.
In the previous embodiment, it has been mentioned that if the data of the blurred transparent area in the first window is unchanged from the previous data, the data of the blurred transparent area required when the current frame of the first window is drawn can be obtained based on the previously stored data of the blurred transparent area in the first window.
One premise for the foregoing implementation of the embodiment is that the data of the blurred transparent area in the first window has been stored in advance. In the present embodiment, this storing process is explained.
After the data of the blurred transparent area in the first window is obtained through real-time calculation, the data of the blurred transparent area can be stored for recycling in a subsequent frame drawing process.
In this embodiment, the data of the opaque region may be stored in a cache. The data for storing the fuzzy transparent area in the cache can adopt the following data structure:
blur_cache {
region _region;
char *_buffer;
}
wherein, region is a region of the cache, and buffer is data stored in the cache.
In order to improve the query efficiency, the cached identification information may be stored in a hash manner. For example, for all caches holding data of the fuzzy transparent area, the cached ID is stored in a hash with the key:
hash<int, blur_cache> _blurCache;
the storage of the data in the opaque and transparent area is not limited to the cache storage described in this embodiment, and other storage manners may also be used without limitation.
The window fuzzy transparent display method provided by the invention can realize the repeated utilization of data by storing the data of the determined fuzzy transparent area, is beneficial to reducing the calculation times of the data of the fuzzy transparent area and reducing the occupation of calculation resources.
Based on any one of the above embodiments, in this embodiment, after the storing the data of the blurred transparent area in the first window, the method further includes:
and deleting the stored data of the fuzzy transparent area in the first window according to the received closing command of the first window.
The obscured transparent area is part of the first window, and therefore if the first window is closed, the obscured transparent area is also necessarily no longer displayed. The data of the fuzzy transparent area stored at this time will not have use value any more. In order to reduce the waste of the storage space, the stored data of the fuzzy transparent area in the first window can be deleted after receiving the closing command of the first window.
The window fuzzy transparent display method provided by the invention deletes the stored data of the fuzzy transparent area in the first window according to the received closing command of the first window, thereby being beneficial to reducing the waste of storage space.
Based on any one of the above embodiments, in this embodiment, after the storing the data of the blurred transparent area in the first window, the method further includes:
deleting the stored data of the designated fuzzy transparent area in the first window according to the received emptying command of the designated fuzzy transparent area in the first window.
The obscured transparent area may be closed by means of a clear command in addition to the first window being closed.
Unlike the manner in which the first window is closed, the clear command may clear the designated obscured transparent region in the first window. For example, there are 3 different fuzzy transparent areas in the first window, and the 2 nd fuzzy transparent area can be cleared by the clear command.
In this embodiment, the flush command may be implemented by the wl _ surface _ blu command described in the previous embodiments.
I.e. the definition of the flush command is still:
wl_surface_blur(surface, id, x, y,width, height);
but the width value width and the height value height are both set to be 0; the id value is the identification number of the fuzzy transparent area to be cleared.
In other embodiments, the clearing of the designated obscured transparent regions may be accomplished in other ways.
Once the designated obscured transparent area is cleared, the data for the designated obscured transparent area that is stored at this point will no longer have use value. In order to reduce the waste of the storage space, the stored data of the specified fuzzy transparent area in the first window can be deleted after receiving the emptying command of the specified fuzzy transparent area in the first window.
The window fuzzy transparent display method provided by the invention deletes the stored data of the appointed fuzzy transparent area in the first window according to the received emptying command of the appointed fuzzy transparent area in the first window, thereby being beneficial to reducing the waste of storage space.
The window blurring transparent display device provided by the present invention is described below, and the window blurring transparent display device described below and the window blurring transparent display method described above may be referred to correspondingly.
Fig. 2 is a schematic view of a window obscuring transparent display apparatus provided by the present invention, and as shown in fig. 2, the window obscuring transparent display apparatus provided by the present invention includes:
a fuzzy transparent area determining module 201, configured to determine that a fuzzy transparent area exists in the first window in a process of drawing a frame of the first window;
a fuzzy transparent area data determining module 202, configured to determine, according to pre-received fuzzy transparent area information, data of a fuzzy transparent area in the first window; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and a frame drawing module 203, configured to draw a frame of the first window according to the data of the blurred transparent area.
According to the window fuzzy transparent display device, the range of the fuzzy transparent area is set in the window to be drawn, so that the data of the fuzzy transparent area are obtained, and finally the drawing of the fuzzy transparent area is realized in the process of drawing the window. The window fuzzy transparent display device provided by the invention can carry out fuzzy transparent display on partial areas of windows, and overcomes the problem that local fuzzy cannot be realized by an application with local fuzzy requirement between windows.
Based on any one of the above embodiments, in this embodiment, the module 202 for determining fuzzy transparent area data includes:
the data change judging unit is used for judging whether the data of the fuzzy transparent area in the first window changes or not according to the previously received fuzzy transparent area information;
the data acquisition unit is used for acquiring the data to be processed of the first window and the data to be processed of the second window according to the information of the fuzzy transparent area under the condition of change; the data to be processed in the first window is original data of a fuzzy transparent area in the first window, and the data to be processed in the second window is data of an area corresponding to the fuzzy transparent area in the second window; the second window is a window which has an overlapping relation with the first window, and the first window is a window at the upper position and the second window is a window at the lower position;
and the fuzzy transparent area data calculating unit is used for calculating the data of the fuzzy transparent area in the first window according to the data to be processed of the first window and the data to be processed of the second window.
The window fuzzy transparent display device determines whether the data in the fuzzy transparent area needs to be calculated in real time by judging whether the data in the fuzzy transparent area changes in advance, thereby being beneficial to reducing unnecessary calculation amount and reducing meaningless occupation of calculation resources.
Based on any one of the above embodiments, in this embodiment, the module 202 for determining fuzzy transparent area data includes:
the data change judging unit is used for judging whether the data of the fuzzy transparent area in the first window is changed compared with the previously stored data of the fuzzy transparent area in the first window or not according to the previously received fuzzy transparent area information;
and the data reading unit is used for taking the previously stored data of the fuzzy transparent area in the first window as the data of the current fuzzy transparent area in the first window under the condition that no change occurs.
The window fuzzy transparent display device determines whether the data in the fuzzy transparent area needs to be calculated in real time by judging whether the data in the fuzzy transparent area changes in advance, and can obtain the data in the fuzzy transparent area by using the stored data under the condition that the data does not change, thereby being beneficial to reducing unnecessary calculation amount and reducing unnecessary occupation of calculation resources.
Based on any one of the above embodiments, in this embodiment, the apparatus further includes:
and the command receiving module is used for receiving a command containing the information of the fuzzy transparent area before the frame of the first window is drawn.
The window fuzzy transparent display device provided by the invention can transmit the command containing the fuzzy transparent area information to the window manager through expanding the existing Wayland protocol, so that the window manager can realize the fuzzy transparent display of the window based on the fuzzy transparent area information.
Based on any one of the above embodiments, in this embodiment, the apparatus further includes:
and the storage module is used for storing the data of the fuzzy transparent area in the first window.
The window fuzzy transparent display device provided by the invention can realize the repeated utilization of data by storing the data of the determined fuzzy transparent area, is beneficial to reducing the calculation times of the data of the fuzzy transparent area and reducing the occupation of calculation resources.
Based on any one of the above embodiments, in this embodiment, the apparatus further includes:
and the first deleting module is used for deleting the stored data of the fuzzy transparent area in the first window according to the received closing command of the first window.
The window fuzzy transparent display device provided by the invention deletes the stored data of the fuzzy transparent area in the first window according to the received closing command of the first window, thereby being beneficial to reducing the waste of storage space.
Based on any one of the above embodiments, in this embodiment, the apparatus further includes:
and the second deleting module is used for deleting the stored data of the specified fuzzy transparent area in the first window according to the received emptying command of the specified fuzzy transparent area in the first window.
The window fuzzy transparent display device provided by the invention deletes the stored data of the specified fuzzy transparent area in the first window according to the received emptying command of the specified fuzzy transparent area in the first window, thereby being beneficial to reducing the waste of storage space.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may invoke logic instructions in the memory 330 to perform a window obscuring transparent display method comprising:
determining that a fuzzy transparent area exists in the first window in the process of drawing the frame of the first window;
determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and drawing the frame of the first window according to the data of the fuzzy transparent area.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method for displaying a window with blurred transparency provided by the above methods, the method comprising:
determining that a fuzzy transparent area exists in the first window in the process of drawing the frame of the first window;
determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and drawing the frame of the first window according to the data of the fuzzy transparent area.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method for fuzzy transparent display of windows provided above, the method comprising:
determining that a fuzzy transparent area exists in the first window in the process of drawing the frame of the first window;
determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and drawing the frame of the first window according to the data of the fuzzy transparent area.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. A window fuzzy transparent display method is characterized by comprising the following steps:
in the process of drawing a frame of a first window, determining that the first window has a fuzzy transparent area;
determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and drawing the frame of the first window according to the data of the fuzzy transparent area.
2. The window fuzzy transparent display method according to claim 1, wherein said determining data of the fuzzy transparent area in the first window according to the pre-received fuzzy transparent area information comprises:
judging whether the data of the fuzzy transparent area in the first window changes or not according to the pre-received fuzzy transparent area information;
under the condition of change, acquiring data to be processed of a first window and data to be processed of a second window according to the information of the fuzzy transparent area; the data to be processed in the first window is original data of a fuzzy transparent area in the first window, and the data to be processed in the second window is data of an area corresponding to the fuzzy transparent area in the second window; the second window is a window which has an overlapping relation with the first window, and the first window is a window at the upper position and the second window is a window at the lower position;
and calculating the data of the fuzzy transparent area in the first window according to the data to be processed of the first window and the data to be processed of the second window.
3. The method for displaying the window in a blurred and transparent manner according to claim 2, wherein the step of judging whether the data of the blurred and transparent area in the first window changes comprises the following steps:
and when the data to be processed of the first window changes and/or the data to be processed of the second window changes, determining that the data of the fuzzy transparent area in the first window changes.
4. The window fuzzy transparent display method according to claim 1, wherein said determining data of the fuzzy transparent area in the first window according to the pre-received fuzzy transparent area information comprises:
judging whether the data of the fuzzy transparent area in the first window changes or not according to the pre-received fuzzy transparent area information;
and in the case of no change, taking the previously stored data of the fuzzy transparent area in the first window as the data of the fuzzy transparent area in the current first window.
5. The window obscuring transparent display method of claim 1, further comprising:
a command containing information of the obscured transparent areas is received before drawing the frame of the first window.
6. The method for displaying window blur transparency according to claim 5, wherein the command containing blur transparent area information is implemented by extending the Wayland protocol.
7. The window obscured transparent display method according to claim 1, characterised in that after the determining data of the obscured transparent area in the first window, the method further comprises:
storing data of the obscured transparent areas in the first window.
8. The window obscured transparent display method according to claim 7, characterised in that after the storing data of the obscured transparent area in the first window, the method further comprises:
and deleting the stored data of the fuzzy transparent area in the first window according to the received closing command of the first window.
9. The window obscured transparent display method according to claim 7, characterised in that after the storing data of the obscured transparent area in the first window, the method further comprises:
deleting the stored data of the designated fuzzy transparent area in the first window according to the received emptying command of the designated fuzzy transparent area in the first window.
10. A window obscuring transparent display comprising:
the device comprises a fuzzy transparent area determining module, a fuzzy transparent area determining module and a fuzzy transparent area determining module, wherein the fuzzy transparent area determining module is used for determining that a fuzzy transparent area exists in a first window in the process of drawing a frame of the first window;
the fuzzy transparent area data determining module is used for determining data of a fuzzy transparent area in the first window according to pre-received fuzzy transparent area information; wherein the blurred transparent area information is used for describing the range of the blurred transparent area in the first window;
and the frame drawing module is used for drawing the frame of the first window according to the data of the fuzzy transparent area.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the window obscuring transparent display method according to any one of claims 1 to 9 when executing the program.
12. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, implements the steps of the window fuzzy transparent display method according to any one of claims 1 to 9.
CN202111352196.7A 2021-11-16 2021-11-16 Window fuzzy transparent display method and device, electronic equipment and storage medium Active CN113791861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111352196.7A CN113791861B (en) 2021-11-16 2021-11-16 Window fuzzy transparent display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111352196.7A CN113791861B (en) 2021-11-16 2021-11-16 Window fuzzy transparent display method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113791861A true CN113791861A (en) 2021-12-14
CN113791861B CN113791861B (en) 2022-03-01

Family

ID=78955420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111352196.7A Active CN113791861B (en) 2021-11-16 2021-11-16 Window fuzzy transparent display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113791861B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030142109A1 (en) * 2002-01-28 2003-07-31 International Business Machines Corporation Displaying transparent resource aids
CN104103045A (en) * 2014-07-09 2014-10-15 广东欧珀移动通信有限公司 Gaussian blur processing method and system for terminal
CN105138317A (en) * 2015-07-24 2015-12-09 安一恒通(北京)科技有限公司 Window display processing method and device applied to terminal equipment
CN106570847A (en) * 2016-10-24 2017-04-19 广州酷狗计算机科技有限公司 Image processing method and image processing device
CN110457102A (en) * 2019-07-26 2019-11-15 武汉深之度科技有限公司 Blur method, rendering method and the calculating equipment of visual object

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030142109A1 (en) * 2002-01-28 2003-07-31 International Business Machines Corporation Displaying transparent resource aids
CN104103045A (en) * 2014-07-09 2014-10-15 广东欧珀移动通信有限公司 Gaussian blur processing method and system for terminal
CN105138317A (en) * 2015-07-24 2015-12-09 安一恒通(北京)科技有限公司 Window display processing method and device applied to terminal equipment
CN106570847A (en) * 2016-10-24 2017-04-19 广州酷狗计算机科技有限公司 Image processing method and image processing device
CN110457102A (en) * 2019-07-26 2019-11-15 武汉深之度科技有限公司 Blur method, rendering method and the calculating equipment of visual object

Also Published As

Publication number Publication date
CN113791861B (en) 2022-03-01

Similar Documents

Publication Publication Date Title
US10929648B2 (en) Apparatus and method for data processing
EP3620981B1 (en) Object detection method, device, apparatus and computer-readable storage medium
US10089957B2 (en) Page display method and terminal
CN102970456B (en) Image forming apparatus, image forming apparatus control method, and program
CN108830780A (en) Image processing method and device, electronic equipment, storage medium
CN108121982B (en) Method and device for acquiring facial single image
US10949993B2 (en) Pupil localization method and device, apparatus, and storage medium
EP3876197A2 (en) Portrait extracting method and apparatus, electronic device and storage medium
CN113126862B (en) Screen capture method and device, electronic equipment and readable storage medium
CN111814637A (en) Dangerous driving behavior recognition method and device, electronic equipment and storage medium
CN113327193A (en) Image processing method, image processing apparatus, electronic device, and medium
CN113159026A (en) Image processing method, image processing apparatus, electronic device, and medium
CN113362420A (en) Road marking generation method, device, equipment and storage medium
CN108629750A (en) A kind of night defogging method, terminal device and storage medium
CN113791861B (en) Window fuzzy transparent display method and device, electronic equipment and storage medium
CN109886864B (en) Privacy mask processing method and device
CN108520259B (en) Foreground target extraction method, device, equipment and storage medium
CN116563172A (en) VR globalization online education interaction optimization enhancement method and device
CN115588412A (en) Ink screen picture display method and device, terminal equipment and storage medium
CN111256712B (en) Map optimization method and device and robot
CN113762027B (en) Abnormal behavior identification method, device, equipment and storage medium
CN114663418A (en) Image processing method and device, storage medium and electronic equipment
CN110851883B (en) Equipment fingerprint generation method and device based on picture drawing
CN116668709B (en) Image transmission method, device, server device and storage medium
CN112528115B (en) Website monitoring method and 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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220406

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address before: 2005, floor 2, No. 39, West Street, Haidian District, Beijing 100080

Patentee before: Beijing jingling Information System Technology Co.,Ltd.