Animation switching method and apparatus, electronic device, and computer readable storage medium

By displaying target images similar or the same as the next animation during video playback and cache the next animation, the problem of visual flickering when users switch animations is solved, and the switching speed and user experience are improved.

WO2025044462A1PCT designated stage expired Publication Date: 2025-03-06GREAT WALL MOTOR CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/102011
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-25
Filing Date
2024-06-27
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

During video playback, when the user switches animation, the display device needs to parse some picture images of the next animation, resulting in slow switching speed, especially when the color depth is large, it will cause the user to flicker and reduce the viewing experience.

Method used

When the switch command is received, the target image similar or the same as the next animation is displayed, and the current animation is hidden, and the next animation is cached. After the next animation cache is complete, play the next animation and hide the target image.

Benefits of technology

By caching the next animation and displaying similar target images, the slow switching speed problem caused by the cache time is avoided, visual flickering is reduced, and user viewing experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024102011_06032025_PF_FP_ABST
    Figure CN2024102011_06032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of video playback, and provides an animation switching method and apparatus, an electronic device, and a computer readable storage medium. The method comprises: when a first animation is played and a switching instruction of a second animation is received, an electronic device displaying a target picture and hiding the first animation, wherein a first difference value between the color scale of the target picture and the picture color scale of the second animation is within a preset interval; caching the second animation; and when a cache completion instruction of the second animation is received, playing the second animation and hiding the target picture. According to the present application, when a light-color picture is switched into a dark-color picture or the dark-color picture is switched into the light-color picture, the visual flickering of a user caused by a too slow picture switching speed can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Animation switching method, device, electronic device and computer-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 25, 2023, with application number 2023110840086 and application name “Animation switching method, device, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of video playback technology, and in particular to an animation switching method, device, electronic device, and computer-readable storage medium in the field of video playback technology. Background Art

[0003] Typically, when a display device is playing an animation, in order to maintain smooth playback, it will continuously parse part of the animation to be played, and while playing this part of the animation, it will parse other parts of the animation. For example, the first to third frames of the animation will be parsed first, and after the first frame is played, the second frame will be played, and so on. During the playback of the first to third frames of the animation, the other frames after the fourth frame will be parsed. For example, after the parsing of the fourth to sixth frames of the animation is completed, the fourth to sixth frames will be played in sequence, and the other frames after the seventh frame will be parsed, and so on.

[0004] When the user switches the currently playing animation to the next animation, the display device will not immediately switch from the screen image of the current animation to the screen image of the next animation, but will continue to play the screen image of the current animation and parse part of the screen image of the next animation. After the parsing of the part of the screen image of the next animation is completed, the screen image of the current animation will be switched to the first frame of the screen image of the next animation. Since the display device will first parse the part of the screen image of the next animation after receiving the switching instruction, the speed of switching to the first frame of the screen image of the next animation is slow. If the color of the screen image of the current animation is significantly different from the color of the screen image of the next animation, for example, if the screen image of the current animation is light and the screen image of the next animation is dark, it is a process of switching from a light-colored picture to a dark-colored picture, which will cause visual flickering when the user is watching the animation, reducing the user's viewing experience.

[0005] Summary of the Invention

[0006] The present application provides an animation switching method, device, electronic device and computer-readable storage medium, which can avoid the problem of user visual flickering caused by slow image switching speed when a light image switches to a dark image or a dark image switches to a light image.

[0007] In a first aspect, the present application provides an animation switching method, which includes: when playing a first animation and receiving a switching instruction for a second animation, displaying a target image and hiding the first animation; wherein a first difference between the color level of the target image and the color level of the second animation is within a preset range; caching the second animation; when the second animation caching is completed, playing the second animation and hiding the target image.

