Display method and related equipment

By dividing the target area in the terminal device and iterating the pixel points using reaction diffusion equations with different parameters, simulating the fluid diffusion effect display content, solving the problem of single display style of the terminal device, improving user experience and reducing power consumption.

CN120429049AActive Publication Date: 2025-08-05HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411758651.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-08-05
Estimated Expiration
2044-11-30

AI Technical Summary

Technical Problem

The prior art is difficult to enrich the style of the display content through the fluid diffusion effect in terminal devices, resulting in a single user experience.

Method used

By dividing the target area and the non-target area in the terminal device and iterating the pixel points using reaction diffusion equations with different parameters, the fluid diffusion effect is simulated to display the target content.

Benefits of technology

A rich display of fluid diffusion effects is achieved, improving the user's visual experience, and reducing power consumption through the optimization iteration process, avoiding heating problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429049A_ABST
    Figure CN120429049A_ABST
Patent Text Reader

Abstract

The invention 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 according to target content, iteration is carried out on pixel points in the target area and the non-target area by adopting two groups of reaction diffusion equations with different parameters, and then the target color of the pixel points is determined based on an iteration result. And rendering and displaying are carried out based on the target colors of the pixel points in the two display areas, so that the target content is displayed in the specific display area with a fluid diffusion effect, and the style of the display content can be enriched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a display method and related equipment. Background Art

[0002] When a user uses a terminal device (also called an electronic device) such as a mobile phone or tablet, the terminal device can display various animation effects. The user can interact with the electronic device to change the animation effect displayed by the electronic device. Summary of the Invention

[0003] This application provides a display method and related devices. According to the display method, an electronic device can divide different display areas according to target content, iterate reaction-diffusion equations with different parameters for different display areas, and render and display based on the iterative results, thereby displaying the target content in a specific display area with a fluid diffusion effect. In this way, the styles of displaying the target content on the display screen can be enriched.

[0004] In a first aspect, the present application provides a display method. This method can be applied to an electronic device. According to the method, in response to a first operation, the electronic device can display a first animation in a first display area. The first display area includes a target area and a non-target area. The first animation displays target content in the target area using a fluid diffusion effect. The first animation can include multiple frames, and at least one of the multiple frames includes the target content. For any frame in the first animation, the color of each pixel in the target area is determined based on a first reaction-diffusion equation, and the color of each pixel in the non-target area is determined based on a second reaction-diffusion equation. The first reaction-diffusion equation can include a first generation rate and a first disappearance rate, and the second reaction-diffusion equation can include a second generation rate and a second disappearance rate. The first generation rate is the generation rate of a first type of pixel in the target area, and the second generation rate is the generation rate of the first type of pixel in the non-target area; the first disappearance rate is the disappearance rate of a second type of pixel in the target area, and the second disappearance rate is the disappearance rate of the second type of pixel in the non-target area. The first generation rate is different from the second generation rate, and the first disappearance rate is different from the second disappearance rate. The color of the first type of pixel is different from the color of the second type of pixel.

[0005] In the solution provided in the present application, in response to the first operation, for pixel points in different areas, the electronic device can use reaction diffusion equations with different parameters to iterate, thereby realizing continuous changes in the color of the pixel points, thereby realizing the display of target content with a fluid diffusion effect. This can enrich the display form of the target content on the display screen and bring a more interesting visual experience to the user.

[0006] It is understood that the reaction-diffusion equation involved in this application can be a reaction-diffusion equation for the mutual diffusion of two components in a system. In this application, these two components can be understood as first-type pixels and second-type pixels of two different colors. The iteration based on the reaction-diffusion equation with different parameters is like the mutual diffusion of liquids of different concentrations. When the iteration reaches a stable state (the result of the iteration based on the reaction-diffusion equation does not change much), the electronic device can display the target content on the display.

[0007] In combination with the first aspect, in a possible implementation, the method may further include: before displaying the first animation, in response to the first operation, the electronic device may determine a target area and a non-target area based on the target content.

[0008] An electronic device can display a first animation in a first display area. Specifically, the following may be included: when displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in a target area, the electronic device can update the first concentration and second concentration corresponding to the pixel based on a first reaction-diffusion equation; if the pixel is in a non-target area, the electronic device can update the first concentration and second concentration corresponding to the pixel based on a second reaction-diffusion equation; the electronic device can determine the target color of the pixel based on the first concentration and second concentration corresponding to the pixel; when the target color of each pixel in the first display area has been determined, the electronic device can render the Nth frame image of the first animation based on the target color of each pixel in the first display area, and display the Nth frame image in the first display area. Wherein, N is a positive integer. The first concentration is the concentration of the first type of pixel, and the second concentration is the concentration of the second type of pixel.

[0009] In the solution provided in this application, in response to a first operation, the electronic device can divide the target area into a target area and a non-target area based on the target content. Before displaying each frame of the first animation, the electronic device can use the corresponding reaction-diffusion equation to determine the target color of each pixel in each area, thereby rendering the image to be displayed. Because the target color of the pixel changes based on the law of fluid diffusion, the electronic device can display the target content with a fluid diffusion effect as it continuously displays the frames of the first animation.

[0010] It can be understood that when displaying the N-1th frame image of the first animation, the electronic device only needs to iterate the corresponding reaction-diffusion equations for the pixel points in the two areas respectively, and there is no need to perform multiple iterations based on the corresponding reaction-diffusion equations to determine the target color of each pixel point in the first display area, thereby quickly rendering the Nth frame image of the first animation. This can reduce power consumption and power consumption to a certain extent, and avoid heating when the user is not using the electronic device.

[0011] In combination with the first aspect, in a possible implementation, the method may further include: before displaying the first animation, in response to the first operation, the electronic device may determine the target area and the non-target area based on the target content, and determine the boundary area between the target area and the non-target area in the first display area based on the SDF corresponding to the target content.

[0012] The electronic device can display the first animation in the first display area, which can specifically include: when displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the display area of the target area excluding the boundary area, the electronic device can update the first concentration and second concentration corresponding to the pixel based on the first reaction-diffusion equation; if the pixel is in the display area of the non-target area excluding the boundary area, the electronic device can update the first concentration and second concentration corresponding to the pixel based on the second reaction-diffusion equation; if the pixel is in the boundary area, the electronic device can process the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel to obtain a third reaction-diffusion equation, and update the first concentration and second concentration corresponding to the pixel based on the third reaction-diffusion equation; the electronic device can determine the target color of the pixel based on the first concentration and second concentration corresponding to the pixel; when the target color of each pixel in the first display area has been determined, the electronic device can render the Nth frame image of the first animation based on the target color of each pixel in the first display area, and display the Nth frame image in the first display area.

[0013] In the solution provided by the present application, in response to the first operation, the electronic device can divide the target area and the non-target area based on the target content, and can also determine the boundary area between the target area and the non-target area. Before displaying each frame of the first animation, for the pixels in different areas, the electronic device can use the corresponding reaction diffusion equation to determine the target color of the pixel, thereby rendering the frame of the image to be displayed. Moreover, for each pixel in the boundary area, the electronic device can process the parameters in the two sets of reaction diffusion equations corresponding to the target area and the non-target area based on the SDF corresponding to the pixel, obtain the processed reaction diffusion equation (the processed reaction diffusion equation includes the processed parameters), and determine the target color of the pixel based on the processed reaction diffusion equation, thereby achieving smoothing of the boundary area. In this way, the outline of the target content displayed by the electronic device with a fluid diffusion effect (for example, the glyph outline of the text mentioned below) is smoother, which can bring a better visual experience to the user.

[0014] It should be noted that the electronic device processes the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel. This can also be understood as the electronic device mixing the parameters in the different reaction-diffusion equations based on the SDF corresponding to the pixel. The processed parameters obtained in this manner are the mixed parameters, and the processed reaction-diffusion equation obtained in this manner (i.e., the third reaction-diffusion equation) is the mixed reaction-diffusion equation.

[0015] In combination with the first aspect, in a possible implementation, the method may further include: before displaying the first animation, in response to the first operation, the electronic device may determine the target area and the non-target area based on the target content, and divide the first display area into multiple block areas.

[0016] The electronic device can display the first animation in the first display area, which can specifically include: when displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the first reaction-diffusion equation, until the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; if the pixel is in the non-target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the second reaction-diffusion equation, until the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; the electronic device can determine the target color of the pixel based on the first concentration and the second concentration corresponding to the pixel; when the target color of each pixel in the first display area has been determined, the electronic device can render the Nth frame image of the first animation based on the target color of each pixel in the first display area, and display the Nth frame image in the first display area.

[0017] In the solution provided in the present application, in response to the first operation, the electronic device can divide the first display area into two different forms. One is to divide the target area and the non-target area in the first display area based on the target content, and the other is to divide the first display area into multiple block areas. In addition, the electronic device can set corresponding target iteration times for the multiple block areas. Before displaying each frame of the first animation, for each pixel in the first display area, the electronic device needs to iterate based on the corresponding reaction-diffusion equation until the number of iterations corresponding to the partition to which it belongs is reached. Only then can the electronic device determine its corresponding target color, thereby rendering the frame of image to be displayed. On the one hand, the electronic device does not need to set the target iteration number in units of pixels, but sets the target iteration number in units of block areas, that is, the electronic device does not need to set the target iteration number for each pixel separately, but sets the target iteration number for the pixel set separately. The process is simpler and it is convenient for the electronic device to control the target iteration number. On the other hand, before determining the target color of the pixel, the electronic device needs to iterate the reaction-diffusion equation for a target number of iterations, so that the target color of the pixel can be updated in a timely manner, avoiding the situation where the target color of the pixel is finally determined and the color it actually should display is significantly different due to a small number of iterations, thereby avoiding affecting the fluid diffusion effect when displaying the target content.

[0018] In combination with the first aspect, in a possible implementation, the method may further include: before displaying the first animation, in response to the first operation, the electronic device may determine the target area and non-target area based on the target content, determine the boundary area between the target area and the non-target area in the first display area based on the SDF corresponding to the target content, and divide the first display area into multiple block areas.

[0019] The electronic device can display the first animation in the first display area, which can specifically include: when displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the display area excluding the boundary area of the target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the first reaction-diffusion equation until the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; if the pixel is in the display area excluding the boundary area of the non-target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the second reaction-diffusion equation until the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs. If the pixel is in the boundary area, the electronic device can process the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel to obtain a third reaction-diffusion equation, and update the first concentration and the second concentration corresponding to the pixel based on the third reaction-diffusion equation until the number of iterations based on the third reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; the electronic device can determine the target color of the pixel based on the first concentration and the second concentration corresponding to the pixel; when the target color of each pixel in the first display area has been determined, the electronic device can render the Nth frame image of the first animation based on the target color of each pixel in the first display area, and display the Nth frame image in the first display area.

[0020] In the solution provided in this application, in response to a first operation, the electronic device can perform two different divisions on the first display area: one is to divide the first display area into a target area and a non-target area, as well as the boundary area between the target area and the non-target area, based on the target content; the other is to divide the first display area into multiple block areas. Furthermore, the electronic device can set corresponding target iteration times for each block area. Before displaying each frame of the first animation, the electronic device needs to iterate for each pixel in the first display area based on the corresponding reaction-diffusion equation until the iteration number corresponding to the partition to which it belongs is reached. Only then can the electronic device determine the corresponding target color and render the image to be displayed for that frame. This allows for timely updating of the target color of the pixel and balances the complexity of the process. Furthermore, for each pixel in the boundary area, the electronic device can process the parameters of the two sets of reaction-diffusion equations corresponding to the target area and the non-target area based on the SDF corresponding to the pixel. The target color of the pixel is then determined based on the reaction-diffusion equation obtained after this processing, thereby achieving smoothing of the boundary area. In this way, the outline of the target content displayed by the electronic device using a fluid diffusion effect is smoother, providing a better visual experience for the user.

[0021] In conjunction with the first aspect, in one possible implementation, the electronic device processes the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel point to obtain a third reaction-diffusion equation. Specifically, the electronic device may determine a first interpolation factor based on the mapping relationship between the SDF corresponding to the pixel point in the boundary area and the first interval, and may also interpolate between the first generation rate and the second generation rate based on the first interpolation factor to obtain a third generation rate, and interpolate between the first disappearance rate and the second disappearance rate based on the first interpolation factor to obtain a third disappearance rate, and determine a third reaction-diffusion equation based on the third generation rate and the third disappearance rate. The first interpolation factor may be the difference between 1 and the first mapping value. The first mapping value is the mapping value of the SDF corresponding to the pixel point in the first interval.

[0022] In the solution provided in this application, the electronic device can use a linear interpolation method to achieve smoothing of the boundary area between the target area and the non-target area, so that when the target content is displayed in the target area, the outline (or boundary) of the target content transitions more smoothly and naturally.

[0023] It is understandable that the electronic device can also use other methods (for example, polynomial interpolation, spline interpolation, Bessel interpolation, smoothing filter, SG filter, etc.) to perform the above-mentioned smoothing of the boundary area, and this application does not limit this.

[0024] In some embodiments of the present application, the first interpolation factor may be the interpolation factor mentioned below, the first mapping value may be the smoothstep (minimum value in the first distance range, maximum value in the first distance range, SDF distance of the pixel point) mentioned below, and the first interval may be the first distance range mentioned below.

[0025] In combination with the first aspect, in a possible implementation, the method may further include: when displaying the N-1th frame image of the first animation, the electronic device may determine the Laplace operators currently corresponding to the multiple block areas, and the Laplace operators corresponding to the multiple block areas in the h-frame image that has been displayed and displayed latest in the first animation; and may also adjust the target number of iterations corresponding to the multiple block areas based on the Laplace operators currently corresponding to the multiple block areas and the Laplace operators corresponding to the multiple block areas in the h-frame image that has been displayed and displayed latest in the first animation.

[0026] In the solution provided in the present application, the electronic device can determine the diffusion condition of each block area (whether it is in a rapid diffusion state or in a stable state) based on the color gradient change of one or more frames of the first animation that has been displayed, and adjust the target number of iterations corresponding to the block area based on the diffusion condition. Specifically, on the one hand, for the block area in a rapid diffusion state, the electronic device can increase its corresponding target number of iterations, thereby timely updating the target color of each pixel in the block area to avoid affecting the fluid diffusion effect when displaying the target content. On the other hand, for the block area in a stable state, the electronic device can reduce or maintain its corresponding target number of iterations, thereby reducing power consumption to a certain extent. The electronic device can achieve a balance between the above two aspects by adjusting the target number of iterations in units of block areas.

