CN-120429049-B - Display method and related equipment
Abstract
The application provides a display method and related equipment. According to the display method, the electronic equipment can determine a target area and a non-target area aiming at target content, iterate by adopting two groups of reaction diffusion equations with different parameters aiming at pixel points in the target area and the non-target area, then determine the target color of the pixel point based on the iterated result, and render and display the target color of each pixel point in the two display areas so as to realize the display of the target content in a specific display area by using a fluid diffusion effect, thus enriching the style of the display content.
Inventors
- MEI XINYAN
- CAO HAO
- ZHU WEIHANG
- XIE QIYU
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241130
Claims (19)
- 1. A display method, wherein the method is applied to an electronic device, the method comprising: The method comprises the steps of responding to a first operation, displaying a first animation in a first display area, wherein the first display area comprises a target area and a non-target area, the first animation is an animation for displaying target content in the target area with a fluid diffusion effect, and the first animation comprises multiple frames of images, and at least one frame of image in the multiple frames of images comprises the target content; The color of each pixel point in the target area is determined based on the first concentration and the second concentration corresponding to each pixel point in the target area, the first concentration and the second concentration corresponding to each pixel point in the target area are determined based on a first reaction diffusion equation, the color of each pixel point in the non-target area is determined based on the first concentration and the second concentration corresponding to each pixel point in the non-target area, and the first concentration and the second concentration corresponding to each pixel point in the non-target area are determined based on a second reaction diffusion equation; the first reactive diffusion equation comprises a first generation rate and a first disappearance rate, the second reactive diffusion equation comprises a second generation rate and a second disappearance rate, the first generation rate is the generation rate of first-class pixel points in the target area, the second generation rate is the generation rate of first-class pixel points in the non-target area, the first disappearance rate is the disappearance rate of second-class pixel points in the target area, the second disappearance rate is the disappearance rate of second-class pixel points in the non-target area, the color of the first-class pixel points is different from the color of the second-class pixel points, the first generation rate is different from the second generation rate, the first disappearance rate is different from the second disappearance rate, the first concentration is the concentration of the first-class pixel points, and the second concentration is the concentration of the second-class pixel points.
- 2. The method of claim 1, wherein the method further comprises: Determining the target region and the non-target region based on the target content in response to the first operation before displaying the first animation; the displaying the first animation in the first display area comprises the following steps: Under the condition of displaying an N-1 frame image of the first animation, for each pixel point in the first display area, if the pixel point is in the target area, updating a first concentration and a second concentration corresponding to the pixel point based on the first reactive diffusion equation, and if the pixel point is in the non-target area, updating the first concentration and the second concentration corresponding to the pixel point based on the second reactive diffusion equation; determining a target color of the pixel point based on the first concentration and the second concentration corresponding to the pixel point; rendering the N frame image of the first animation based on the target color of each pixel point in the first display area; And displaying the Nth frame image in the first display area.
- 3. The method of claim 1, wherein the method further comprises: Before displaying the first animation, determining the target region and the non-target region based on the target content and determining a boundary region of the target region and the non-target region in the first display region based on a directed distance field SDF corresponding to the target content in response to the first operation; the displaying the first animation in the first display area comprises the following steps: under the condition that an N-1 frame image of the first animation is displayed, aiming at each pixel point in the first display area, if the pixel point is in a display area except the boundary area in the target area, updating a first concentration and a second concentration corresponding to the pixel point based on the first reactive diffusion equation, if the pixel point is in a display area except the boundary area in the non-target area, updating the first concentration and the second concentration corresponding to the pixel point based on the second reactive diffusion equation, and if the pixel point is in the boundary area, processing parameters in the first reactive diffusion equation and parameters in the second reactive diffusion equation based on the SDF corresponding to the pixel point to obtain a third reactive diffusion equation, and updating the first concentration and the second concentration corresponding to the pixel point based on the third reactive diffusion equation; determining a target color of the pixel point based on the first concentration and the second concentration corresponding to the pixel point; rendering the N frame image of the first animation based on the target color of each pixel point in the first display area; And displaying the Nth frame image in the first display area.
- 4. The method of claim 1, wherein the method further comprises: Before the first animation is displayed, determining the target area and the non-target area based on the target content in response to the first operation, and dividing the first display area to obtain a plurality of block areas; the displaying the first animation in the first display area comprises the following steps: under the condition of displaying an N-1 frame image of the first animation, for each pixel point in the first display area, if the pixel point is in the target area, updating a first concentration and a second concentration corresponding to the pixel point based on the first reactive diffusion equation until the iteration frequency based on the first reactive diffusion equation reaches the target iteration frequency corresponding to the block area to which the pixel point belongs, and if the pixel point is in the non-target area, updating the first concentration and the second concentration corresponding to the pixel point based on the second reactive diffusion equation until the iteration frequency based on the second reactive diffusion equation reaches the target iteration frequency corresponding to the block area to which the pixel point belongs; determining a target color of the pixel point based on the first concentration and the second concentration corresponding to the pixel point; rendering the N frame image of the first animation based on the target color of each pixel point in the first display area; And displaying the Nth frame image in the first display area.
- 5. The method of claim 1, wherein the method further comprises: Before the first animation is displayed, determining the target area and the non-target area based on the target content, determining boundary areas of the target area and the non-target area in the first display area based on a directed distance field SDF corresponding to the target content, and dividing the first display area to obtain a plurality of block areas; the displaying the first animation in the first display area comprises the following steps: Under the condition that an N-1 frame image of the first animation is displayed, for each pixel point in the first display area, if the pixel point is in the display area except the boundary area, updating the first concentration and the second concentration corresponding to the pixel point based on the first reactive diffusion equation until the number of iterations based on the first reactive diffusion equation reaches the target iteration number corresponding to the block area to which the pixel point belongs, if the pixel point is in the display area except the boundary area in the non-target area, updating the first concentration and the second concentration corresponding to the pixel point based on the second reactive diffusion equation until the number of iterations based on the second reactive diffusion equation reaches the target iteration number corresponding to the block area to which the pixel point belongs, and if the pixel point is in the boundary area, performing the processing of the parameter in the first reactive diffusion and the parameter in the second reactive diffusion equation based on the SDF corresponding to the first reactive diffusion equation and the parameter in the second reactive diffusion equation until the third iterative equation reaches the third iterative point based on the third reactive diffusion equation; determining a target color of the pixel point based on the first concentration and the second concentration corresponding to the pixel point; rendering the N frame image of the first animation based on the target color of each pixel point in the first display area; And displaying the Nth frame image in the first display area.
- 6. The method of claim 3 or 5, wherein the processing the parameters in the first reactive diffusion equation and the parameters in the second reactive diffusion equation based on the SDF corresponding to the pixel point to obtain a third reactive diffusion equation includes: determining a first interpolation factor based on a mapping relation between the SDF corresponding to the pixel point in the boundary area and a first interval, wherein the first interpolation factor is a difference value between 1 and a first mapping value, and the first mapping value is a mapping value of the SDF corresponding to the pixel point in the first interval; Interpolating between the first generation rate and the second generation rate based on the first interpolation factor to obtain a third generation rate, and interpolating between the first disappearance rate and the second disappearance rate based on the first interpolation factor to obtain a third disappearance rate; the third reactive diffusion equation is determined based on the third generation rate and the third disappearance rate.
- 7. The method of claim 4 or 5, wherein the method further comprises: Determining the Laplacian corresponding to the current block areas and the Laplacian corresponding to the block areas in the h frame image which is displayed in the first animation and is displayed at the latest under the condition that the N-1 frame image of the first animation is displayed, wherein h is a positive integer; And adjusting the target iteration times corresponding to the plurality of block areas based on the Laplacian corresponding to the plurality of block areas currently and the Laplacian corresponding to the plurality of block areas in the h-frame image which is displayed in the first animation and is displayed at the latest.
- 8. The method of claim 7, wherein adjusting the target number of iterations for the plurality of tile regions based on the laplacian for the plurality of tile regions currently corresponding and the laplacian for the plurality of tile regions in the h-frame image that has been displayed and is displayed last in the first animation comprises: Determining a first value and a second value corresponding to each of the plurality of partitioned areas, wherein the first value is the number of pixels of the corresponding Laplace operator included in the partitioned area in a color gradient range, and the second value is an average value of the number of pixels of the corresponding Laplace operator included in the partitioned area in the h-frame image in the color gradient range; reducing the target iteration times corresponding to the blocking areas under the condition that the first numerical value is smaller than the second numerical value; Under the condition that the first value is equal to the second value, keeping the target iteration times corresponding to the blocking areas unchanged; And under the condition that the first numerical value is larger than the second numerical value, increasing the target iteration times corresponding to the blocking area.
- 9. The method of any of claims 2-5, 8, wherein the determining the target color for the pixel based on the corresponding first and second concentrations of the pixel comprises: determining that the target color of the pixel point is the color of the first type pixel point under the condition that the first concentration corresponding to the pixel point is larger than the second concentration corresponding to the pixel point; And determining that the target color of the pixel point is the color of the second class pixel point under the condition that the first concentration corresponding to the pixel point is smaller than or equal to the second concentration corresponding to the pixel point.
- 10. The method of any one of claims 2-5, 8, wherein updating the first concentration and the second concentration corresponding to the pixel point based on the first reactive diffusion equation comprises: By the formula And Respectively updating the first concentration and the second concentration corresponding to the pixel points; The updating the first concentration and the second concentration corresponding to the pixel point based on the second reactive diffusion equation includes: By the formula And Respectively updating the first concentration and the second concentration corresponding to the pixel points; Wherein A is the first concentration corresponding to the pixel point before updating, B is the second concentration corresponding to the pixel point before updating, For updating the first density corresponding to the pixel point, For updating the second density corresponding to the pixel point, And As the diffusion coefficient of the first type pixel point, And As the diffusion coefficient of the second type pixel point, For the first rate of production to be described, For the second rate of production to be described, For the first rate of disappearance of the first set, For the second rate of disappearance of the first one, The time of change is shown.
- 11. The method of any one of claims 2-5, 8, wherein the first concentration corresponding to the pixel is an R-channel value of the pixel and the second concentration corresponding to the pixel is a G-channel value of the pixel.
- 12. The method of any one of claims 1-5, 8, wherein the method further comprises: before the first animation is displayed, setting an initial value of a first concentration and an initial value of a second concentration corresponding to each pixel point in the first display area in response to the first operation, wherein the initial value of the first concentration corresponding to each pixel point in the first display area is smaller than the initial value of the second concentration corresponding to each pixel point in the first display area.
- 13. The method of claim 12, wherein after setting the initial value of the first density and the initial value of the second density corresponding to each pixel point in the first display area, the method further comprises: Responsive to a second operation for a first location in the first display area, a corresponding first concentration and a corresponding second concentration are reset for one or more pixel points corresponding to the first location, and the reset corresponding first concentration is greater than the reset corresponding second concentration.
- 14. The method of claim 12, wherein after setting the initial value of the first density and the initial value of the second density corresponding to each pixel point in the first display area, the method further comprises: After a first period of time, resetting the corresponding first concentration and second concentration for any one or more pixel points in the first display area, wherein the reset corresponding first concentration is greater than the reset corresponding second concentration.
- 15. The method of claim 12, wherein the method further comprises: In the process of displaying the first animation, in response to a third operation for a second position in the first display area, a first density and a second density corresponding to one or more pixel points corresponding to the second position are respectively set as an initial value of the first density and an initial value of the second density.
- 16. The method of any one of claims 1-5, 8, 13-15, wherein the method further comprises: and in the process of displaying the first animation, responding to a fourth operation for a third position in the first display area, and increasing the target iteration times corresponding to one or more pixel points corresponding to the third position.
- 17. The method of any one of claims 1-5, 8, 13-15, wherein the target content comprises target text.
- 18. An electronic device, characterized in that, the electronic device includes one or more memories and one or more processors; the one or more memories coupled to the one or more processors, the memories for storing computer program code comprising computer instructions that the processors invoke to perform the method of any of the above claims 1-17.
- 19. A computer readable storage medium storing computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of the preceding claims 1-17.
Description
Display method and related equipment Technical Field The application relates to the technical field of terminals, in particular to a display method and related equipment. Background In the process of using a terminal device (which may also be referred to as an electronic device) such as a mobile phone or a tablet, the terminal device may display various animation effects. The user may interact with the electronic device such that the animation effect displayed by the electronic device changes. Disclosure of Invention The application provides a display method and related equipment. According to the display method, the electronic equipment can divide different display areas aiming at the target content, iterate the different display areas by adopting reaction diffusion equations with different parameters, render and display the target content in a specific display area by using a fluid diffusion effect based on the iterated result, and enrich the style of displaying the target content on a display screen. In a first aspect, the present application provides a display method. The method can be applied to an electronic device. According to the method, in response to a first operation, the electronic device may display a first animation in a first display region. The first display area includes a target area and a non-target area. The first animation is an animation that displays target content in a target area with a fluid diffusion effect. The first animation may include a plurality of images, and at least one of the plurality of images includes the target content. The color of each pixel point in the target area is determined based on a first reactive diffusion equation, and the color of each pixel point in the non-target area is determined based on a second reactive diffusion equation for any frame of image in the first animation. The first reactive diffusion equation may include a first generation rate and a first disappearance rate, and the second reactive diffusion equation may include a second generation rate and a second disappearance rate. The first generation rate is the generation rate of the first type of pixel points in the target area, the second generation rate is the generation rate of the first type of pixel points in the non-target area, the first disappearance rate is the disappearance rate of the second type of pixel points in the target area, and the second disappearance rate is the disappearance rate of the second type of pixel points in the non-target area. The first rate of formation is different from the second rate of formation, and the first rate of disappearance is different from the second rate of disappearance. The color of the first type of pixel is different from the color of the second type of pixel. In the scheme provided by the application, in response to the first operation, aiming at the pixel points in different areas, the electronic equipment can iterate by adopting the reaction diffusion equation with different parameters, so that the continuous change of the color of the pixel points is realized, the purpose of displaying the target content by using the fluid diffusion effect is realized, the display form of the target content on the display screen can be enriched, and more interesting visual experience is brought to the user. It is understood that the reaction diffusion equation to which the present application relates may be a reaction diffusion equation in which there is interdiffusion of two components in the system. In the present application, these two components can be understood as two different color pixels, i.e., a first type pixel and a second type pixel, which iterate based on reaction diffusion equations with different parameters, so that liquids with different specific concentrations are mutually diffused, until the iteration reaches a stable state (the result iterated based on the reaction diffusion equations does not change much), and the electronic device can display the target content on the display screen. With reference to the first aspect, in one possible implementation manner, the method may further include, before displaying the first animation, in response to the first operation, the electronic device determining the target region and the non-target region based on the target content. The electronic device can display the first animation in the first display area, and specifically can comprise, for each pixel point in the first display area under the condition that an N-1 frame image of the first animation is displayed, updating a first concentration and a second concentration corresponding to the pixel point based on a first reaction diffusion equation if the pixel point is in a target area, updating the first concentration and the second concentration corresponding to the pixel point based on a second reaction diffusion equation if the pixel point is in a non-target area, determining a target color of the pixel point based on the first concentrat