[0008] In one possible implementation, when the first animation is played and a switching instruction for the second animation is received, the target image is displayed and the first animation is hidden, including: when the first animation is played and a switching instruction for the second animation is received, determining a second difference between the picture color level of the first animation and the picture color level of the second animation; when the second difference is not within a preset range, caching the target image; displaying the target image, and hiding the first animation.

[0009] In a possible implementation, caching the target image includes: determining the first frame of the second animation as the target image; and caching the first frame of the second animation.

[0010] In a possible implementation, caching the second animation includes: pausing the first animation, clearing the first animation cached in the storage space; and caching the second animation in the storage space.

[0011] In a possible implementation, caching the second animation in the storage space includes: caching other frames of the second animation except the first frame in the storage space.

[0012] In a possible implementation, displaying the target image includes adjusting the grayscale value of the current frame of the first animation to the grayscale value of the target image.

[0013] In one possible implementation method, adjusting the grayscale value of the current screen of the first animation to the grayscale value of the target image includes: determining the pixels at the same position in the current screen and the target image as pixel pairs to obtain multiple pixel pairs; for each pixel pair in the multiple pixel pairs, if the grayscale values ​​of two pixels in the pixel pair are different, determining the pixel pair as the target pixel pair; determining the grayscale value of the pixel of the current screen in the target pixel pair as the grayscale value to be adjusted; determining the grayscale value of the pixel of the target image in the target pixel pair as the target grayscale value; and adjusting the grayscale value to be adjusted to the target grayscale value.

[0014] In a second aspect, the present application provides an animation switching device, the animation switching device comprising:

[0015] A first control module is configured to display a target image and hide the first animation when a switch instruction to a second animation is received while the first animation is playing; wherein a first difference between a color level of the target image and a color level of the second animation is within a preset range;

[0016] Animation cache module, used for caching the second animation;

[0017] The second control module is used to play the second animation and hide the target image when the second animation cache is completed.

[0018] In conjunction with the second aspect, in some possible implementations, the first control module includes:

[0019] a calculation unit, configured to determine a second difference between the color levels of the first animation and the color levels of the second animation when the first animation is played and a switching instruction for the second animation is received;

[0020] A first cache unit, configured to cache the target image when the second difference is not within a preset interval;

[0021] The display unit is used to display the target image and hide the first animation.

[0022] In one possible implementation, the first cache unit includes:

[0023] a determination subunit, configured to determine the first frame of the second animation as a target image;

[0024] The cache subunit is used to cache the first frame of the second animation.

[0025] In one possible implementation, the animation cache module includes:

[0026] a pause unit, configured to pause the playing of the first animation and clear the first animation cached in the storage space;

[0027] The second cache unit is configured to cache the second animation in the storage space.

[0028] In a possible implementation, the second cache unit is specifically configured to cache other frames of the second animation except the first frame in the storage space.

[0029] In a possible implementation, the first control module further includes:

[0030] The parameter adjustment unit is used to adjust the grayscale value of the current frame of the first animation to the grayscale value of the target image.

[0031] In one possible implementation, the parameter adjustment unit is specifically used to: determine the pixel points at the same position in the current picture and the target picture as pixel pairs to obtain multiple pixel pairs; for each pixel pair in the multiple pixel pairs, if the grayscale values ​​of the two pixels in the pixel pair are different, determine the pixel pair as the target pixel pair; determine the grayscale value of the pixel point of the current picture in the target pixel pair as the grayscale value to be adjusted; determine the grayscale value of the pixel point of the target picture in the target pixel pair as the target grayscale value; and adjust the grayscale value to be adjusted to the target grayscale value.

[0032] In a third aspect, the present application provides an electronic device comprising a memory and a processor. The memory is configured to store executable program code, and the processor is configured to call and execute the executable program code from the memory, so that the electronic device executes the animation switching method described in the first aspect or any possible implementation of the first aspect.