[0027] In some embodiments of the present application, the h-frame image may be an h-frame image in the sliding window mentioned below.

[0028] In conjunction with the first aspect, in one possible implementation, the electronic device adjusts the target number of iterations corresponding to the multiple block areas based on the Laplacian operators currently corresponding to the multiple block areas and the Laplacian operators corresponding to the multiple block areas in the h-frame image that has been displayed and displayed last in the first animation. Specifically, the electronic device may determine, for each of the multiple block areas, a first value and a second value corresponding to the block area; if the first value is less than the second value, the electronic device may reduce the target number of iterations corresponding to the block area; if the first value is equal to the second value, the electronic device may maintain the target number of iterations corresponding to the block area unchanged; if the first value is greater than the second value, the electronic device may increase the target number of iterations corresponding to the block area. The first value is the number of pixels within a color gradient range corresponding to the Laplacian operator included in the block area, and the second value is the average number of pixels within the color gradient range corresponding to the Laplacian operator included in the block area in the h-frame image.

[0029] In the solution provided in the present application, the electronic device can determine the color gradient change of the block area based on the average value of the Laplace operator of the block area included in the multiple frames of the first animation that has been displayed, rather than simply determining the color gradient change of the block area based on the previous frame of the image that has been displayed. The color gradient change determined in this way is the color gradient change of the block area over a period of time, rather than the immediate color gradient change, thereby controlling the number of adjustments to the target iteration number so that it is not adjusted too frequently, and reducing power to a certain extent.

[0030] It is understandable that the specific meaning of the color gradient range can be referred to the relevant description below, and this application will not elaborate on it here.

[0031] In combination with the first aspect, in a possible implementation method, the electronic device determines the target color of the pixel point based on the first concentration and the second concentration corresponding to the pixel point. Specifically, it may include: when the first concentration corresponding to the pixel point is greater than its corresponding second concentration, the electronic device can determine that its target color is the color of the first type of pixel point; when the first concentration corresponding to the pixel point is less than or equal to its corresponding second concentration, the electronic device can determine that its target color is the color of the second type of pixel point.

[0032] In the solution provided in the present application, for each pixel in the first display area, the electronic device can determine the target color of the pixel based on the size relationship between the first concentration and the second concentration corresponding to the pixel, thereby realizing the display of the fluid diffusion effect on the display screen.

[0033] In conjunction with the first aspect, in a possible implementation, the electronic device updates the first concentration and the second concentration corresponding to the pixel point based on the first reaction-diffusion equation, which may specifically include: the electronic device may respectively update the first concentration and the second concentration corresponding to the pixel point based on the formula and Updating the first concentration and the second concentration corresponding to the pixel point. The electronic device updates the first concentration and the second concentration corresponding to the pixel point based on the second reaction-diffusion equation, which may specifically include: the electronic device may respectively use the formula and Update the first and second concentrations corresponding to the pixel. Where A is the first concentration corresponding to the pixel before the update, B is the second concentration corresponding to the pixel before the update, A' is the first concentration corresponding to the pixel after the update, B' is the second concentration corresponding to the pixel after the update, D A1 and D A2 is the diffusion coefficient of the first type of pixel, D B1 and D B2 is the diffusion coefficient of the second type of pixels, f1 is the first generation rate, f2 is the second generation rate, k1 is the first disappearance rate, k2 is the second disappearance rate, and Δt represents the time of change.

[0034] In the solution provided in this application, the electronic device can use and This set of reaction-diffusion equations, and for different areas in the first display area (for example, the target area and the non-target area), the electronic device can adopt different generation rates and disappearance rates to simulate the diffusion effects of fluids with different concentrations, and convert the fluid concentration into pixel color, thereby realizing the display of the fluid diffusion effect for the target content.

[0035] It should be noted that the reaction terms (including source terms and vanishing terms) in the above reaction-diffusion equation are only an example provided in this application. Electronic devices can also use other reaction terms (for example, monostable reaction terms, bistable reaction terms, ignition reaction terms, etc.), and this application does not impose any restrictions on this.

[0036] In combination with the first aspect, in a possible implementation, the first concentration corresponding to the pixel may be the R channel value of the pixel, and the second concentration corresponding to the pixel may be the G channel value of the pixel.

[0037] In the solution provided in the present application, for scenes displayed based on the RGB color space, the electronic device can represent the first concentration and the second concentration corresponding to the pixel point by any two of the R channel value, G channel value, B channel value and transparency corresponding to the pixel point, thereby realizing the display of an animation of the target content with a fluid diffusion effect on the display screen.

[0038] It should be noted that for other types of color spaces (e.g., HSV / HSB color space, YCbCr color space, YPbPr color space, XYZ color space, etc.), the electronic device may represent the first concentration and the second concentration corresponding to the pixel in other ways, and this application does not limit this. For example, for a scene displayed based on the YCbCr color space, the electronic device may represent the first concentration and the second concentration corresponding to the pixel by any two of the Y channel value, Cb channel value, and Cr channel value corresponding to the pixel.

[0039] In conjunction with the first aspect, in one possible implementation, the method may further include: before displaying the first animation, in response to the first operation, the electronic device may set an initial value of the first density and an initial value of the second density corresponding to each pixel in the first display area. For each pixel in the first display area, the initial value of the first density corresponding to the pixel is less than the initial value of the second density corresponding to the pixel.

[0040] In the solution provided in this application, before displaying the first animation, in response to the first operation, the electronic device can uniformly set the initial value of the first concentration and the initial value of the second concentration for each pixel in the first display area, so that the initial color of each pixel in the first display area is the same (for example, all are the color of the second type of pixel). For example, the electronic device can set the initial value of the first concentration corresponding to each pixel in the first display area to be smaller than the initial value of the second concentration corresponding to the pixel. This can more completely simulate the fluid diffusion effect to display the target content.

[0041] In combination with the first aspect, in one possible implementation, after the electronic device sets the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area, the method may also include: in response to a second operation on a first position in the first display area, for one or more pixel points corresponding to the first position, the electronic device may reset its corresponding first concentration and second concentration, and the reset corresponding first concentration is greater than the reset corresponding second concentration.

[0042] In the solution provided in the present application, after the electronic device uniformly sets the initial value of the first concentration and the initial value of the second concentration for each pixel point in the first display area, the user can trigger the electronic device to start simulating the fluid diffusion effect to display the target content, that is, for one or more pixel points in the first display area affected by the user operation, the electronic device can reset its corresponding first concentration and second concentration. In this way, in the subsequent iteration process based on the corresponding reaction-diffusion equation, the target color of the pixel points in the first display area can change, and the electronic device will not be unable to simulate the fluid diffusion effect to display the target content because its target color has always been the color of the second type of pixel points.

[0043] In combination with the first aspect, in a possible implementation, after the electronic device sets the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area, the method may further include: after a first time interval, for any one or more pixel points in the first display area, the electronic device may reset its corresponding first concentration and second concentration, and the reset corresponding first concentration is greater than the reset corresponding second concentration.

[0044] In the solution provided in the present application, after the electronic device uniformly sets the initial value of the first concentration and the initial value of the second concentration for each pixel in the first display area, the electronic device can automatically start to simulate the fluid diffusion effect to display the target content, that is, after a first time interval, for any one or more pixel points in the first display area, the electronic device can reset its corresponding first concentration and second concentration. In this way, in the subsequent iteration process based on the corresponding reaction-diffusion equation, the target color of the pixel points in the first display area can change, and the electronic device will not be unable to simulate the fluid diffusion effect to display the target content because its target color has always been the color of the second type of pixel points.

[0045] In some embodiments of the present application, if the electronic device receives an operation on the first display area when the interval duration is less than the first duration, then in response to the operation, the electronic device can reset the corresponding first concentration and second concentration for one or more pixel points corresponding to the operation. If the electronic device still does not receive the operation on the first display area when the interval duration reaches the first duration, the electronic device can randomly select one or more pixel points in the first display area to reset their corresponding first concentration and second concentration.

[0046] In combination with the first aspect, in a possible implementation, the method may further include: during the process of the electronic device displaying the first animation, in response to a third operation on the second position in the first display area, the electronic device may set the first concentration and the second concentration corresponding to one or more pixel points corresponding to the second position to the initial value of the first concentration and the initial value of the second concentration, respectively.

[0047] In the solution provided in the present application, when the electronic device displays the first animation, the electronic device can respond to the user's sliding operation on the first display area and set the color of one or more pixel points corresponding to the sliding operation to the color of the second type of pixel points, thereby achieving the effect of erasing the first type of pixel points and providing the user with more interactive experience.

[0048] In combination with the first aspect, in a possible implementation, the method may further include: during the process of the electronic device displaying the first animation, in response to a fourth operation on a third position in the first display area, the electronic device may increase the target number of iterations corresponding to one or more pixel points corresponding to the third position.

[0049] In the solution provided by this application, the electronic device can divide the first display area. For areas with user interaction (e.g., the high diffusion area mentioned below), the electronic device can increase the corresponding target iteration number, while for areas without user interaction (e.g., the low diffusion area mentioned below), the electronic device can maintain or reduce the corresponding target iteration number. In this way, the electronic device can timely update the target color of each pixel in the area with user interaction.

[0050] In some embodiments of the present application, the one or more pixel points corresponding to the third position may be pixel points in the high diffusion area mentioned below.

[0051] In combination with the first aspect, in a possible implementation, the target content may include target text.

[0052] It is understandable that the target content can be set according to actual needs, and this application does not limit this. The electronic device can not only display patterns with a fluid diffusion effect, but also display text with a fluid diffusion effect, which greatly enriches the display effect of the displayed content.

[0053] In a second aspect, the present application provides an electronic device comprising one or more memories and one or more processors; the one or more memories can be coupled to the one or more processors, the memory being used to store computer program code, the computer program code comprising computer instructions, and the one or more processors calling the computer instructions to enable the electronic device to execute the method described in the first aspect or any one of the implementations of the first aspect.

[0054] In a third aspect, the present application provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect or any one of the implementations of the first aspect.

[0055] In a fourth aspect, an embodiment of the present application provides a chip. The chip can be applied to an electronic device, and the chip includes one or more processors configured to invoke computer instructions to cause the electronic device to execute the method described in the first aspect or any one of the implementations of the first aspect.

[0056] In a fifth aspect, embodiments of the present application provide a chip system. This chip system can be applied to an electronic device and includes at least one processor and an interface, wherein the interface is configured to receive instructions and transmit them to the at least one processor; the at least one processor executes the received instructions, causing the electronic device to perform the method described in the first aspect or any one of the implementations of the first aspect.

[0057] In some embodiments of the present application, the chip system may be an application processor (AP) or a system on chip (SoC) including an AP, and the method described in the above first aspect or any one of the implementations of the first aspect may be implemented by an AP.

[0058] In some other embodiments of the present application, the chip system may include an AP and other modules, wherein the other modules may be a modem processor (also referred to as a baseband processor).

[0059] In a sixth aspect, an embodiment of the present application provides a computer program product comprising instructions. When the computer program product is run on an electronic device, the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect.

[0060] It is understood that the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, the chip system provided in the fifth aspect, and the computer program product provided in the sixth aspect are all used to perform the method described in the first aspect or any one of the implementations of the first aspect. Therefore, the beneficial effects that can be achieved can be referenced to the beneficial effects of any possible implementation of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0062] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0063] Figure 3 A schematic diagram of a reaction-diffusion algorithm provided in an embodiment of the present application;

[0064] Figure 4A A flowchart of a display method provided in an embodiment of the present application;

[0065] Figure 4B A flowchart of another display method provided in an embodiment of the present application;

[0066] Figure 4C A flowchart of another display method provided in an embodiment of the present application;

[0067] Figure 5A A schematic diagram of a text area and a non-text area provided in an embodiment of the present application;

[0068] Figure 5B A schematic diagram of a boundary area provided in an embodiment of the present application;

[0069] Figures 6A-6D A set of schematic diagrams of interfaces for displaying text using a fluid diffusion effect, provided in an embodiment of the present application;

[0070] Figure 7A and Figure 7B A schematic diagram of a set of triggering fluid diffusion effects provided in an embodiment of the present application;

[0071] Figure 8A and Figure 8B A schematic diagram of the SDF of a set of target characters provided in an embodiment of the present application;

[0072] Figure 9 A schematic diagram of the division of a first display area provided in an embodiment of the present application;

[0073] Figure 10 A schematic diagram of a sliding window provided in an embodiment of the present application;

[0074] Figure 11 A schematic diagram of a target text change provided in an embodiment of the present application;

[0075] Figure 12 A schematic diagram of another target text change provided in an embodiment of the present application;

[0076] Figure 13 A user interaction diagram provided in an embodiment of the present application;

[0077] Figures 14A-14C Another set of user interaction diagrams provided for embodiments of the present application;

[0078] Figure 15 A schematic diagram of dividing a high diffusion area and a low diffusion area provided in an embodiment of the present application;

[0079] Figure 16 A schematic diagram of another method for dividing high diffusion areas and low diffusion areas provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0081] It should be understood that the terms "first," "second," and the like in the specification, claims, and drawings of this application are used to distinguish between different objects, rather than to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0082] It should be understood that the term "user interface" in the specification, claims, and drawings of this application refers to the media interface for interaction and information exchange between an application or operating system and a user. A common form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed graphically. It can be an interface element such as an icon, window, or control displayed on the display screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0083] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0084] Embodiments of the present application provide a display method and related devices. According to this display method, an electronic device can achieve a fluid diffusion effect for target content. That is, the electronic device can display the target content on the display screen using the fluid diffusion effect. Furthermore, when the electronic device displays the target content using the fluid diffusion effect, in response to a user operation, the electronic device can reset the color of the pixels in the touched area and continue to display the target content using the fluid diffusion effect. This can enrich the display style of text and provide users with a better interactive experience.

[0085] It can be understood that the fluid diffusion effect involved in this application refers to the display effect of simulating the mutual diffusion of fluids (for example, the mutual diffusion of two fluids).

[0086] The following first introduces the device involved in the embodiments of the present application.

[0087] The electronic device involved in this application may be a terminal device, specifically a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) or a dedicated camera (for example, a SLR camera, a card camera) and the like. The embodiments of this application do not impose any restrictions on the specific type of electronic device.