[0033] In a fourth aspect, the present application provides a computer program product, which includes: computer program code, which, when running on a computer, enables the computer to execute the animation switching method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0034] In a fifth aspect, the present application provides a computer-readable storage medium, which stores a computer program code. When the computer program code runs on a computer, the computer executes the animation switching method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0035] The animation switching method, device, electronic device, and computer-readable storage medium provided by the embodiments of the present application have the following technical effects:

[0036] The embodiment of the present application adopts a technical solution that, when the first animation is played and a switching instruction for the second animation is received, a target picture similar to or identical to any frame of the second animation is displayed, and the first animation is hidden. The first animation screen is not displayed during the display of the target picture, and the second animation is cached. When the second animation caching is completed, the second animation is played and the target picture is hidden. That is, during the playback of the second animation, the target picture is no longer displayed, and only the screen of the second animation is displayed. This solution realizes that when the first animation is switched to the second animation, the screen of the first animation is switched to a target picture similar to or identical to the screen of the second animation, and the first animation is hidden. This is equivalent to switching the screen of the first animation to the screen of the second animation. What the user actually sees is that the first animation is switched to the second animation. During the display of the target image, the second animation is cached, and after the second animation caching is completed, the second animation is played, and the target image is hidden at the same time, so that the user can see the real second animation. This solves the problem of a large difference in color depth between the first animation and the second animation. Because it takes time to cache the second animation, the second animation screen cannot be switched immediately, resulting in a slow speed in switching from the first animation screen to the second animation screen, which causes visual flickering when the user watches the animation. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] FIG1 shows a schematic flow chart of an animation switching method provided in an embodiment of the present application;

[0038] FIG2 shows an exemplary schematic diagram of a first animation switching to a second animation;

[0039] FIG3 shows another exemplary schematic diagram of switching from a first animation to a second animation;

[0040] FIG4 shows an exemplary schematic diagram of displaying a target image;

[0041] FIG5 shows a schematic structural diagram of an animation switching device provided in an embodiment of the present application;

[0042] FIG6 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The following is an embodiment of an animation switching method provided in an embodiment of the present application.

[0044] FIG1 shows a schematic flow chart of an animation switching method provided in an embodiment of the present application. For example, as shown in FIG1 , the animation switching method provided in an embodiment of the present application is applied to electronic devices, including in-vehicle terminals, mobile phones, notebooks, and other devices with image display functions. The animation switching method includes the following schemes:

[0045] S102: When the electronic device plays the first animation and receives a switching instruction to the second animation, the electronic device displays the target image and hides the first animation;

[0046] S104: The electronic device caches the second animation;

[0047] S106: When the second animation buffering is completed, the electronic device plays the second animation and hides the target image.

[0048] In an exemplary embodiment, when representing the depth of the color of an image, a color scale can be used for representation. The color scale refers to the brightness of a color in grayscale. A higher color scale corresponds to a brighter color, while a lower color scale corresponds to a darker color. The color scale can be achieved by reducing the saturation of the color. The higher the saturation is adjusted, the darker the depth of the image color, that is, the more vivid the color. The lower the saturation is adjusted, the lighter the depth of the image color, that is, the closer the color is to black and white. The first difference between the color scale of the target image and the color scale of the second animation is within a preset range, indicating that the color depth of the target image is similar or identical to the color depth of each frame of the second animation. It can also be understood that the target image is similar or identical to any one of the frames of the second animation.

[0049] The first animation and the second animation are two different animations. During the process of playing the first animation on the display interface of the electronic device, the user may switch animations according to his or her own viewing needs, for example, switching the first animation to the second animation to watch the second animation. Taking into account the processing process of animation playback and the fact that the color of the first animation picture is relatively light and the color of the second animation picture is relatively dark (referring to the fact that the picture of the first animation is a light-colored picture and the picture of the second animation is a dark-colored picture), when switching the first animation to the second animation, it is necessary to first complete the caching of some frames of the picture in the second animation, and then play the second animation from the first frame of the second animation. This will result in a longer time required from the start of the second animation to the start of the second animation, resulting in a slower speed of switching from the picture of the first animation to the picture of the second animation. Because the color depth of the pictures of the first animation and the second animation is quite different, the user can clearly see that the picture displayed on the display interface has changed from a light-colored picture to a dark-colored picture, which will cause the user to experience visual flickering when watching the animation. Therefore, in the embodiment of the present application, when the first animation is played on the display interface, if a switching instruction for the second animation is received, that is, the user's operation instruction to switch the first animation to the second animation, a target picture similar to or identical to the picture of the second animation is displayed on the display interface of the electronic device. While displaying the target picture, the first animation is hidden, that is, the first animation is not displayed, and the user sees only the target picture and cannot see the picture of the first animation, and the second animation is cached. After the caching of the second animation is completed, the second animation is played, that is, the target picture is switched to the first frame of the second animation, and the second animation is played from the first frame of the second animation, and the target picture is hidden, that is, the target picture is no longer displayed, thereby achieving the playback of the second animation.

[0050] Figure 2 illustrates an exemplary schematic diagram of switching from a first animation to a second animation. For example, as shown in Figure 2 , the first animation is a sunrise animation, and the second animation is a sunset animation. X represents the display interface, A1 represents the sunrise animation, A2 represents the sunset animation, and B represents the target image. The sunrise animation has a lighter color, while the sunset animation has a darker color. When the display interface is playing the sunrise animation, if a user switches the sunrise animation to the sunset animation, the electronic device, upon receiving the sunset animation switch instruction, displays a target image similar or identical to the sunset animation on the display interface. In other words, the currently displayed sunrise animation is switched to the target image. The target image is then displayed on the display interface. While the target image is displayed on the display interface, the sunrise animation is hidden, meaning that the sunrise animation is not displayed, so that the user only sees the target image and does not see the sunrise animation. The sunset animation is also cached. After the sunset animation is cached, the target image is switched to the first frame of the sunset animation, and the target image is hidden, thereby enabling playback of the sunset animation. The process of switching from the sunset animation to the sunrise animation is similar to the process described above and will not be further described here.

[0051] The embodiment of the present application adopts a technical solution in which an electronic device displays a target picture similar to or identical to any frame of the second animation when playing a first animation and receiving a switching instruction for a second animation, hides the first animation, does not display the picture of the first animation during the display of the target picture, and caches the second animation. When the caching of the second animation is completed, the second animation is played and the target picture is hidden. That is, during the playback of the second animation, the target picture is no longer displayed and only the picture of the second animation is displayed. This solution realizes that when the first animation is switched to the second animation, the picture of the first animation is switched to a target picture similar to or identical to the picture of the second animation, and the first animation is hidden. This is equivalent to switching the picture of the first animation to the picture of the second animation. What the user actually sees is that the first animation is switched to the second animation. During the display of the target image, the second animation is cached, and after the second animation caching is completed, the second animation is played, and the target image is hidden at the same time, so that the user can see the real second animation. This solves the problem of a large difference in color depth between the first animation and the second animation. Because it takes time to cache the second animation, the second animation screen cannot be switched immediately, resulting in a slow speed in switching from the first animation screen to the second animation screen, which causes visual flickering when the user watches the animation.

[0052] The following describes the specific implementation of each step in the embodiment shown in FIG1 :

[0053] In a possible implementation, when the electronic device plays the first animation and receives a switching instruction to the second animation, the target image is displayed and the first animation is hidden, including the following scheme:

[0054] When the electronic device plays the first animation and receives a switching instruction for the second animation, the electronic device determines a second difference between the color levels of the first animation and the color levels of the second animation;

[0055] When the second difference is not within the preset interval, caching the target image;

[0056] Show the target image and hide the first animation.