[0088] The hardware structure of the electronic device involved in the embodiments of the present application is introduced below.

[0089] See also Figure 1 , Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0090] like Figure 1As shown, the electronic device may include: a processor, an external memory interface, an internal memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, antenna 1, antenna 2, a mobile communication module, a wireless communication module, a sensor module, a button, a motor, an indicator, a camera, a display, an audio module, and a Subscriber Identity Module (SIM) card slot, etc. The audio module may include a speaker, a receiver, a microphone, an earphone jack, etc., and the sensor module may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0091] It is understandable that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. It is understandable that the illustrated components can be implemented in hardware, software, or a combination of software and hardware. In some embodiments of the present application, the electronic device may include more components than illustrated. For example, the electronic device may include other types of sensors. In some other embodiments of the present application, the electronic device may include fewer components than illustrated, or combine certain components, or split certain components, or arrange the components differently. The interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device.

[0092] A processor may include one or more processing units, such as an application processor (AP), a modem (also known as a baseband processor), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). The AP is responsible for running the operating system and applications, while the modem is responsible for processing various communication protocols.

[0093] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, a mobile communication module, a wireless communication module, and a modem. The modem can interact with the base station through antennas (e.g., antenna 1, antenna 2, etc.). In some embodiments, antenna 1 of the electronic device is coupled to the mobile communication module, and antenna 2 is coupled to the wireless communication module, allowing the electronic device to communicate with the network and other devices using wireless communication technologies.

[0094] Electronic devices can achieve display functions through GPU, display, and application processor.

[0095] A GPU is a microprocessor for image processing that connects the display screen to the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information. A display screen is used to display images, videos, and the like. In some embodiments, an electronic device may include one or more display screens.

[0096] A camera is used to capture still images or video. An ISP processes the data from the camera. Light passes through the lens and is transmitted to the camera's photosensitive element, where it is converted into an electrical signal. The camera's photosensitive element then transmits this electrical signal to the ISP for processing, transforming it into a visible image. An electronic device may include one or more cameras.

[0097] Internal memory can include one or more RAMs and one or more non-volatile memories (NVMs). RAM can be directly read and written by the processor and can be used to store executable programs (e.g., machine instructions) for the operating system or other running programs, as well as user and application data. NVM can also store executable programs and user and application data, and can be pre-loaded into RAM for direct reading and writing by the processor.

[0098] In the embodiment of the present application, the code for implementing the method described in the embodiment of the present application may be stored in a non-volatile memory. When the electronic device is running, the electronic device may load the executable code stored in the non-volatile memory into a random access memory.

[0099] The external memory interface can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device.

[0100] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.

[0101] The following describes the software structure of the electronic device involved in the embodiments of the present application.

[0102] The operating system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android operating system with a layered architecture as an example to illustrate the software structure of the electronic device. It should be noted that although the embodiment of the present application is described using the Android operating system (which may be referred to as the Android system) as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.

[0103] See also Figure 2 , Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.

[0104] The software structure of an electronic device adopts a layered architecture, which divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. Taking the Android system running on an AP as an example, in some embodiments of the present application, the Android system's software structure is divided into five layers: from top to bottom, the application layer, the framework layer, the Android runtime and system library, the hardware abstraction layer (HAL), and the kernel layer.

[0105] The application layer may include a series of application packages, including camera, gallery, calendar, short message, call, map, navigation, video, WLAN, Bluetooth, music, settings and other applications.

[0106] like Figure 2 As shown, the settings may include lock screen related settings options, such as setting the lock screen style, setting the lock screen time, setting the lock screen wallpaper, etc. In some embodiments of the present application, the user can select the lock screen style to be a fluid diffusion effect in the settings. In this case, the lock screen wallpaper displayed by the electronic device is a fluid diffusion effect, and the clock text displayed is also a fluid diffusion effect.

[0107] In some embodiments of the present application, the third-party application may also include lock screen related settings. In this case, the user can also select a fluid diffusion effect lock screen style in the third-party application, so that the lock screen wallpaper and text displayed by the electronic device are fluid diffusion effects.

[0108] The framework layer provides an application programming interface (API) and a programming framework for applications in the application layer.

[0109] like Figure 2As shown, the framework layer may include a text rendering module. The text rendering module can be used to achieve a fluid diffusion effect of text in multiple scenarios (such as the lock screen scenario).

[0110] In some embodiments of the present application, the framework layer may include some predefined functions. For example, the framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The phone manager is used to provide call functions for the electronic device, such as managing call status (including answering, hanging up, etc.).

[0111] The runtime is responsible for system scheduling and management. It consists of core libraries and a virtual machine. The core libraries consist of two parts: one containing the functions called by programming languages (e.g., Java) and the other containing the system's core libraries. The application layer and framework layer run in the virtual machine. The virtual machine executes application and framework layer programming files (e.g., Java files) as binary files. The virtual machine manages object lifecycles, stacks, threads, security, exception management, and garbage collection.

[0112] The system library can include multiple functional modules, such as the Surface Manager, Media Libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The specific meanings and functions of these functional modules can be found in the relevant technical documentation and will not be explained in detail here.

[0113] The Hardware Abstraction Layer (HAL) is an interface layer between the operating system kernel and upper-level software. Its purpose is to abstract the hardware. The HAL is an abstract interface driven by the device kernel, providing application programming interfaces (APIs) that access the underlying device to higher-level Java API frameworks. The HAL provides a standard interface that exposes device hardware capabilities to higher-level Java API frameworks. The HAL consists of multiple library modules (for example, the camera HAL, audio HAL, etc.). When the system framework API requests access to the portable device's hardware, the operating system loads the library module for that hardware component.

[0114] The kernel layer is the foundation of the Android system. It is responsible for hardware drivers, networking, power, system security, and memory management. The kernel layer acts as an intermediate layer between hardware and software, relaying application requests to the hardware. The kernel layer may include audio drivers, display drivers, camera drivers, and sensor drivers.

[0115] It should be noted that the application provides Figure 2The software structure diagram of the electronic device shown is only an example and does not limit the specific module divisions in different layers of the Android system. For details, please refer to the introduction of the Android system software structure in conventional technology. In addition, the method provided in this application can also be implemented based on other operating systems, and this application will not cite examples one by one.

[0116] Some of the terms and related technologies involved in this application are explained below to facilitate understanding by those skilled in the art.

[0117] 1. Reaction-Diffuse Algorithm

[0118] The Reaction-Diffuse algorithm is a computational method used to simulate chemical reactions and molecular diffusion. It is often used to simulate the dynamic changes in chemical concentrations over space and time, that is, substances transform into each other through local chemical reactions and spread across spatial surfaces through diffusion.

[0119] The following is an example of a reaction-diffusion algorithm based on two substances X and Y.

[0120] In the reaction-diffusion algorithm based on X and Y, such as Figure 3 As shown in (a) in , X is added at a certain generation rate, such as Figure 3 As shown in (b), two Ys can transform an X into a Y, such as Figure 3 As shown in (c), Y is removed at a certain decay rate.

[0121] In fluid diffusion algorithms, the kill rate and feed rate are two important parameters. They are often used to describe the changes in certain physical quantities in the fluid and together influence the distribution and changes of substances in the fluid. By adjusting the kill rate and feed rate, different physical processes and chemical reactions can be simulated. The following are the meanings of these two parameters:

[0122] Kill rate generally refers to the rate at which a substance in a fluid is consumed. In chemical reactions, it indicates the rate at which reactants are consumed. For example, in a combustion model, the kill rate can represent the rate at which fuel is consumed, which is typically related to the concentration of the reactants and the reaction rate constant. In fluid dynamics simulations, the kill rate can be used to control the decay or consumption of substances in the simulation to ensure accurate and realistic simulation results.

[0123] The feed rate refers to the rate at which a substance is supplied to a fluid. In chemical reactions, it indicates the rate at which reactants or products are generated. In fluid dynamics simulations, the feed rate can be used to control the generation or supply of substances in the simulation, which is crucial for simulating the dynamics of substances in the fluid. For example, in combustion, the feed rate can control the rate at which oxygen or fuel is supplied, thereby affecting the progress and efficiency of combustion.

[0124] 2. Laplacian Operator

[0125] The image Laplacian operator is a commonly used operator in image processing and computer vision for edge detection and feature extraction. Based on the second-order derivative of an image, the Laplacian operator provides second-order information about brightness changes in an image, helping to identify edges and textures in the image.

[0126] This application relates to the Laplace operator in two-dimensional space. It can be understood that in two-dimensional space, the Laplace operator is expressed as: here, represents the Laplace operator, and e is a function in two-dimensional space.

[0127] 3. Signed Distance Field (SDF)

[0128] SDF is a technique used in image processing and computer graphics. It records the distance from each point in space to the nearest surface of an object, using positive and negative values to distinguish whether the point is inside or outside the object. Specifically, SDF maps each point in space to the distance from that point to the nearest surface of the object. If the point is inside the object, the distance is negative; if the point is outside the object, the distance is positive; if the point is directly on the surface of the object, the distance is zero.

[0129] 4. RGB color model (or RGB color space)

[0130] The RGB color model is a widely used color representation method. RGB stands for Red, Green, and Blue, and these three color channels together define almost all colors in the color space. Among them, the value of the red channel represents the intensity of red in the image. The value of the red channel usually ranges from 0 to 255, where 0 represents no red and 255 represents the brightest red. Similarly, the value of the green channel represents the intensity of green in the image. The value of the green channel also ranges from 0 to 255, where 0 represents no green and 255 represents the brightest green. Similarly, the value of the blue channel represents the intensity of blue in the image. The value of the blue channel also ranges from 0 to 255, where 0 represents no blue and 255 represents the brightest blue.

[0131] A display method provided by an embodiment of the present application is introduced below.

[0132] The display method provided in the embodiments of the present application can be applied to electronic devices. The display method may include but is not limited to the following:

[0133] In response to a first operation, a first animation is displayed in a first display area. The first display area includes a target area and a non-target area. The first animation displays target content in the target area using a fluid diffusion effect. The first animation may include multiple frames, and at least one of the multiple frames includes the target content.

[0134] For any frame of the first animation, the color of each pixel in the target area is determined based on the first reaction-diffusion equation, and the color of each pixel in the non-target area is determined based on the second reaction-diffusion equation. The first reaction-diffusion equation may include a first generation rate and a first disappearance rate, and the second reaction-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 pixels (such as white pixels) in the target area, and the second generation rate is the generation rate of the first type of pixels in the non-target area; the first disappearance rate is the disappearance rate of the second type of pixels (such as black pixels) in the target area, and the second disappearance rate is the disappearance rate of the second type of pixels in the non-target area. The first generation rate is different from the second generation rate, and the first disappearance rate is different from the second disappearance rate. The color of the first type of pixels is different from the color of the second type of pixels. This means that the first type of pixels and the second type of pixels are two pixels of different colors that diffuse into each other.

[0135] It is understood that the first operation is used to trigger the electronic device to display the target content. The first operation can be a touch, sound, or gesture operation, and this application does not limit this. For example, the first operation can be as follows: Figure 6A The operation of pressing the power button is shown.

[0136] It is understandable that the target content can be a target pattern or target text, etc., and this application does not limit this.

[0137] In some embodiments of the present application, before displaying the first animation, in response to the first operation, the electronic device may determine a target area and a non-target area based on the target content.

[0138] In some embodiments of the present application, before displaying the first animation, in response to the first operation, the electronic device may further determine a boundary area between a target area and a non-target area in the first display area based on the SDF corresponding to the target content.

[0139] In some embodiments of the present application, before displaying the first animation, in response to the first operation, the electronic device may further divide the first display area into a plurality of block areas.

[0140] In some embodiments of the present application, the initial color of each pixel in the first display area may be the color of the second type of pixel. In one possible implementation, before displaying the first animation, in response to the first operation, for each pixel in the first display area, the electronic device may set the initial concentration of the first type of pixel and the initial concentration of the second type of pixel corresponding to it, and the initial concentration of the first type of pixel corresponding to it is less than the initial concentration of the second type of pixel corresponding to it, which means that the initial color set by the electronic device for each pixel in the first display area is the color of the second type of pixel.

[0141] It is understood that the initial concentration of the first type of pixel is the initial value of the first concentration (or the first concentration in the initial state), and the initial concentration of the second type of pixel is the initial value of the second concentration (or the second concentration in the initial state). It is understood that the initial concentration of the first type of pixel and the initial concentration of the second type of pixel can be set according to actual needs, and this application does not limit this. For example, the range of the first concentration and the second concentration can be [0,1], the initial value of the first concentration can be 0, and the initial value of the second concentration can be 1.

[0142] In some embodiments of the present application, after setting the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area, the electronic device can iterate based on the corresponding reaction-diffusion equation for each pixel in the first display area. During this process, the corresponding first concentration and second concentration remain unchanged, which means that the corresponding target color does not change (for example, it remains black), and the fluid diffusion effect cannot be achieved. In this case, the electronic device can reset the first concentration and second concentration corresponding to one or more pixels based on user operations, or reset the first concentration and second concentration corresponding to one or more pixels based on a certain interval, so that after each pixel in the first display area is iterated based on the corresponding reaction-diffusion equation, the corresponding first concentration and second concentration change, thereby achieving a fluid diffusion effect.

[0143] In one possible implementation, after setting the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel point in the first display area, in response to the second operation on the first position in the first display area, the electronic device can reset the corresponding first concentration and second concentration for one or more pixel points corresponding to the first position, and the reset corresponding first concentration is greater than the reset corresponding second concentration, so that the target color of the one or more pixel points corresponding to the first position is the color of the first type of pixel points.

[0144] For example, the second operation for the first position in the first display area may be as follows: Figure 7A In this case, the one or more pixels corresponding to the first position may be Figure 7A Pixels in the touch area shown.

[0145] It is understood that the one or more pixels corresponding to the first position may include: one or more pixels included in the first position. In some embodiments of the present application, the one or more pixels corresponding to the first position may also include: one or more pixels located in the area surrounding the first position.

[0146] It is understood that the present application does not limit the shape of the area surrounding the first position. For example, the area surrounding the first position can be a circular area centered at the first position and with a certain distance as a radius. In this case, the one or more pixels corresponding to the first position can be pixels included in the circular area.