[0057] When the electronic device plays a first animation and receives a switch instruction for a second animation, it calculates a second difference between the color levels of the first animation and the second animation. If the second difference is within a preset range, it indicates that the color depth of the first animation and the second animation are similar or identical, ensuring that from the start of caching the second animation to the completion of caching and the playback of the second animation, the user will not experience visual flickering when viewing the second animation. Therefore, it is not necessary to perform the operation of displaying the target image and hiding the first animation when switching to the second animation. If the second difference is not within the preset range, it indicates that the color depth of the first animation and the second animation is significantly different, the picture of the first animation is a dark picture and the picture of the second animation is a light picture, or the picture of the first animation is a dark picture and the picture of the second animation is a light picture. From the start of caching the second animation to the completion of caching and the playback of the second animation, the user will experience visual flickering when viewing the second animation. Therefore, it is necessary to cache the target image when switching to the second animation, then display the target image and hide the first animation.

[0058] The time from caching to displaying a single image is very short and cannot be perceived by the user's eyes. Therefore, when the switching instruction of the second animation is received, the target image is cached and displayed, thereby avoiding the problem of visual flickering when the user watches the animation when switching from the first animation including light-colored images to the second animation including dark-colored images, or from the first animation including dark-colored images to the second animation including light-colored images.

[0059] In a possible implementation, the electronic device caches the target image in the following manner:

[0060] The electronic device determines the first frame of the second animation as the target image;

[0061] Cache the first frame of the second animation.

[0062] FIG3 shows another exemplary schematic diagram of the switching from the first animation to the second animation. As shown in FIG3 , under the premise that the time from caching to displaying a single picture is very short, in order to ensure the similarity between the target picture and the second animation, the electronic device determines the first frame of the second animation as the target picture. When the electronic device plays the first animation and receives a switching instruction for the second animation, it first caches the first frame of the second animation, thereby achieving the caching of the target picture, and then displays the target picture, that is, achieving the display of the first frame of the second animation. By determining the first frame of the second animation as the target picture, it is ensured that the target picture is the same as the picture of the second animation. There is no need to prepare and store other pictures that are the same or similar to the picture of the second animation in advance, nor is there any need to specifically search for other pictures that are the same or similar to the picture of the second animation from the animation storage server. This not only reduces the preliminary preparation work for the animation and saves the storage space of the animation storage server, but also simplifies the data processing process before the animation is played.

[0063] In a possible implementation, the electronic device caches the second animation in the following manner:

[0064] The electronic device pauses playing the first animation and clears the first animation cached in the storage space;

[0065] Cache the second animation in storage.

[0066] The storage space is a space for electronic devices to temporarily store data. The size of the storage space is limited, and the first animation is cached in the storage space. When the electronic device displays the target image and hides the first animation, the user sees the target image and cannot see the first animation. However, the first animation will always be in a hidden playback state. It can be seen that hiding the first animation is meaningless and will take up storage space. Therefore, after hiding the first animation, the first animation is paused and the cached first animation in the storage space is cleared, leaving enough space for caching the second animation, and then the second animation is cached in the storage space.

[0067] In a possible implementation, the electronic device caches the second animation in a storage space, including the following scheme:

[0068] The electronic device caches other frames of the second animation except the first frame in the storage space.

[0069] As shown in Figure 3, since the target image is the first frame of the second animation, when the electronic device displays the target image, the first frame of the second animation has been cached in the storage space and there is no need for secondary caching. In this case, the other frames of the second animation except the first frame are cached in the storage space, that is, the 2nd to nth frames of the second animation are stored, where n is a positive integer greater than 2. When the electronic device plays the second animation, it starts playing from the 2nd frame, followed by the 3rd frame, the 4th frame, ..., the nth frame, to achieve the playback of the second animation. By caching the other frames of the second animation except the first frame in the storage space, the caching of the second animation can be completed quickly, which is beneficial to shortening the time to start playing the second animation and making the display effect of switching from the first animation to the second animation smoother.