[0147] In some embodiments of the present application, the area of the area surrounding the first position is less than a first area threshold. It is understood that the first area threshold is less than the area of the first display area. The first area threshold can be set based on actual needs and is not limited by the present application. For example, the first area threshold can be the area of one of the sub-areas mentioned below.

[0148] In another possible implementation, after setting the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area and after a first time interval, the electronic device can reset the corresponding first concentration and second concentration for any one or more pixel points in the first display area, and the reset corresponding first concentration is greater than the reset corresponding second concentration, so that the target color of any one or more pixel points in the first display area is the color of the first type of pixel points.

[0149] For example, any one or more pixels in the first display area may be Figure 7B Pixels in the randomly selected region shown.

[0150] It is understandable that the electronic device may determine the above-mentioned interval duration by starting the timing from when the first operation is received, and this application does not impose any limitation on this.

[0151] In some embodiments of the present application, during the process of displaying the first animation, the electronic device may receive a third operation for the second position in the first display area. In response to the operation, for one or more pixel points corresponding to the second position, the electronic device may set the corresponding first concentration and second concentration to their initial states, that is, reset the corresponding first concentration to the initial concentration of the first type of pixel points, and reset the corresponding second concentration to the initial concentration of the second type of pixel points.

[0152] For example, the third operation for the second position in the first display area may be as follows: Figure 13 For example, the third operation for the second position in the first display area can also be as follows: Figures 14A-14C The sliding operation shown is applied to the first display area.

[0153] It can be understood that the one or more pixel points corresponding to the second position can specifically refer to the relevant description of the one or more pixel points corresponding to the first position mentioned above, and this application will not go into details.

[0154] The following takes the rendering and display of the Nth frame of the first animation as an example. Figures 4A-4C The following describes a specific implementation method for displaying the first animation on an electronic device.

[0155] like Figure 4A As shown, when displaying the N-1th frame image of the first animation, the electronic device may perform the following steps:

[0156] S1: When displaying the N-1th frame image of the first animation, determine the target color of each pixel in the first display area based on the first reaction-diffusion equation and the second reaction-diffusion equation.

[0157] When displaying the N-1th frame of the first animation, the electronic device may determine the target color of each pixel in the first display area based on the first reaction-diffusion equation and the second reaction-diffusion equation. That is, the electronic device may traverse each pixel in the first display area and determine its target color based on the corresponding reaction-diffusion equation. It is understood that the specific implementation of this traversal can be found in the relevant description below and is not detailed here.

[0158] It can be understood that the specific meanings of the first reaction-diffusion equation and the second reaction-diffusion equation can be referred to the relevant description below, and this application will not elaborate on them here.

[0159] It can be understood that the target color corresponding to the pixel point (which can be simply referred to as the target color of the pixel point) refers to the color of the pixel point in the image to be displayed (or the next frame image of the first animation). That is, when displaying the N-1th frame image of the first animation, the color of the pixel point in the Nth frame image of the first animation is the target color of the pixel point. Similarly, when displaying the Nth frame image of the first animation, the color of the pixel point in the N+1th frame image of the first animation is the target color of the pixel point.

[0160] In some embodiments of the present application, when the electronic device executes step S1, for each pixel in the first display area, the following operations may be performed: Figure 4B Steps S1011 to S1013 shown:

[0161] S1011: When a pixel point is in a target area, updating a first concentration and a second concentration corresponding to the pixel point based on a first reaction-diffusion equation.

[0162] S1012: When the pixel point is in a non-target area, update the first concentration and the second concentration corresponding to the pixel point based on the second reaction-diffusion equation.

[0163] The electronic device can determine whether a pixel is in a target area or a non-target area. If the pixel is in the target area, the electronic device can update the concentration of the first type of pixel (i.e., the first concentration) and the concentration of the second type of pixel (i.e., the second concentration) corresponding to the pixel based on the first reaction-diffusion equation. If the pixel is in the non-target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the second reaction-diffusion equation.

[0164] In some embodiments of the present application, the first concentration corresponding to a pixel may be an R channel value of the pixel, and the second concentration corresponding to the pixel may be a G channel value of the pixel.

[0165] In some other embodiments of the present application, the first concentration and the second concentration corresponding to the pixel point can be any two of the following: the R channel value of the pixel point, the G channel value of the pixel point, the B channel value of the pixel point, and the transparency of the pixel point.

[0166] In some embodiments of the present application, the electronic device may set a target number of iterations for each pixel in the first display area. In this case, the electronic device may update the first concentration and the second concentration corresponding to the pixel based on the corresponding reaction-diffusion equation until the number of iterations of the pixel reaches the target number of iterations corresponding to the pixel. That is, when the number of iterations of the pixel reaches its corresponding target number of iterations, the electronic device may no longer update the first concentration and the second concentration corresponding to the pixel based on the corresponding reaction-diffusion equation. The number of iterations of the pixel refers to the number of times the electronic device iterates (or updates / calculates) based on the corresponding reaction-diffusion equation.

[0167] The target number of iterations refers to the number of iterations (or calculations) required to render the image to be displayed based on the reaction-diffusion equation. In other words, when an electronic device displays the current image, each pixel on the display screen must iterate several times based on the corresponding reaction-diffusion equation before the color of that pixel in the next frame (i.e., the target color) can be determined based on the result of the last iteration. The number of iterations during this process is the target number of iterations.

[0168] It is understood that the target number of iterations corresponding to each pixel in the first display area can be the same or different, and this application does not impose any restrictions on this. For example, the electronic device can set the same target number of iterations for each pixel in the first display area. For another example, the electronic device can set a larger target number of iterations for some pixels in the first display area, while setting a smaller target number of iterations for another portion of pixels.

[0169] In some embodiments of the present application, before the electronic device displays the first animation, the target number of iterations corresponding to each pixel in the first display area is the same, that is, the initial target number of iterations corresponding to each pixel in the first display area is the same.

[0170] In some embodiments of the present application, during the process of the electronic device displaying the first animation, the target number of iterations corresponding to each pixel in the first display area may remain unchanged.

[0171] In some embodiments of the present application, when the electronic device displays the first animation, the electronic device may adjust the target number of iterations corresponding to the pixels in the first display area.

[0172] In one possible implementation, the electronic device can update the target content, and accordingly, the target area and the non-target area can also be updated. In this case, for the pixels included in the partial area of the target area that has changed (for example, the partial area that originally belonged to the non-target area and is now the target area after the update, and the partial area that originally belonged to the target area and is now the non-target area after the update), the electronic device can increase its corresponding target iteration number, and for the pixels included in the partial area of the target area that has not changed, the electronic device can keep its corresponding target iteration number unchanged, or reduce its corresponding target iteration number.

[0173] In another possible implementation, while the electronic device is displaying the first animation, the electronic device may receive an operation on the first display area, and for one or more pixel points corresponding to the operation, the electronic device may increase its corresponding target iteration number, while for one or more pixel points in the first display area other than the one corresponding to the operation, the electronic device may keep its corresponding target iteration number unchanged or reduce its corresponding target iteration number.

[0174] It is understandable that the one or more pixel points corresponding to the operation may include: one or more pixel points included in the location where the operation is performed. In some embodiments of the present application, the one or more pixel points corresponding to the operation may also include: one or more pixel points located in the surrounding area of the location where the operation is performed. It is understandable that the present application does not limit the surrounding area of the location where the operation is performed. For example, the surrounding area of the location where the operation is performed may be a circular area with the operation location as the center and a certain distance as the radius. In this case, the one or more pixel points corresponding to the operation may be the pixel points included in the circular area.

[0175] It is understood that the operation on the first display area can be a touch operation. In this case, the one or more pixels corresponding to the operation can include one or more pixels at the touch location, and can also include one or more pixels around the touch location. Of course, the operation on the first display area can also be an operation such as sound or gesture, which is not limited in this application.

[0176] For example, the operation on the first display area can be the operation on the third position in the first display area mentioned above. In this case, the one or more pixels corresponding to the operation can be the one or more pixels corresponding to the third position. It is understood that the one or more pixels corresponding to the third position can be specifically referred to the relevant description of the one or more pixels corresponding to the first position mentioned above, and this application will not repeat it here.

[0177] In some embodiments of the present application, in response to the first operation, the electronic device may obtain multiple block areas, divide the first display area, and set a target number of iterations for each block area. That is, the electronic device sets a corresponding target number of iterations for each block area. This means that pixels in the same block area have the same target number of iterations.

[0178] It is understandable that the target number of iterations corresponding to different block areas may be the same or different, and this application does not impose any restrictions on this. In some embodiments of the present application, before the electronic device displays the first animation, the target number of iterations corresponding to each block area is the same. That is to say, the initial target number of iterations corresponding to each block area is the same. In some other embodiments of the present application, before the electronic device displays the first animation, the target number of iterations corresponding to each block area is not exactly the same. That is, the initial target number of iterations corresponding to each block area is not exactly the same, that is, the initial target number of iterations corresponding to at least two block areas is different.

[0179] In the above case, for each pixel in the first display area, when the pixel is in the target area, the electronic device can update the first concentration and second concentration corresponding to the pixel based on the first reaction-diffusion equation until the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs. Further, when the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs, the electronic device can determine the target color of the pixel based on the first concentration and second concentration corresponding to the pixel (i.e., the first concentration and second concentration corresponding to the pixel after the target number of iterations is updated). Similarly, when the pixel is in the non-target area, the electronic device can update the first concentration and second concentration corresponding to the pixel based on the second reaction-diffusion equation until the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs. Further, when the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs, the electronic device can determine the target color of the pixel based on the first concentration and second concentration corresponding to the pixel (i.e., the first concentration and second concentration corresponding to the pixel after the target number of iterations is updated).

[0180] In some embodiments of the present application, when the electronic device displays the first animation, the electronic device may adjust the target number of iterations corresponding to one or more block areas in the first display area.

[0181] In one possible implementation, the electronic device can update the target content, and accordingly, the target area and the non-target area can also be updated. In this case, for the block areas involved in the partial area that has changed in the target area (for example, the partial area that originally belonged to the non-target area and is now the target area after the update, and the partial area that originally belonged to the target area and is now the non-target area after the update), the electronic device can increase its corresponding target iteration number, and for the block areas involved in the partial area that has not changed in the target area, the electronic device can keep its corresponding target iteration number unchanged, or reduce its corresponding target iteration number.

[0182] In another possible implementation, while the electronic device is displaying the first animation, the electronic device may receive an operation on the first display area, and for one or more block areas corresponding to the operation, the electronic device may increase its corresponding target number of iterations, while for one or more block areas in the first display area other than the one corresponding to the operation, the electronic device may keep its corresponding target number of iterations unchanged, or reduce its corresponding target number of iterations.

[0183] In some embodiments of the present application, the one or more block areas corresponding to the operation may be the same block areas as the location where the operation is performed.

[0184] It is understandable that the specific implementation method of the electronic device adjusting the target number of iterations corresponding to the block area can be referred to below, and this application will not elaborate on it here.

[0185] S1013: Determine a target color of the pixel based on the first density and the second density corresponding to the pixel.

[0186] It is understandable that after the electronic device completes the update of the first concentration and the second concentration corresponding to the pixel point, it can determine the target color of the pixel point based on the first concentration and the second concentration corresponding to the pixel point (that is, the updated first concentration and the second concentration corresponding to the pixel point). It is understandable that the first concentration involved in determining the target color of the pixel point is the first concentration corresponding to the current pixel point, that is, the first concentration most recently determined by the electronic device, or the updated first concentration corresponding to the pixel point. Similarly, the second concentration involved in determining the target color of the pixel point is the second concentration corresponding to the current pixel point, that is, the second concentration most recently determined by the electronic device, or the updated second concentration corresponding to the pixel point.

[0187] In some embodiments of the present application, when the number of iterations of each pixel reaches its corresponding target number of iterations, the electronic device may determine its target color based on its corresponding first concentration and second concentration.

[0188] It is understandable that the specific implementation method of the electronic device determining its target color based on the first concentration and the second concentration corresponding to the pixel point can be referred to below, and this application will not elaborate on it here.

[0189] In some embodiments of the present application, when the electronic device executes step S1, for each pixel in the first display area, the following operations may be performed: Figure 4C Steps S1021 to S1024 shown:

[0190] S1021: When the pixel point is in the display area excluding the boundary area in the target area, update the first concentration and the second concentration corresponding to the pixel point based on the first reaction-diffusion equation.

[0191] S1022: When the pixel point is in the display area excluding the boundary area in the non-target area, update the first concentration and the second concentration corresponding to the pixel point based on the second reaction-diffusion equation.

[0192] S1023: When the pixel point is in the boundary area, the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation are processed based on the SDF corresponding to the pixel point to obtain a third reaction-diffusion equation, and the first concentration and the second concentration corresponding to the pixel point are updated based on the third reaction-diffusion equation.

[0193] The electronic device can determine whether the pixel point is in the display area excluding the boundary area in the target area, in the display area excluding the boundary area in the non-target area, or in the boundary area. When the pixel point is in the display area excluding the boundary area in the target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel point based on the first reaction-diffusion equation, and when the pixel point is in the display area excluding the boundary area in the non-target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel point based on the second reaction-diffusion equation, and when the pixel point is in the boundary area, the electronic device can process the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel point to obtain a third reaction-diffusion equation, and update the first concentration and the second concentration corresponding to the pixel point based on the third reaction-diffusion equation.

[0194] It can be understood that the boundary area may include a plurality of pixel points at the boundary between the target area and the non-target area, that is, the boundary area may include a portion of the target area and a portion of the non-target area.

[0195] It is understood that the description of the first concentration and the second concentration can be referred to above, and this application will not elaborate on this. The specific implementation method of the electronic device determining the third reaction-diffusion equation can be referred to below, and this application will not elaborate on this.

[0196] Similar to the above, in some embodiments of the present application, the electronic device can set a target number of iterations for each pixel in the first display area. The specific implementation method can be referred to above, and this application will not elaborate on it.

[0197] Similar to the above, in some embodiments of the present application, in response to the first operation, the electronic device can obtain multiple block areas, the electronic device can divide the first display area, and set the target number of iterations for the block areas, that is, the electronic device sets the corresponding target number of iterations for each block area.

[0198] In the above case, for each pixel in the first display area, when the pixel is in the display area other than the boundary area in the target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the first reaction-diffusion equation, until the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs. Further, when the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block to which the pixel belongs, the electronic device can determine the target color of the pixel based on the first concentration and the second concentration corresponding to the pixel (that is, the first concentration and the second concentration corresponding to the pixel after the target number of iterations is updated). Similarly, when the pixel is in the display area other than the boundary area in the non-target area, the electronic device can update the first concentration and the second concentration corresponding to the pixel based on the second reaction-diffusion equation, until the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs. Furthermore, when the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block to which the pixel belongs, the electronic device can determine the target color of the pixel based on the first concentration and the second concentration corresponding to the pixel (i.e., the first concentration and the second concentration corresponding to the pixel after the target number of iterations is updated). Similarly, when the pixel is in the boundary area, the electronic device can process the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel to obtain a third reaction-diffusion equation, and update the first concentration and the second concentration corresponding to the pixel based on the third reaction-diffusion equation until the number of iterations based on the third reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs. Further, when the number of iterations based on the third reaction-diffusion equation reaches the target number of iterations corresponding to the block to which the pixel belongs, the electronic device can determine the target color of the pixel based on the first concentration and the second concentration corresponding to the pixel (i.e., the first concentration and the second concentration corresponding to the pixel after the target number of iterations is updated).

[0199] It is understandable that the relevant description of the block area can refer to the context, and this application will not elaborate on it here.

[0200] S1024: Determine the target color of the pixel based on the first density and the second density corresponding to the pixel.

[0201] It is understandable that the specific implementation method of step S1024 can refer to the relevant description of step S1013, and this application will not go into details.

[0202] S2: Obtaining an Nth frame image of the first animation based on target color rendering of each pixel in the first display area.

[0203] When the target color of each pixel in the first display area is determined, the electronic device may render the Nth frame image of the first animation based on the target color of each pixel in the first display area.

[0204] S3: Displaying the Nth frame image of the first animation in the first display area.

[0205] After the electronic device renders and obtains the Nth frame image of the first animation, the Nth frame image may be displayed in the first display area.

[0206] The specific implementation of the above embodiment is described below by taking the target content as target text as an example.

[0207] For ease of understanding and description, when the target content is target text, this application records the target area as a text area and the non-target area as a non-text area.

[0208] 1. For pixels in text and non-text areas, electronic devices use reaction-diffusion equations with different parameters to determine their target colors, and render and display based on the target colors of these pixels.

[0209] In some embodiments of the present application, in response to the first operation, before displaying the first animation, the electronic device may determine the text area and non-text area in the first display area based on the target text. Moreover, before displaying any frame of the first animation, the electronic device may determine the color of the pixel points in the text area and the target color of the pixel points in the non-text area based on the corresponding reaction-diffusion equation, and then render the image to be displayed based on the target color of the pixel points in the text area and the non-text area. It is understandable that the electronic device can perform the above operations in a loop to display the first animation on the display screen.

[0210] The first animation may be an animation that displays the target text in a text area of the first display area using a fluid diffusion effect. The first animation includes multiple frames of images, and when the electronic device displays at least one frame of the multiple frames, the electronic device displays the target text in the text area of the display screen.

[0211] It is understandable that the first operation is used to trigger the electronic device to display the target text. In some embodiments of the present application, the first operation may be a lock screen operation. In this case, the target text may be the current system time. That is, in response to the lock screen operation, the electronic device may lock the screen and display the system time. In some other embodiments of the present application, the first operation may be an operation that triggers the start of a weather application (for example, clicking on the weather application icon). In this case, the target text may be the current temperature. That is, after the electronic device starts the weather application, the current temperature may be displayed. In some other embodiments of the present application, the first operation may be an operation that triggers a countdown. In this case, the target text may be the remaining timing duration.

[0212] In some embodiments of the present application, the first display area may be the entire display area of the display screen. In this case, the electronic device may display the first animation in the entire display area of the display screen, that is, display the target text with a fluid diffusion effect in the entire display area of the display screen. In some other embodiments of the present application, the first display area may be a partial display area of the display screen. In this case, the electronic device may display the first animation in a partial display area of the display screen, that is, display the target text with a fluid diffusion effect in a partial display area of the display screen, and display other content (for example, controls, patterns, text, etc. that the foreground application needs to display) in other display areas.

[0213] Take the first display area as the entire display area of the display screen as an example, Figure 5A As shown, the target text may be 1, the non-text area may be the area outside the glyph outline of 1, and the text area may be the area within the glyph outline of 1.

[0214] For example, the first display area may be the entire display area of the display screen, and the electronic device may display Figure 6A The desktop interface shown in FIG. 1 may be as follows: Figure 6A The operation of pressing the power button shown in the figure may include the following: Figure 6B-6D In response to the operation of pressing the power button, the electronic device can display the image shown in the display screen. Figure 6B-6D The interface shown, that is, the electronic device can display the current system time in the display screen with a fluid diffusion effect (such as Figures 6A-6D 15:27) animation shown.

[0215] In some embodiments of the present application, before displaying any frame image in the first animation, the electronic device can traverse each pixel in the first display area and determine its target color based on the reaction-diffusion equation. After the target color of each pixel in the first display area is determined, the image to be displayed is rendered based on the target colors of these pixels.

[0216] It is understandable that the present application does not limit the manner in which the electronic device traverses the pixels. For example, the electronic device may traverse the pixels in the first display area in the order from top to bottom and from left to right (the pixels with smaller row numbers are arranged in the front in the display screen, and for each row of pixels, the pixels with smaller column numbers are arranged in the front). For another example, the electronic device may first traverse the pixels in the text area, and then traverse the pixels in the non-text area. For another example, the electronic device may first traverse the pixels in the non-text area, and then traverse the pixels in the text area.

[0217] The reaction diffusion equations involved in the embodiments of the present application are described in detail below.

[0218] In some embodiments of the present application, the reaction-diffusion equation may be:

[0219] Where A' represents the current concentration of the first type of pixel. B' represents the current concentration of the first type of pixel. A represents the original concentration of the first type of pixel. B represents the original concentration of the second type of pixel.

[0220] In some embodiments of the present application, the concentration of the first type of pixel and the concentration of the second type of pixel can be represented by any two of the R channel, the G channel, and the B channel representing the pixel color. For example, the concentration of the first type of pixel can be represented by the R channel representing the pixel color, and the concentration of the second type of pixel can be represented by the G channel representing the pixel color.

[0221] In some embodiments of the present application, the concentration of the first type of pixel and the concentration of the second type of pixel can be represented by any two of the R channel, G channel, B channel, and transparency representing the pixel color. For example, the concentration of the first type of pixel can be represented by the B channel representing the pixel color, and the concentration of the second type of pixel can be represented by the transparency.

[0222] D A is the diffusion coefficient of the first type of pixels, which is used to quantify the diffusion speed of the first type of pixels in the second type of pixels. B is the diffusion coefficient of the second-class pixel, which quantifies how quickly the second-class pixel diffuses into the first-class pixel. The diffusion coefficient describes the rate at which a substance propagates in a medium due to a concentration gradient.

[0223] It is the Laplacian operator of the first type of pixel, representing the color change gradient. It is the Laplace operator of the second type of pixel, representing the color gradient. During the diffusion process, substances flow from high-concentration areas to low-concentration areas, and this flow can be described by the Laplace operator.

[0224] AB 2 Indicates the rate at which pixels of the first category are converted to pixels of the second category.

[0225] f represents the rate at which the first type of pixels are generated (i.e., the generation rate mentioned above). f(1-A) is a source term, representing the generation of the first type of pixels in the system (in this application, the display). This means that the generation rate of the first type of pixels is affected by their current concentration. When the concentration approaches 1, the source term approaches 0, indicating that the system is nearing saturation.

[0226] k represents the rate at which the second-class pixels disappear naturally (i.e., the disappearance rate mentioned above). -(k+f)B is a disappearance rate term, representing the disappearance of the second-class pixels in the system. This means that the disappearance rate of the second-class pixels is affected by their current concentration and the generation rate of the first-class pixels, with an additional constant k representing the natural death rate of the second-class pixels.

[0227] Δt represents the time change of each iteration.

[0228] It should be noted that the source term and the vanishing rate term in the reaction-diffusion equations involved in the embodiments of this application can be set according to actual needs, and this application does not impose any restrictions on this. The above f(1-A) and -(k+f)B are merely examples provided in the embodiments of this application and should not be considered as limitations on this application.

[0229] For ease of understanding and description, this application denotes the number of image frames included in the first animation as M, and denotes any frame of the first animation as the Nth frame. It is understood that N is less than or equal to M, and both N and M are positive integers.

[0230] The following describes a specific implementation method of the electronic device rendering and displaying the Nth frame image in the first animation.

[0231] In some embodiments of the present application, when displaying the N-1th frame image in the first animation, for each pixel in the first display area, if the pixel is in a text area, the electronic device can determine the target color of the pixel based on a first reaction-diffusion equation, and if the pixel is in a non-text area, the electronic device can determine the target color of the pixel based on a second reaction-diffusion equation. It is understood that after determining the target color of each pixel in the first display area, the electronic device can render the Nth frame image based on the target colors of these pixels and display the Nth frame image.

[0232] For ease of understanding and description, this application denotes the first generation rate and the first disappearance rate as f1 and k1, respectively, and denotes the second generation rate and the second disappearance rate as f2 and k2, respectively.

[0233] In some embodiments of the present application, the first reaction-diffusion equation may be: Similarly, the second reaction-diffusion equation can be expressed as:

[0234] It is understood that the meanings of the various parameters in the first reaction-diffusion equation and the second reaction-diffusion equation can be referred to above and will not be further elaborated in this application. It should be noted that A corresponding to different pixels can be different, and similarly, B corresponding to different pixels can also be different. It should be noted that A' and B' obtained from the previous iteration based on the reaction-diffusion equation are A and B for the next iteration based on the reaction-diffusion equation, respectively.

[0235] In some embodiments of the present application, the diffusion coefficient of the first type of pixel point in the first reaction-diffusion equation (ie, D A1 ) and the diffusion coefficient of the first type of pixel in the second reaction-diffusion equation (i.e. D A2 ) can be the same. Similarly, the diffusion coefficient of the second type of pixel point in the first reaction-diffusion equation (i.e., D B1 ) and the diffusion coefficient of the second type of pixel in the second reaction-diffusion equation (i.e. D B2 ) can be the same.

[0236] In some embodiments of the present application, the diffusion coefficient of the first type of pixel point in the first reaction-diffusion equation (ie, D A1 ) and the diffusion coefficient of the first type of pixel in the second reaction-diffusion equation (i.e. D A2 ) can be different. Similarly, the diffusion coefficient of the second type of pixel point in the first reaction-diffusion equation (i.e., D B1 ) and the diffusion coefficient of the second type of pixel in the second reaction-diffusion equation (i.e. D B2 ) can be different.

[0237] In some embodiments of the present application, after the electronic device receives the first operation, in response to the second operation on the first display area, for one or more pixel points in the first display area corresponding to the second operation, the electronic device can set its target color to the color of the first category of pixel points. Specifically, the electronic device can set its corresponding A and B accordingly so that the target color determined based on the set A and B is the color of the first category of pixel points (for example, setting its corresponding A and B to 1 and 0, respectively).

[0238] It is understandable that the second operation can be an operation such as touch, gesture, voice, etc., and this application does not limit its specific type.

[0239] For example, the first display area may be the entire display area of the display screen, the first type of pixel points may be white pixel points, and the second type of pixel points may be black pixel points. Figure 7A As shown, after receiving a first operation, the electronic device can set the entire first display area to black. After receiving a touch operation on the first display area, the electronic device can set the color of the pixels in the touch area corresponding to the touch operation to white. In subsequent processes, the electronic device can display white target text in the first display area with a fluid diffusion effect.

[0240] In some embodiments of the present application, when the interval length between the moment when the electronic device receives the first operation is not less than the first time length, the electronic device can randomly select one or more pixel points in the first display area and set their target color to the color of the first type of pixel points. Specifically, the electronic device can set its corresponding A and B accordingly so that the target color determined based on the set A and B is the color of the first type of pixel points (for example, setting its corresponding A and B to 1 and 0 respectively).

[0241] For example, the first display area may be the entire display area of the display screen, the first type of pixel points may be white pixel points, and the second type of pixel points may be black pixel points. Figure 7B As shown, when the duration of the electronic device receiving the first operation (starting from the time the electronic device receives the first operation) is less than the first duration, the color of the pixels in the first display area is not set separately. When the duration of the electronic device receiving the first operation is equal to or greater than the first duration, the electronic device can randomly select an area in the first display area and set the color of the pixels in the area to white. In the subsequent process, the electronic device can display the target text in white in the first display area with a fluid diffusion effect.

[0242] In some embodiments of the present application, the range of A and B involved in the present application may be [0, 1].

[0243] In some embodiments of the present application, the initial value of A corresponding to each pixel in the first display area is 0, and the initial value of B corresponding thereto is 1. In this case, the color of each pixel in the first display area is the color of the second type of pixel. In one possible implementation, after the electronic device receives the first operation, in response to the second operation on the first display area, for one or more pixel points in the first display area corresponding to the second operation, the electronic device may set the corresponding A to 1 and the corresponding B to 0. In another possible implementation, when the first time interval is separated from the moment when the electronic device receives the first operation, the electronic device may randomly select one or more pixel points in the first display area, set the corresponding A to 1, and set the corresponding B to 0.

[0244] It is understandable that the first duration can be set according to actual needs, and this application does not impose any restrictions on this. For example, the first duration can be 5 milliseconds (ms).

[0245] In some embodiments of the present application, for a pixel point in the first display area, the electronic device determines A' and B' based on the reaction-diffusion equation corresponding to the pixel point (i.e., the first reaction-diffusion equation / the second reaction-diffusion equation), and then determines the target color of the pixel point based on the size of A' and B'.

[0246] In one possible implementation, if A'>B', the electronic device can determine that the target color of the pixel is the color of the first category of pixel points. For example, if the first category of pixel points is a white pixel point, the electronic device can determine that the target color of the pixel point is white. However, if A'≤B', the electronic device can determine that the target color of the pixel point is the color of the second category of pixel points. For example, if the second category of pixel points is a black pixel point, the electronic device can determine that the target color of the pixel point is black.