[0070] In one possible implementation, the electronic device displays the target image in the following manner:

[0071] The electronic device adjusts the grayscale value of the current frame of the first animation to the grayscale value of the target image.

[0072] The size of each frame in the first and second animations is the same as the size of the target image. The electronic device obtains the grayscale value of each pixel in the target image and adjusts the grayscale value of each pixel in the current frame of the first animation to the grayscale value of the corresponding pixel in the target image based on the one-to-one correspondence between each pixel in the target image and each pixel in the current frame of the first animation, thereby facilitating rapid display of the target image. As shown in Figure 4, Figure 4 shows an exemplary schematic diagram of displaying the target image, where F represents the current frame of the first animation, SFmn (m=1,2,3,4, n=1,2,3,4) in F represents the grayscale value of each pixel in F, B represents the target image, and SBmn (m=1,2,3,4, n=1,2,3,4) in B represents the grayscale value of each pixel in B. When displaying the target image, SF11 is adjusted to SB11, SF12 is adjusted to SB12, SF13 is adjusted to SB13, SF14 is adjusted to SB14, SF21 is adjusted to SB21, and so on, and SF44 is adjusted to SB44, so as to achieve fast display of the target image.

[0073] In a possible implementation, the electronic device adjusts the grayscale value of the current frame of the first animation to the grayscale value of the target image in the following manner:

[0074] The electronic device determines pixels at the same position in the current image and the target image as pixel pairs, thereby obtaining a plurality of pixel pairs;

[0075] For each pixel pair in the plurality of pixel pairs, if the grayscale values ​​of two pixels in the pixel pair are different, the pixel pair is determined as a target pixel pair;

[0076] The grayscale value of the pixel of the current image in the target pixel pair is determined as the grayscale value to be adjusted;

[0077] The grayscale value of the pixel of the target image aligned with the target pixel is determined as the target grayscale value;

[0078] Adjust the grayscale value to be adjusted to the target grayscale value.

[0079] As shown in Figure 4, the pixel points corresponding to SF11 and SB11 are pixel points at the same position, the pixel points corresponding to SF12 and SB12 are pixel points at the same position, and so on. The pixel points corresponding to SF44 and SB44 are pixel points at the same position. Then, the pixel points corresponding to SF11 and SB11 are a pixel pair, the pixel points corresponding to SF12 and SB12 are a pixel pair, and so on. The pixel points corresponding to SF44 and SB44 are a pixel pair.

[0080] For each pixel pair, the electronic device determines whether the grayscale values ​​of the two pixels in the pixel pair are the same. If they are, the grayscale values ​​of the pixels in F in the pixel pair do not need to be adjusted. If they are not, the pixel pair is determined to be a target pixel pair, and the grayscale values ​​of the pixels in F in the target pixel pair need to be adjusted. The grayscale values ​​of the pixels in B in the target pixel pair are the target grayscale values, and the grayscale values ​​of the pixels in F in the target pixel pair are then adjusted to the target grayscale values. For example, the pixels corresponding to SF34 and SB34 each constitute a target pixel pair, and the pixels corresponding to SF44 and SB44 each constitute a target pixel pair. In this case, only SF34 in F is adjusted to SB34, and SF44 is adjusted to SB44. The grayscale values ​​of the other pixels in F are not adjusted, thereby achieving the display of the target image. Based on the one-to-one correspondence between the pixels in F and B, the target pixel pairs in F and B are determined, the grayscale values ​​of the pixels that need to be adjusted in F are obtained, and then the grayscale values ​​of the pixels that need to be adjusted in F are adjusted to the grayscale values ​​of the corresponding pixels in B. There is no need to adjust the grayscale values ​​of all the pixels in F, which is conducive to completing the display of the target image in a short time. It not only improves the display speed of the target image, but also improves the smoothness of switching the current screen of the first animation to the target image.