[0247] In another possible implementation, if the value of A'-B' is greater than the first difference, the electronic device can determine that the target color of the pixel is the color of the first type of pixel; however, if the value of A'-B' is less than or equal to the first difference, the electronic device can determine that the target color of the pixel is the color of the second type of pixel.

[0248] It is understood that the first difference can be set according to actual needs, and this application does not limit this. For example, the first difference can be 0.2. For another example, the first difference can be 0.3.

[0249] In another possible implementation, if A' is within the first concentration range and B' is within the second concentration range, the electronic device can determine that the target color of the pixel is the color of the first type of pixel; however, if A' is not within the first concentration range, or B' is not within the second concentration range, the electronic device can determine that the target color of the pixel is the color of the second type of pixel.

[0250] It is understood that the first concentration range and the second concentration range can be set according to actual needs, and this application does not limit this. For example, the first concentration range can be [0.5, 1], and the second concentration range can be [0, 0.5].

[0251] 2. On the one hand, for the pixel points in the text area and non-text area except the boundary area, the electronic device uses a reaction diffusion equation with different parameters to determine their target color. On the other hand, for the pixel points in the boundary area between the text area and the non-text area, the electronic device mixes the parameters in the reaction diffusion equations corresponding to the text area and the non-text area based on their SDF distance to obtain a mixed reaction diffusion equation, and determines its target color based on the mixed reaction diffusion equation, and then renders and displays based on the target color of each pixel point in the first display area.

[0252] In some embodiments of the present application, in response to the first operation, before displaying the first animation, the electronic device can determine the text area and non-text area in the first display area based on the target text, and determine the boundary area based on the SDF of the target text. In addition, before displaying any frame image in the first animation, for the pixel points in the text area excluding the boundary area and the pixel points in the non-text area excluding the boundary area, the electronic device can determine the target color of the pixel point based on the corresponding reaction diffusion equation, and for the pixel points in the boundary area, the electronic device can mix the parameters in the reaction diffusion equation corresponding to the text area and the non-text area respectively based on the SDF distance of the pixel point to obtain a mixed reaction diffusion equation, and determine the target color of the pixel point based on the mixed reaction diffusion equation. In this way, the electronic device can render the image to be displayed based on the target color of each pixel point in the first display area (including the pixel points in the three areas of the text area excluding the boundary area, the non-text area excluding the boundary area, and the boundary area). It can be understood that the electronic device can perform the above operations in a loop to display the first animation on the display screen.

[0253] It is understood that the boundary area can be the area around the boundary line between the text area and the non-text area (such as the outline of the target text). The boundary area can include part of the text area and part of the non-text area. For example, the first display area is the entire display area of the display screen. Figure 5B As shown, the text area can be the area within the outline of the glyph 1, the non-text area can be the area outside the outline of the glyph 1, the boundary area can include part of the text area and part of the non-text area, the boundary area can be a white filled area, the black line in the white filled area is the outline of the glyph 1, and Figure 5B The two black filled areas are the non-text area excluding the boundary area and the text area excluding the boundary area.

[0254] The SDF of a target character is the minimum distance between a pixel and the target character's outline. If a pixel is inside the target character, its SDF distance is negative. If a pixel is within the target character's outline, its SDF distance is zero. If a pixel is outside the target character, its SDF distance is positive.

[0255] In some embodiments of the present application, the electronic device can obtain the SDF corresponding to each pixel in the first display area through the SDF image corresponding to the target text. For example, among the three channels corresponding to the pixel in the SDF image (such as the R channel, G channel, and B channel in the RGB color space), one channel can be used to store the SDF corresponding to the pixel, and the other two channels can be used to store the coordinates of the pixel on the display. In this case, the electronic device can determine the SDF corresponding to the pixel and the coordinates of the pixel on the display through the channel values of the pixel in the SDF image.

[0256] For example, Figure 8A and Figure 8B The following is the SDF when the target characters are 1 and 6. Figure 8A As shown in , the SDF distance of the pixel points located inside 1 is negative, the SDF distance of the pixel points located on the outline of 1 is 0, and the SDF distance of the pixel points located outside 1 is positive. Figure 8B As shown in FIG, the SDF distance of the pixel points located inside the 6 is negative, the SDF distance of the pixel points located on the outline of the 6 is 0, and the SDF distance of the pixel points located outside the 6 is positive.

[0257] It is understandable that the relevant description of traversing the pixel points in the first display area can be referred to above, and this application will not elaborate on it again.

[0258] The following describes a specific implementation method of the electronic device rendering and displaying the Nth frame image in the first animation.

[0259] It is understandable that when displaying the N-1th frame image in the first animation, for each pixel on the first display area, when the pixel is in a text area other than the boundary area, the electronic device can determine the target color of the pixel based on the first reaction-diffusion equation, and when the pixel is in a non-text area other than the boundary area, the electronic device can determine the target color of the pixel based on the second reaction-diffusion equation, and when the pixel is in the boundary area, the electronic device can mix the parameters in the first reaction-diffusion equation and the second reaction-diffusion equation based on the SDF distance of the pixel to obtain mixed parameters and a mixed reaction-diffusion equation, and the electronic device can determine the target color of the pixel based on the mixed reaction-diffusion equation. It is understandable that after determining the target color of each pixel in the first display area, the electronic device can render the Nth frame image based on the target colors of these pixels and display the Nth frame image.

[0260] The following specifically introduces the implementation method of mixing the parameters in the first reaction-diffusion equation and the second reaction-diffusion equation.

[0261] It can be understood that for the pixel points in the boundary area, the electronic device can perform smoothing processing, determine the corresponding interpolation factor based on the SDF distance of the pixel point, and then mix the parameters in the first reaction-diffusion equation and the second reaction-diffusion equation based on the corresponding interpolation factor to obtain the mixed reaction-diffusion equation, and determine the color of the pixel point based on the reaction-diffusion equation.

[0262] In some embodiments of the present application, the SDF distances of the pixels in the boundary area are all within the first distance range. It is understandable that the first distance range can be set according to actual needs, and the present application does not impose any restrictions on this. For example, the first distance range can be [-0.01, 0.01]. Exemplarily, in the case where the first animation consists of multiple frames of 1024 pixel * 1024 pixel images, the length of a pixel is recorded as 1 / 1024, which is approximately 0.001. In this case, the first distance range of [-0.01, 0.01] represents a range that is no more than 10 pixels away from the glyph outline of the target text (including a range that is no more than 10 pixels away from the glyph outline of the target text in the text area and the non-text area).

[0263] In some embodiments of the present application, the electronic device can smooth the boundary area based on the smoothstep function. It is understood that the smoothstep function can provide a smooth transition between two values, which is very useful in computer graphics, especially in scenes that require a smooth transition between two colors, textures, or values.

[0264] In some embodiments of the present application, the interpolation factor may be: dText = 1-smoothstep (minimum value in the first distance range, maximum value in the first distance range, SDF distance of the pixel). For example, dText = 1-smoothstep (-0.01, 0.01, sdfFont). sdfFont refers to the SDF distance of the pixel.

[0265] In some embodiments of the present application, the electronic device can perform linear interpolation processing on the first generation rate and the second generation rate based on the interpolation factor corresponding to the pixel point to obtain a mixed generation rate. Similarly, the electronic device can perform linear interpolation processing on the first disappearance rate and the second disappearance rate based on the interpolation factor corresponding to the pixel point to obtain a mixed disappearance rate.

[0266] For ease of understanding and description, this application records the generation rate after mixing as f3 and the disappearance rate after mixing as k3.

[0267] In some embodiments of the present application, the electronic device may mix the first generation rate and the second generation rate based on a mix function. That is, f3 = mix(f2, f1, dText). Similarly, the electronic device may also mix the first disappearance rate and the second disappearance rate based on a mix function. That is, k3 = mix(k2, k1, dText). It is understood that the mix function is mainly used to perform linear interpolation between two values.

[0268] In some embodiments of the present application, the first-type diffusion coefficient in the first reaction-diffusion equation and the second reaction-diffusion equation are the same, and the second-type diffusion coefficient in the first reaction-diffusion equation and the second reaction-diffusion equation are also the same. In this case, the electronic device can directly replace the generation rate and disappearance rate in the first reaction-diffusion equation or the second reaction-diffusion equation with the mixed generation rate and the mixed disappearance rate, respectively, to obtain the mixed reaction-diffusion equation.

[0269] In some embodiments of the present application, the first-type diffusion coefficients in the first reaction-diffusion equation and the second-type diffusion coefficients in the second reaction-diffusion equation are different, and the second-type diffusion coefficients in the first reaction-diffusion equation and the second reaction-diffusion equation are also different. In this case, the electronic device needs to mix not only the generation rate and the disappearance rate in the first reaction-diffusion equation and the second reaction-diffusion equation, but also the diffusion coefficients in the first reaction-diffusion equation and the second reaction-diffusion equation.

[0270] For ease of understanding and description, this application denotes the diffusion coefficient of the first type of pixel after mixing as D A3 , the diffusion coefficient of the second type of pixel after mixing is recorded as D B3 .

[0271] In some embodiments of the present application, the electronic device can mix the diffusion coefficients of the first type of pixel points in the first reaction-diffusion equation and the second reaction-diffusion equation based on the mix function, and mix the diffusion coefficients of the second type of pixel points in the first reaction-diffusion equation and the second reaction-diffusion equation. That is, D A3 =mix(D A2 ,D A1 ,dText),D B3 =mix(D B2 ,D B1 ,dText).

[0272] It should be noted that, for different pixel points in the boundary area, the corresponding interpolation factors may be the same or different, which means that the corresponding reaction-diffusion equations after mixing may be the same or different.

[0273] It can be understood that, similar to the above, for the pixel points in the first display area, the electronic device determines A' and B' based on the reaction diffusion equation corresponding to the pixel point (i.e., the first reaction diffusion equation / the second reaction diffusion equation / the mixed reaction diffusion equation), and then determines the target color of the pixel point based on the size of A' and B'. The specific implementation method can be referred to above, and this application will not go into details.

[0274] 3. On the one hand, the electronic device divides the first display area and adjusts the target number of iterations of each block area in the image to be displayed based on the color gradient changes of the displayed image. On the other hand, for the pixels in the text area and the non-text area, the electronic device uses reaction diffusion equations with different parameters to determine the target color of the pixel. Until the number of iterations of each pixel in the text area and the non-text area reaches the target number of iterations corresponding to the block area to which it belongs, the electronic device performs rendering based on the target color of each pixel in the first display area.

[0275] In some embodiments of the present application, in response to the first operation, before displaying the first animation, the electronic device can determine the text area and non-text area in the first display area based on the target text, and can also divide the first display area. Moreover, before displaying any frame image of the first animation, the electronic device can adjust the target number of iterations of each block area, and use the corresponding reaction diffusion equation to determine the target color of each pixel in the first display area, until the number of iterations of each pixel in the first display area is the target number of iterations corresponding to it (that is, the target number of iterations corresponding to the block area to which it belongs), the electronic device can render the image to be displayed based on the target color of each pixel. It is understandable that the electronic device can perform the above operations in a loop to display the first animation on the display screen.

[0276] It can be understood that the target number of iterations refers to the number of calculations (iterations) performed based on the reaction-diffusion equation to determine the target color of a pixel. In other words, the target number of iterations refers to the number of times A' and B' need to be determined based on the reaction-diffusion equation before the electronic device renders the Nth frame of image after the electronic device has displayed the N-1th frame of image. In other words, the target number of iterations refers to the number of times the reaction-diffusion equation needs to be calculated before the target color of the pixel is determined.

[0277] In some embodiments of the present application, the target color of each pixel in the first display area used by the electronic device when rendering the image to be displayed is the most recently determined target color.

[0278] In some embodiments of the present application, before displaying any frame image of the first animation, before the number of iterations of the pixel point (the number of iterations when the previous frame image of the arbitrary frame image has been displayed) reaches the target number of iterations, the electronic device can determine A' and B' only based on the reaction-diffusion equation corresponding to the pixel point, and no longer determine the target pixel of the pixel point based on A' and B'. Instead, when the number of iterations of the pixel point reaches the target number of iterations, the electronic device determines A' and B' based on the reaction-diffusion equation corresponding to the pixel point, and determines the target pixel of the pixel point based on A' and B'.

[0279] For example, if the target iteration number for a pixel point in the first display area is 3 times, after the electronic device determines A' and B' based on the reaction diffusion equation corresponding to the pixel point for the first time, there is no need to determine the target color of the pixel point based on A' and B'. Similarly, after the electronic device re-determines A' and B' based on the reaction diffusion equation corresponding to the pixel point for the second time, there is no need to determine the target color of the pixel point based on the re-determined A' and B'. After the electronic device re-determines A' and B' based on the reaction diffusion equation corresponding to the pixel point for the third time, it can determine the target color of the pixel point based on the re-determined A' and B'.

[0280] In some embodiments of the present application, before displaying any frame of the first animation, regardless of whether the number of iterations for a pixel is less than or equal to a target number of iterations, the electronic device may determine A' and B' based on the reaction-diffusion equation corresponding to the pixel, and determine the target pixel for the pixel based on A' and B'. If the number of iterations for the pixel is less than the target number of iterations, the electronic device may update the target pixel for the pixel based on the next determination of A' and B'.

[0281] For example, if the target iteration number for a pixel point in the first display area is 3 times, after the electronic device determines A' and B' for the first time based on the reaction-diffusion equation corresponding to the pixel point, it can determine the target color of the pixel point based on A' and B'. Similarly, after the electronic device re-determines A' and B' for the second time based on the reaction-diffusion equation corresponding to the pixel point, it can also re-determine the target color of the pixel point based on the re-determined A' and B', and update the target color of the pixel point to the re-determined target color. Similarly, after the electronic device re-determines A' and B' for the third time based on the reaction-diffusion equation corresponding to the pixel point, it can re-determine the target color of the pixel point based on the re-determined A' and B', and update the target color of the pixel point to the re-determined target color.

[0282] In some embodiments of the present application, in response to the first operation, after the electronic device sets the target color of one or more pixels in the first display area to the color of the first type of pixel, the electronic device may begin to adjust the target number of iterations for each block area.

[0283] In some embodiments of the present application, in response to the first operation, when the second time interval between the moment when the electronic device sets the target color of one or more pixels in the first display area to the color of the first type of pixel points is exceeded, the electronic device may begin to adjust the target number of iterations for each block area.

[0284] It is understandable that the second duration can be set according to actual needs, and this application does not impose any restrictions on this. For example, the second duration can be 10ms.

[0285] The following describes a specific implementation method of the electronic device dividing the first display area into multiple block areas.

[0286] It is understood that the present application does not limit the division method of the first display area. In some embodiments of the present application, the electronic device can divide the first display area based on one or more factors such as a preset block area, a preset block shape, a preset number of blocks, and a division interval.

[0287] In one possible implementation, the electronic device may divide the first display area into a plurality of segmented areas having the same area. For example, the preset segmented area may be a fixed value, so that the electronic device may divide the first display area into a plurality of segmented areas having the same area or having completely different areas. For another example, the preset segmented area may include multiple segmented areas having different areas.

[0288] In a possible implementation, the electronic device may divide the first display area into a plurality of rectangular areas of the same area according to a preset area and a preset shape.

[0289] In a possible implementation, the electronic device may divide the first display area into a preset number of blocks and a preset shape.

[0290] In a possible implementation, the electronic device may divide the first display area into preset division intervals.

[0291] It is understandable that the preset block area, preset block shape, preset block number, and division interval can be set according to actual needs, and this application does not impose any restrictions on this.

[0292] For example, the preset number of blocks may be 9, and the preset shape may be a rectangle. Figure 9 As shown, the electronic device can divide the first display area into 9 rectangular areas. It is understandable that these 9 rectangular areas can be completely identical rectangular areas, or rectangular areas with different areas or different side lengths, and this application does not limit this.

[0293] Of course, the electronic device may also use other division methods to divide the first display area, and this application does not limit this.

[0294] It is understandable that the relevant description of traversing the pixel points in the first display area can be referred to above, and this application will not elaborate on it again.

[0295] The following describes a specific implementation method for the electronic device to adjust the target number of iterations of the pixels in each block area.

[0296] It is understandable that the target number of iterations for each pixel in the same block area may be the same.

[0297] In some embodiments of the present application, each block area corresponds to the same initial target iteration number. That is, before the electronic device displays the first animation, the target iteration number corresponding to the pixels in each block area of the first display area is the same.

[0298] In some embodiments of the present application, the electronic device may create a Laplacian operator sliding window that may include the last h frames displayed in the first animation. Before displaying the next frame of the first animation, the electronic device may adjust the target number of iterations for each block region based on the color gradient changes in each block region in the h frames. It is understood that h is a positive integer.

[0299] It is understood that the specific value of h can be set according to actual needs, and this application does not limit this. For example, h can be 4. That is, the sliding window can include the 4 frames of images that have been displayed on the display screen and are displayed latest in the first animation. For example, Figure 10 As shown, when the electronic device displays the N-1th frame image of the first animation, the sliding window may include the N-4th frame image, the N-3th frame image, the N-2th frame image and the N-1th frame image of the first animation.

[0300] For ease of understanding and description, the present application records the number of pixels of the Laplacian operator within the color gradient range in each block area of the first display area as the Laplacian operator corresponding to the block area.

[0301] In some embodiments of the present application, when determining the Laplacian operator of the i-th block area, for each pixel in the i-th block area, the electronic device may combine the R channel value and the G channel value of the four pixels surrounding the pixel (the four pixels above, below, left, and right) to determine the Laplacian operator of the pixel. After determining the Laplacian operator of each pixel in the i-th block area, the electronic device may determine the number of pixels within the color gradient range whose corresponding Laplacian operator is present.

[0302] The Laplacian operator of a pixel can be expressed as:

[0303]

[0304] Among them, e(x,y) represents the R channel value and G channel value of the pixel (or a two-dimensional array composed of the R channel value and G channel value of the pixel), e(x+1,y), e(x-1,y), e(x,y+1) and e(x,y-1) represent the R channel value and G channel value of the four pixels around the pixel.

[0305] The above method of determining the Laplacian operator of a pixel based on the R channel value and the G channel value is only an example provided by this application and should not be considered as limiting this application. In some embodiments of this application, when the electronic device determines the Laplacian operator of a pixel, it can be calculated based on any two of the R channel value, the G channel value, and the B channel value.

[0306] It is understood that pixels whose corresponding Laplacian operator is within the color gradient range are edge pixels. The color gradient range can be set according to actual needs and is not limited in this application. For example, the color gradient range can be different from 0. In other words, the Laplacian operator corresponding to the pixel is within the color gradient range, which specifically includes: the Laplacian operator corresponding to the pixel is different from 0.

[0307] In some embodiments of the present application, when displaying the N-1th frame image in the first animation, for the i-th block area in the first display area, on the one hand, the electronic device can respectively determine the Laplacian operator of the i-th block area in the h frames of image displayed in the sliding window, and determine the average value of the Laplacian operators of the h i-th block areas. On the other hand, the electronic device can determine the current Laplacian operator of the i-th block area. It can be understood that i is a positive integer and i is less than or equal to h.

[0308] In one possible implementation, if the current Laplace operator of the i-th block area is greater than the average value, the electronic device may increase the target number of iterations corresponding to the i-th block area; if the current Laplace operator of the i-th block area is equal to the average value, the electronic device may maintain the target number of iterations corresponding to the i-th block area; and if the current Laplace operator of the i-th block area is less than the average value, the electronic device may reduce the target number of iterations corresponding to the i-th block area. In another possible implementation, if the current Laplace operator of the i-th block area is greater than the average value, the electronic device may increase or maintain the target number of iterations corresponding to the i-th block area; and if the current Laplace operator of the i-th block area is less than or equal to the average value, the electronic device may reduce the target number of iterations corresponding to the i-th block area.

[0309] In some embodiments of the present application, the electronic device increases the target number of iterations corresponding to the i-th block area, which may specifically include: the electronic device increases the target number of iterations corresponding to the i-th block area by c1 times.

[0310] In some embodiments of the present application, the electronic device reduces the target number of iterations corresponding to the i-th block area, which may specifically include: the electronic device reduces the target number of iterations corresponding to the i-th block area by c2 times.

[0311] It is understood that c1 and c2 are positive integers, and their specific values can be set according to actual needs, and this application does not impose any restrictions on this. It is understood that c1 and c2 can be the same or different. For example, c1 and c2 can be 1. For another example, c1 can be 2, and c2 can be 1.

[0312] In some embodiments of the present application, the target number of iterations corresponding to the i-th block area is less than or equal to a preset maximum number of iterations.

[0313] It is understandable that the preset maximum number of iterations can be set according to actual needs, and this application does not limit this. In some embodiments of the present application, the preset maximum number of iterations can be set according to the performance of the electronic device (such as the GPU operating capability of the electronic device), and the performance of the electronic device can be determined by factors such as its hardware specifications and software configuration. For example, for an electronic device with better performance, the preset maximum number of iterations can be 10, and for an electronic device with poor performance, the preset maximum number of iterations can be 3. In some embodiments of the present application, the preset maximum number of iterations can be within a preset iteration range. For example, the preset iteration range can be 5-8 (including 5 and 8). In this case, the preset maximum number of iterations can be set to any integer between 5-8.

[0314] The following describes a specific implementation method of the electronic device rendering and displaying the Nth frame image in the first animation.

[0315] It can be understood that when displaying the N-1th frame image in the first animation, the electronic device can traverse the pixel points in the first display area again and again until the number of iterations of each pixel point in the first display area reaches its target number of iterations. The electronic device can stop traversing the pixel points in the first display area and render the Nth frame image based on the target color of each pixel point in the first display area.

[0316] In the above process of traversing the pixels in the first display area, the electronic device may perform the following steps for any pixel in the first display area:

[0317] The electronic device can determine the target number of iterations of the block area to which the pixel point belongs, and determine whether the number of iterations of the pixel point (that is, the number of times the pixel point has been iterated) has reached the target number of iterations of the block area to which it belongs. If the number of iterations of the pixel point has not reached the target number of iterations of the block area to which it belongs, that is, the number of iterations of the pixel point is less than the target number of iterations of the block area to which it belongs, the electronic device can continue to iterate on the pixel point, that is, when the pixel point is in a text area, the electronic device can update the target color of the pixel point based on the first reaction-diffusion equation, and when the pixel point is in a non-text area, the electronic device can update the target color of the pixel point based on the second reaction-diffusion equation. If the number of iterations of the pixel point reaches the target number of iterations of the block area to which it belongs, that is, the number of iterations of the pixel point is the target number of iterations of the block area to which it belongs, the electronic device will no longer iterate on the pixel point before rendering the image to be displayed, that is, the electronic device will no longer update the target color of the pixel point based on the reaction-diffusion equation, that is, the target color of the pixel point is the target color determined at the last iteration.

[0318] It is understandable that the description of the reaction diffusion equation and the target color of the updated pixel point can be referred to above, and this application will not go into details.

[0319] 4. On the one hand, the electronic device divides the first display area and adjusts the target number of iterations for each block area in the image to be displayed based on the color gradient changes of the image already displayed. On the other hand, for pixels in the text area and non-text area excluding the boundary area, the electronic device uses reaction-diffusion equations with different parameters to determine their target colors. On the other hand, for pixels in the boundary area between the text area and the non-text area, the electronic device mixes the parameters in the reaction-diffusion equations corresponding to the text area and the non-text area based on their SDF distance to obtain a mixed reaction-diffusion equation, and determines its target color based on the mixed reaction-diffusion equation. Until the number of iterations for each pixel in the first display area reaches the target number of iterations corresponding to the block area to which it belongs, the electronic device performs rendering based on the target color of each pixel.

[0320] In some embodiments of the present application, in response to the first operation, before displaying the first animation, the electronic device can determine the text area and non-text area in the first display area based on the target text, and can also determine the boundary area based on the SDF of the target text, and can also divide the first display area. In addition, before displaying any frame of the first animation, the electronic device can adjust the target iteration number of each block area, and for the pixel points in the text area excluding the boundary area and the pixel points in the non-text area excluding the boundary area, the electronic device can determine the target color of the pixel point based on the corresponding reaction diffusion equation, and for the pixel points in the boundary area, the electronic device can mix the parameters in the reaction diffusion equation corresponding to the text area and the non-text area respectively based on the SDF distance of the pixel point, obtain the mixed reaction diffusion equation, and determine the target color of the pixel point based on the mixed reaction diffusion equation, until the iteration number of each pixel point in the first display area is the target iteration number corresponding to it (that is, the target iteration number corresponding to the block area to which it belongs), the electronic device can render the image to be displayed based on the target color of each pixel point in the first display area. It can be understood that the electronic device can perform the above operations in a loop to display the first animation on the display screen.

[0321] The following describes a specific implementation method of the electronic device rendering and displaying the Nth frame image in the first animation.

[0322] It can be understood that when displaying the N-1th frame image in the first animation, the electronic device can traverse the pixel points in the first display area again and again until the number of iterations of each pixel point in the first display area reaches its target number of iterations. The electronic device can stop traversing the pixel points in the first display area and render the Nth frame image based on the target color of each pixel point in the first display area.

[0323] In the above process of traversing the pixels in the first display area, the electronic device may perform the following steps for any pixel in the first display area:

[0324] The electronic device can determine the target number of iterations of the block area to which the pixel point belongs, and determine whether the number of iterations of the pixel point (i.e., the number of times the pixel point has been iterated) has reached the target number of iterations of the block area to which it belongs. If the number of iterations of the pixel point has not reached the target number of iterations of the block area to which it belongs, that is, the number of iterations of the pixel point is less than the target number of iterations of the block area to which it belongs, the electronic device can continue to iterate on the pixel point, that is, when the pixel point is in a text area other than the boundary area, the electronic device can update the target color of the pixel point based on the first reaction-diffusion equation, and when the pixel point is in a non-text area other than the boundary area, the electronic device can update the target color of the pixel point based on the second reaction-diffusion equation, and when the pixel point is in the boundary area, the electronic device can mix the parameters in the first reaction-diffusion equation and the second reaction-diffusion equation based on the SDF distance of the pixel point to obtain mixed parameters and the mixed reaction-diffusion equation, and update the target color of the pixel point based on the mixed reaction-diffusion equation. If the number of iterations of the pixel point reaches the target number of iterations for the block area to which it belongs, that is, the number of iterations of the pixel point is the target number of iterations for the block area to which it belongs, then the electronic device will no longer iterate the pixel point before rendering the image to be displayed. In other words, the electronic device will no longer update the target color of the pixel point based on the reaction-diffusion equation, that is, the target color of the pixel point is the target color determined at the last iteration.

[0325] It is understandable that the description of the reaction diffusion equation and the target color of the updated pixel point can be referred to above, and this application will not go into details.

[0326] It should be noted that, based on any of the above display methods, if the target text changes, the electronic device can redefine the text area and non-text area based on the changed target text. Based on the second display method described above, the electronic device can further determine the SDF of the changed target text and redefine the boundary area based on the SDF.

[0327] For example, Figure 11As shown in (a), (b) and (c), when the target text changes from 16 to 17, the electronic device can determine that the target text has changed and change the displayed text from 16 to 17 with a fluid diffusion effect.

[0328] For example, Figure 12 As shown, in the lock screen state, when the current system time changes from 15:27 to 15:28, the electronic device can determine that the target text has changed. In this case, the electronic device can redefine the text area and non-text area based on the changed system time, and use the corresponding reaction diffusion equation to determine the target color of each pixel on the display screen, thereby achieving the change of the text displayed from 15 and 27 to 15 and 28 with a fluid diffusion effect.

[0329] It should also be noted that, based on any of the above-mentioned display methods, when the electronic device displays the target text in the text area of the first display area with a fluid diffusion effect (for example, the electronic device displays the first animation), if the electronic device receives an operation on the first display area, the electronic device can set the pixel points in the area corresponding to the operation to the color of the second type of pixel points (for example, black).

[0330] That is to say, in the case of receiving an operation for the first display area, for any pixel in the first display area, the electronic device can also determine whether the pixel is in the area corresponding to the operation before executing any of the above display methods. If the pixel is in the area corresponding to the operation, the electronic device can determine that the target color of the pixel is the color of the second type of pixel and does not iterate it. If the pixel is not in the area corresponding to the operation, the electronic device can execute any of the above display methods to determine the target color of the pixel. That is, when the user's sliding position on the display screen changes, on the one hand, the electronic device does not need to keep the color of the pixel at the original sliding position as the color of the second type of pixel, but determines the target color of the pixel at the original sliding position based on the above display method. On the other hand, the electronic device can set the target color of the pixel at the current sliding position to the color of the second type of pixel, without determining the target color of the current sliding position based on the above display method.