[0081] In addition, the method for displaying the next frame of the second animation can be the same as the method for displaying the target image described above. When caching the 2nd to nth frames of the second animation, for two adjacent frames, only the target pixel pairs are cached, and the positions of the pixels corresponding to each grayscale value in the target pixel pairs are marked. There is no need to store the grayscale values ​​of all pixels in each frame, which is beneficial to saving storage space, shortening the time for caching the second animation, and facilitating the fast playback of the second animation. When switching from the current frame to the next frame, the grayscale values ​​of the pixels in the target pixel pairs in the current frame are adjusted to the grayscale values ​​of the corresponding pixels in the next frame according to the positions of the pixels, which is beneficial to achieving the fast display of the next frame.

[0082] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0083] FIG5 shows a schematic diagram of the structure of an animation switching device provided in an embodiment of the present application. Exemplarily, as shown in FIG5 , the animation switching device 500 includes:

[0084] The first control module 510 is configured to display a target image and hide the first animation when a switch instruction to a second animation is received while the first animation is playing; wherein a first difference between the color level of the target image and the color level of the second animation is within a preset range;

[0085] Animation cache module 520, used for caching the second animation;

[0086] The second control module 530 is configured to play the second animation and hide the target image when the second animation cache is completed.

[0087] In one possible implementation, the first control module 510 includes:

[0088] a calculation unit, configured to determine a second difference between the color levels of the first animation and the color levels of the second animation when the first animation is played and a switching instruction for the second animation is received;

[0089] A first cache unit, configured to cache the target image when the second difference is not within a preset interval;

[0090] The display unit is used to display the target image and hide the first animation.

[0091] In one possible implementation, the first cache unit includes:

[0092] a determination subunit, configured to determine the first frame of the second animation as a target image;

[0093] The cache subunit is used to cache the first frame of the second animation.

[0094] In one possible implementation, the animation cache module 520 includes:

[0095] a pause unit, configured to pause the playing of the first animation and clear the first animation cached in the storage space;

[0096] The second cache unit is configured to cache the second animation in the storage space.

[0097] In a possible implementation, the second cache unit is specifically configured to cache other frames of the second animation except the first frame in the storage space.

[0098] In a possible implementation, the first control module 510 further includes:

[0099] The parameter adjustment unit is used to adjust the grayscale value of the current frame of the first animation to the grayscale value of the target image.

[0100] In one possible implementation, the parameter adjustment unit is specifically used to: determine the pixel points at the same position in the current picture and the target picture as pixel pairs to obtain multiple pixel pairs; for each pixel pair in the multiple pixel pairs, if the grayscale values ​​of the two pixels in the pixel pair are different, determine the pixel pair as the target pixel pair; determine the grayscale value of the pixel point of the current picture in the target pixel pair as the grayscale value to be adjusted; determine the grayscale value of the pixel point of the target picture in the target pixel pair as the target grayscale value; and adjust the grayscale value to be adjusted to the target grayscale value.

[0101] It should be noted that the animation switching device provided in the above embodiment only uses the division of the above functional modules as an example when executing the animation switching method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the animation switching device provided in the above embodiment and the animation switching method embodiment belong to the same concept. Therefore, for details not disclosed in the embodiment of the device of this application, please refer to the embodiment of the animation switching method of this application, which will not be repeated here.

[0102] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0103] FIG6 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.

[0104] Exemplarily, as shown in FIG6 , the electronic device 600 includes: a memory 601 and a processor 602 , wherein the memory 601 stores an executable program code 6011 , and the processor 602 is configured to call and execute the executable program code 6011 to perform an animation switching method.

[0105] In this embodiment, the electronic device can be divided into functional modules according to the above-described method example. For example, each functional module can be mapped to a specific function, or two or more functions can be integrated into a single processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and represents only a logical functional division. In actual implementation, other division methods may be used.