[0331] In one possible implementation, the operation on the first display area may be a touch operation. In this case, the area corresponding to the touch operation is the area corresponding to the touch point, i.e., the touch area. It is understood that the touch area may be smaller or larger than the actual touch area, or the same as the actual touch area, and this application does not impose any limitation on this.

[0332] For example, Figure 13As shown in (a), (b) and (c) of FIG, when the electronic device displays the number 16 on the display screen with a fluid diffusion effect, the user can slide on the display screen. In response to the sliding operation, the corresponding sliding area on the display screen is uniformly displayed in black. Figure 13 (a) and Figure 13 As shown in (c) of FIG, when the user slides the display screen from the area where the number 1 is located to the area where the number 6 is located, on the one hand, the electronic device does not need to keep the color of the pixel at the original sliding position in the area where the number 1 is located black, but instead determines the target color of the pixel at the original sliding position based on the above display method, such as Figure 13 As shown in (c) in the figure, the black pixels displayed due to sliding in the area where the number 1 is located are changed back to white pixels. On the other hand, the electronic device can set the target color of the pixel at the sliding position currently located in the area where the number 6 is located to black, without having to determine the target color of the current sliding position based on the above display method.

[0333] For example, Figures 14A-14C As shown, when the electronic device displays the current system time on the display screen with a fluid diffusion effect, the user can slide on the display screen. In response to the sliding operation, the corresponding sliding area on the display screen is uniformly displayed in black. Figure 14B and Figure 14C As shown, when the user changes the sliding position on the display screen from a position near the number 2 to a position near the number 7, on the one hand, the electronic device does not need to keep the color of the pixel point near the number 2 black, but determines the target color of the pixel point at the original sliding position based on the above display method. On the other hand, the electronic device can set the target color of the pixel point at the sliding position near the number 7 to black, without determining the target color of the current sliding position based on the above display method.

[0334] Furthermore, based on any of the above display methods, when the electronic device displays target text in a text area of the first display area with a fluid diffusion effect (for example, the electronic device displays a first animation), if the electronic device receives an operation on the first display area, the electronic device can divide the first display area into a high diffusion area and a low diffusion area based on the operation. In some embodiments of the present application, the operation can be a touch operation, and the block areas involved in the operation can include the block area touched by the user.

[0335] In some embodiments of the present application, in response to the first operation, the electronic device does not divide the first display area into multiple blocks. In this case, if the subsequent electronic device receives an operation for the first display area, the electronic device can divide the high diffusion area and the low diffusion area based only on the display area involved in the operation.

[0336] It is understood that the specific implementation method of dividing the area involved here can refer to the specific implementation method of dividing the block area above. Figure 15 As shown, the electronic device may divide a rectangular area in the first display area involved in the operation into a high diffusion area, and another rectangular area in the first display area into a low diffusion area.

[0337] In some other embodiments of the present application, in response to a first operation, the electronic device divides the first display area into multiple blocks. In this case, if the subsequent electronic device receives an operation on the first display area, the electronic device can determine that the high diffusion area includes the block area involved in the operation, and the low diffusion area includes the block area not involved in the operation.

[0338] For example, Figure 16 As shown, the electronic device divides the first display area into 9 block areas, namely A1, A2, A3, A4, A5, A6, A7, A8 and A9, and subsequently divides the first display area into a high diffusion area and a low diffusion area. The high diffusion area includes the entire area of A1, A2 and A3, and part of the area of A4, A5 and A6, and the low diffusion area includes part of the area of A4, A5 and A6, and the entire area of A7, A8 and A9. In this case, the electronic device can set the target number of iterations of A1, A2, A3, A4, A5 and A6 to the number of iterations corresponding to the high diffusion area, and set the target number of iterations of A7, A8 and A9 to the number of iterations corresponding to the low diffusion area.

[0339] It is understandable that the display method involved in the embodiment of the present application can be implemented by a lock screen application, a text rendering module and a display screen (such as Figure 1 and Figure 2 The lock screen application can be used to detect the first operation and trigger the display of target text with a fluid diffusion effect. The text rendering module is used to determine the target color of each pixel in the first display area. The display screen is used to display the image to be displayed (such as the multiple frames of the first animation).

[0340] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A display method, characterized in that: The method is applied to an electronic device, and includes: In response to a first operation, a first animation is displayed in a first display area; the first display area includes a target area and a non-target area; the first animation is an animation that displays target content in the target area with a fluid diffusion effect; the first animation includes multiple frames of images, at least one of the multiple frames of images includes the target content; Among them, for any frame image in the first animation, the color of each pixel point in the target area is determined based on the first reaction-diffusion equation, and the color of each pixel point in the non-target area is determined based on the second reaction-diffusion equation; the first reaction-diffusion equation includes a first generation rate and a first disappearance rate, and the second reaction-diffusion equation includes 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, and 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 color of the first type of pixel points is different from the color of the second type of pixel points, the first generation rate is different from the second generation rate, and the first disappearance rate is different from the second disappearance rate.

2. The method according to claim 1, wherein The method further comprises: Before displaying the first animation, in response to the first operation, determining the target area and the non-target area based on the target content; The displaying of the first animation in the first display area includes: When displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the target area, updating the first concentration and the second concentration corresponding to the pixel based on the first reaction-diffusion equation; if the pixel is in the non-target area, updating the first concentration and the second concentration corresponding to the pixel based on the second reaction-diffusion equation; N is a positive integer; the first concentration is the concentration of the first type of pixel, and the second concentration is the concentration of the second type of pixel; determining a target color of the pixel point based on a first density and a second density corresponding to the pixel point; Obtaining an Nth frame image of the first animation based on target color rendering of each pixel in the first display area; The Nth frame image is displayed in the first display area.

3. The method according to claim 1, wherein The method further comprises: Before displaying the first animation, in response to the first operation, determining the target area and the non-target area based on the target content, and determining a boundary area between the target area and the non-target area in the first display area based on a signed distance field (SDF) corresponding to the target content; The displaying of the first animation in the first display area includes: When displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the display area of the target area excluding the boundary area, the first concentration and the second concentration corresponding to the pixel are updated based on the first reaction-diffusion equation; if the pixel is in the display area of the non-target area excluding the boundary area, the first concentration and the second concentration corresponding to the pixel are updated based on the second reaction-diffusion equation; if the pixel is in the boundary area, the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation are processed based on the SDF corresponding to the pixel to obtain a third reaction-diffusion equation, and the first concentration and the second concentration corresponding to the pixel are updated based on the third reaction-diffusion equation; N is a positive integer; the first concentration is the concentration of the first type of pixel, and the second concentration is the concentration of the second type of pixel; determining a target color of the pixel point based on a first density and a second density corresponding to the pixel point; Obtaining an Nth frame image of the first animation based on target color rendering of each pixel in the first display area; The Nth frame image is displayed in the first display area.

4. The method according to claim 1, wherein The method further comprises: Before displaying the first animation, in response to the first operation, determining the target area and the non-target area based on the target content, and dividing the first display area into a plurality of block areas; The displaying of the first animation in the first display area includes: When displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the target area, the first concentration and the second concentration corresponding to the pixel are updated based on the first reaction-diffusion equation until the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; if the pixel is in the non-target area, the first concentration and the second concentration corresponding to the pixel are updated based on the second reaction-diffusion equation until the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; N is a positive integer; the first concentration is the concentration of the first type of pixel, and the second concentration is the concentration of the second type of pixel; determining a target color of the pixel point based on a first density and a second density corresponding to the pixel point; Obtaining an Nth frame image of the first animation based on target color rendering of each pixel in the first display area; The Nth frame image is displayed in the first display area.

5. The method according to claim 1, wherein The method further comprises: Before displaying the first animation, in response to the first operation, determining the target area and the non-target area based on the target content, determining a boundary area between the target area and the non-target area in the first display area based on a signed distance field (SDF) corresponding to the target content, and dividing the first display area into a plurality of block areas; The displaying of the first animation in the first display area includes: When displaying the N-1th frame image of the first animation, for each pixel in the first display area, if the pixel is in the display area of the target area excluding the boundary area, the first concentration and the second concentration corresponding to the pixel are updated based on the first reaction-diffusion equation until the number of iterations based on the first reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; if the pixel is in the display area of the non-target area excluding the boundary area, the first concentration and the second concentration corresponding to the pixel are updated based on the second reaction-diffusion equation until the number of iterations based on the second reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; if the pixel is in the boundary area, the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation are processed based on the SDF corresponding to the pixel to obtain a third reaction-diffusion equation, and the first concentration and the second concentration corresponding to the pixel are updated based on the third reaction-diffusion equation until the number of iterations based on the third reaction-diffusion equation reaches the target number of iterations corresponding to the block area to which the pixel belongs; N is a positive integer; the first concentration is the concentration of the first type of pixel, and the second concentration is the concentration of the second type of pixel. determining a target color of the pixel point based on a first density and a second density corresponding to the pixel point; Obtaining an Nth frame image of the first animation based on target color rendering of each pixel in the first display area; The Nth frame image is displayed in the first display area.

6. The method according to claim 3 or 5, wherein: The processing of the parameters in the first reaction-diffusion equation and the parameters in the second reaction-diffusion equation based on the SDF corresponding to the pixel point to obtain a third reaction-diffusion equation includes: Determine a first interpolation factor based on a mapping relationship between the SDF corresponding to the pixel point in the boundary area and the first interval; the first interpolation factor is a difference between 1 and the first mapping value; 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 reaction-diffusion equation is determined based on the third generation rate and the third disappearance rate.

7. The method according to claim 4 or 5, characterized in that The method further comprises: When displaying the N-1th frame image of the first animation, determining the Laplacian operators currently corresponding to the multiple block areas, and the Laplacian operators corresponding to the multiple block areas in the h frames of image displayed and displayed last in the first animation, where h is a positive integer; Based on the Laplacian operators currently corresponding to the multiple block areas and the Laplacian operators corresponding to the multiple block areas in the h-frame image displayed and displayed last in the first animation, the target number of iterations corresponding to the multiple block areas is adjusted.

8. The method according to claim 7, wherein The adjusting target iteration numbers corresponding to the multiple block areas based on the Laplacian operators currently corresponding to the multiple block areas and the Laplacian operators corresponding to the multiple block areas in the h-frame image displayed and displayed last in the first animation includes: For each of the plurality of block areas, determining a first value and a second value corresponding to the block area; the first value being the number of pixels of the Laplacian operator included in the block area within a color gradient range; and the second value being an average value of the number of pixels of the Laplacian operator included in the block area in the h-frame image within the color gradient range; When the first value is less than the second value, reducing the target number of iterations corresponding to the block area; When the first value is equal to the second value, keeping the target number of iterations corresponding to the block area unchanged; When the first value is greater than the second value, the target number of iterations corresponding to the block area is increased.

9. The method according to any one of claims 2 to 8, wherein The determining the target color of the pixel point based on the first density and the second density corresponding to the pixel point includes: When the first concentration corresponding to the pixel point is greater than the second concentration corresponding to the pixel point, determining the target color of the pixel point to be the color of the first type of pixel point; When the first concentration corresponding to the pixel point is less than or equal to the second concentration corresponding to the pixel point, the target color of the pixel point is determined to be the color of the second type of pixel point.

10. The method according to any one of claims 2 to 9, wherein The updating of the first concentration and the second concentration corresponding to the pixel point based on the first reaction-diffusion equation includes: By formula and Updating the first concentration and the second concentration corresponding to the pixel point respectively; and updating the first concentration and the second concentration corresponding to the pixel point based on the second reaction-diffusion equation, including: By formula and respectively updating the first concentration and the second concentration corresponding to the pixel point; Wherein, A is the first concentration corresponding to the pixel before updating, B is the second concentration corresponding to the pixel before updating, A' is the first concentration corresponding to the pixel after updating, B' is the second concentration corresponding to the pixel after updating, D A1 and D A2 is the diffusion coefficient of the first type of pixel, D B1 and D B2 is the diffusion coefficient of the second type of pixel, f1 is the first generation rate, f2 is the second generation rate, k1 is the first disappearance rate, k2 is the second disappearance rate, and Δt represents the time of change.

11. The method according to any one of claims 2 to 10, wherein: The first concentration corresponding to the pixel point is the R channel value of the pixel point, and the second concentration corresponding to the pixel point is the G channel value of the pixel point.

12. The method according to any one of claims 1 to 11, wherein The method further comprises: Before displaying the first animation, in response to the first operation, the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area are set; for each pixel in the first display area, the initial value of the first concentration corresponding to the pixel is less than the initial value of the second concentration corresponding to the pixel.

13. The method according to claim 12, wherein: After setting the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area, the method further includes: In response to a second operation on a first position in the first display area, corresponding first concentrations and corresponding second concentrations are reset for one or more pixel points corresponding to the first position, and the reset corresponding first concentration is greater than the reset corresponding second concentration.

14. The method according to claim 12, wherein: After setting the initial value of the first concentration and the initial value of the second concentration corresponding to each pixel in the first display area, the method further includes: After a first time interval, for any one or more pixel points in the first display area, the corresponding first density and second density are reset, and the reset corresponding first density is greater than the reset corresponding second density.

15. The method according to claim 12, wherein The method further comprises: During display of the first animation, in response to a third operation on a second position in the first display area, the first concentration and the second concentration corresponding to one or more pixels corresponding to the second position are set to the initial value of the first concentration and the initial value of the second concentration, respectively.

16. The method according to any one of claims 1 to 15, wherein The method further comprises: During display of the first animation, in response to a fourth operation on a third position in the first display area, a target iteration number corresponding to one or more pixel points corresponding to the third position is increased.

17. The method according to any one of claims 1 to 16, wherein The target content includes 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 are coupled to the one or more processors, the memories are used to store computer program code, the computer program code includes computer instructions, and the processor calls the computer instructions to execute the method described in any one of claims 1-17.

19. A computer-readable storage medium, characterized in that Used to store computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Segmentation method based on reaction diffusion equation

    CN106056582A

  • Pressing-based animation display method and device

    CN110427131A

  • Color image edge detection method

    CN114022505A

  • Display method and device for electronic paper, electronic equipment and storage medium

    CN116382541A

  • Rendering method and device

    CN117292033A