[0106] In the case of dividing the functional modules into corresponding functional modules, the electronic device may include: a first control module, an animation buffer module, a second control module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0107] The electronic device provided in this embodiment is used to execute the above animation switching method, and thus can achieve the same effect as the above implementation method.

[0108] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the operation of the electronic device, and the storage module may be used to support the electronic device in executing mutual program codes and data.

[0109] The processing module may be a processor or controller that implements or executes various exemplary logic blocks, modules, and circuits disclosed herein. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processing (DSP) and a microprocessor, and the storage module may be a memory.

[0110] This embodiment further provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement an animation switching method in the above-mentioned embodiment.

[0111] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement an animation switching method in the above-mentioned embodiment.

[0112] In addition, the electronic device provided in the embodiments of the present application can specifically be a chip, component or module, and the electronic device may include a connected processor and memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor can call and execute instructions to enable the chip to execute an animation switching method in the above embodiment.

[0113] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding animation switching method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding animation switching method provided above, and will not be repeated here.

[0114] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0115] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0116] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. An animation switching method, wherein: The animation switching method comprises: When a first animation is played and a switching instruction for a second animation is received, a target image is displayed and the first animation is hidden; wherein a first difference between the color level of the target image and the color level of the second animation is within a preset range; caching the second animation; When the second animation cache is completed, the second animation is played and the target image is hidden.

2. The animation switching method according to claim 1, wherein: The step of displaying the target image and hiding the first animation when the first animation is played and a switching instruction to the second animation is received comprises: When the first animation is played and a switching instruction for the second animation is received, determining a second difference between the picture color gradation of the first animation and the picture color gradation of the second animation; When the second difference is not within the preset interval, caching the target image; The target image is displayed, and the first animation is hidden.

3. The animation switching method according to claim 2, wherein: The caching of the target image comprises: Determine the first frame of the second animation as the target image; The first frame of the second animation is cached.

4. The animation switching method according to claim 3, wherein: The caching the second animation comprises: Pause the playing of the first animation, and clear the first animation cached in the storage space; The second animation is cached in the storage space.

5. The animation switching method according to claim 4, wherein: The caching the second animation in the storage space comprises: The other frames of the second animation except the first frame are cached in the storage space.

6. The animation switching method according to claim 1, wherein: The displaying of the target image comprises: The grayscale value of the current picture of the first animation is adjusted to the grayscale value of the target picture.

7. The animation switching method according to claim 6, wherein: The step of adjusting the grayscale value of the current picture of the first animation to the grayscale value of the target picture includes: Determine pixels at the same position in the current picture and the target picture as pixel pairs, and obtain a plurality of pixel pairs; For each of the plurality of pixel pairs, if the grayscale values ​​of two pixels in the pixel pair are different, determine the pixel pair as a target pixel pair; Determining the grayscale value of the pixel point of the current picture in the target pixel point pair as the grayscale value to be adjusted; Determine the grayscale value of the pixel point of the target image in the target pixel point pair as the target grayscale value; The grayscale value to be adjusted is adjusted to the target grayscale value.

8. An animation switching device, wherein: The animation switching device comprises: A first control module, configured to display a target image and hide the first animation when a switching instruction to a second animation is received while playing the first animation; wherein a first difference between the color level of the target image and the color level of the second animation is within a preset range; An animation cache module, used for caching the second animation; A second control module is configured to play the second animation when the second animation cache is completed. And hide the target image.

9. An electronic device, wherein: The electronic device comprises: A memory for storing executable program codes; A processor is used to call and run the executable program code from the memory, so that the electronic device executes the animation switching method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the animation switching method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Smooth transitions between animations

    CN101223555A

  • Interface switching animation setting method and apparatus

    CN106873863A

  • Interface display method, interface display device and electronic equipment

    CN113282212A

  • Animation playing method and device, electronic equipment and storage medium

    CN113658300A

  • Animation switching method and device, electronic equipment and computer readable storage medium

    CN117201857A