CN111354060B - Window animation acceleration method and device based on double-buffer technology and storage medium - Google Patents

Window animation acceleration method and device based on double-buffer technology and storage medium Download PDF

Info

Publication number
CN111354060B
CN111354060B CN202010103434.XA CN202010103434A CN111354060B CN 111354060 B CN111354060 B CN 111354060B CN 202010103434 A CN202010103434 A CN 202010103434A CN 111354060 B CN111354060 B CN 111354060B
Authority
CN
China
Prior art keywords
buffer
target image
window animation
animation
window
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010103434.XA
Other languages
Chinese (zh)
Other versions
CN111354060A (en
Inventor
李晓辉
胡胜发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Ankai Microelectronics Co ltd
Original Assignee
Guangzhou Ankai Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Ankai Microelectronics Co ltd filed Critical Guangzhou Ankai Microelectronics Co ltd
Priority to CN202010103434.XA priority Critical patent/CN111354060B/en
Publication of CN111354060A publication Critical patent/CN111354060A/en
Application granted granted Critical
Publication of CN111354060B publication Critical patent/CN111354060B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention provides a window animation acceleration method, a device and a storage medium based on a double-buffer technology, wherein the method comprises the following steps: drawing a target image in a rear buffer; before copying the target image to a final display position in a front buffer, converting each frame of the target image into N frames of images in the front buffer through a graph copying function according to a window animation effect; compared with the prior art, the embodiment of the invention only needs to draw 1 time after back buffer and forward buffer and copy N times of images, a large number of back buffer drawing processes are reduced, and the window animation can be smoothly displayed even on equipment provided with a low-end CPU. In addition, the invention can also improve the display resolution of the window animation.

Description

Window animation acceleration method and device based on double-buffer technology and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for accelerating a window animation based on a double buffering technology, and a storage medium.
Background
With the development of the age, modern GUIs add many animation effects, such as fading, scrolling, zooming, etc. of windows or pictures to increase aesthetics, cool and affinity. In the GUI, the double buffering technique is mainly used to mitigate screen flicker caused by window drawing. FIG. 1 shows a prior art double buffering technique, where the program renders graphics in a back buffer (also called off-screen buffer), and after rendering, hands the rendering area to the CPU/GPU for copying to the corresponding front buffer (i.e., screen display content). Assuming that a window animation has N frames to draw, then the back buffer needs to draw N times and the CPU/GPU copies N times forward buffer, i.e., the CPU/GPU needs to copy the back buffer draw field into the front buffer one-to-one. The double buffer technology increases the buffer overhead by about one time, and because the memory copy occupies more running time of the CPU/GPU, when the window animation is enabled, such as when the CPU/GPU performance is low, the display of the window animation can be very stuck, unpleasant, and influence the operation, and the method is counterproductive.
Disclosure of Invention
The invention aims to provide a double-buffer-based window animation acceleration method, which is improved on the basis of a double-buffer technology and realizes a window animation effect by a frame interpolation method, so that an animation window can be smoothly displayed even on equipment provided with a low-end CPU.
In order to solve the above technical problems, an embodiment of the present invention provides a method for accelerating a window animation based on a double-buffer technique, which copies an image drawn in a rear buffer into a front buffer by an animation interpolation method, including:
drawing a target image in a rear buffer;
before copying the target image to a final display position in a front buffer, converting each frame of the target image into N frames of images in the front buffer through a graph copying function according to a window animation effect; wherein N is greater than or equal to 1, and the graph copy function is an interpolation algorithm, and the graph copy function at least comprises one or more of displacement, part, transparency and scaling.
The embodiment of the invention also provides a window animation acceleration device based on the double-buffering technology, which comprises:
a drawing module for drawing the target image in the rear buffer;
the copying module is used for converting each frame of target image into N frames of images in the front buffer through the copying function of the graph according to the window animation effect before copying the target image to the final display position in the front buffer; wherein N is greater than or equal to 1, and the graph copy function is an interpolation algorithm, and the graph copy function at least comprises one or more of displacement, part, transparency and scaling.
The embodiment of the invention also provides a computer readable storage medium, which is characterized in that the computer readable storage medium comprises a stored computer program, wherein when the computer program runs, the equipment where the computer readable storage medium is located is controlled to execute the window animation acceleration method based on the double-buffering technology.
Compared with the prior art that N times of drawing in the back buffer and N times of forward buffer copying are needed, the embodiment of the invention only needs to draw 1 time in the back buffer and N times of forward buffer copying, reduces a large number of back buffer drawing processes, and enables window animation to be smoothly displayed even on equipment provided with a low-end CPU. In addition, the embodiment of the invention can also improve the display resolution of the window animation.
Drawings
FIG. 1 is a schematic diagram of a prior art double buffering technique.
Fig. 2 is a flowchart of a window animation acceleration method based on a double-buffering technique according to an embodiment of the present invention.
FIG. 3 is an animation diagram of a window animation acceleration method based on a double buffer technique according to a preferred embodiment.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 2, fig. 2 is a flowchart of a window animation acceleration method based on a double-buffer technology, where the window animation acceleration method based on the double-buffer technology copies an image drawn in a rear buffer into a front buffer by an animation interpolation method, and copies a target image drawn in the rear buffer into the front buffer by an animation interpolation method, and the method includes steps 101 and 102:
step 101, drawing a target image in a rear buffer;
102, before copying the target image to a final display position in a front buffer, converting each frame of the target image into N frames of images in the front buffer through a graph copying function according to a window animation effect; wherein N is greater than or equal to 1, and the graph copy function is an interpolation algorithm, and the graph copy function at least comprises one or more of displacement, part, transparency and scaling.
The interpolation algorithm (interpolation technique) is a prior art.
In order to better explain the technical scheme of the invention, a window animation effect is taken as an example for explanation. Referring to fig. 3, first, as in the prior art, the drawing target image is back-buffered, and the front buffer (screen) is fully white. In the embodiment of the present invention, the black block in fig. 3 represents the target image drawn in the rear buffer.
Then, the copy target image was buffered forward, and the black block was copied to the lower portion of the front buffer, partially invisible, and the transparency of the black block was 75%.
Then, the copy target image was buffered forward, and the black block was copied to the lower portion of the front buffer, and the black block was seen to have a transparency of 50%.
Then, the copy target image was buffered forward, the black block was copied to the middle lower portion of the front buffer, and the background under the black block was copied, the transparency of the black block being 25%.
Finally, the copy target image is buffered forward, and the black block and the lower background are copied to the position where the front buffer is finally displayed, and the black block is opaque. The final display position of the black block in the front buffer is the same as the position of the black block drawn in the rear buffer.
Through the above steps, fig. 3 realizes the window animation by 3-frame interpolation, in practice, more frames can be interpolated, and the smooth eye-fitting window animation is formed during high-speed display. Fig. 3 only uses displacement and transparency in copying. In practice, the display portion, the size, the shape, even the color temperature, the saturation, and the like can be changed constantly and smoothly when the animation is interpolated. Some basic graphic replication functions, a large number of GUIs are provided, such as displacement, partial, transparent, zoom, etc., and are very efficient and may even be hardware accelerated. Thus, the window animation can be easily realized through double-buffer interpolation, and the window animation has higher performance.
The embodiment of the invention performs comparison tests on a low-end CPU based on ARM9 and a resolution hardware platform of 1024 x 600, and when the window is larger before modification, only 2-5 frames can be drawn per second, the window animation can not work basically, and the blocking is rough. After the method is modified, not only is the animation mode enriched, but also the frame rate is as high as 20-30 frames per second, the effect is quite obvious, and the method looks very fine and beautiful. Furthermore, when the transparency option is enabled, the animation process has multiple points of afterimage effect because the previous frame of image cannot be completely erased, but the animation process seems to be more beautiful and cool.
Compared with the prior art that N times of drawing are needed in the back buffer, and N times of forward buffer copying are needed to draw for 1 time in the back buffer, the embodiment of the invention only needs to draw for N times in the front buffer, and reduces a large number of back buffer drawing processes, so that window animation can be smoothly displayed even on equipment provided with a low-end CPU. In addition, the embodiment of the invention can also improve the display resolution of the window animation and save the cost.
The embodiment of the invention also provides a window animation acceleration device based on the double-buffering technology, which comprises:
and the drawing module is used for drawing the target image in the rear buffer.
The copying module is used for converting each frame of target image into N frames of images in the front buffer through the copying function of the graph according to the window animation effect before copying the target image to the final display position in the front buffer; wherein N is greater than or equal to 1, and the graph copy function is an interpolation algorithm, and the graph copy function at least comprises one or more of displacement, part, transparency and scaling.
The interpolation algorithm (interpolation technique) is a prior art.
In order to better explain the technical scheme of the invention, a window animation effect is taken as an example for explanation. Referring to fig. 3, first, as in the prior art, the drawing module buffers the drawing target image at the rear, and then buffers (screens) all white. In the embodiment of the present invention, the black block in fig. 3 represents the target image drawn in the rear buffer.
Then, the copy module buffers the copy target image forward, copies the black block to the lower portion of the front buffer, and is partially invisible, and the transparency of the black block is 75%.
Then, the copy module buffers the copy target image forward, copies the black block to the lower portion of the front buffer, and can see all the black block, and the transparency of the black block is 50%.
Then, the copy module buffers the copy target image forward, copies the black block to the middle lower portion of the front buffer, and copies the background under the black block, the transparency of the black block being 25%.
Finally, the copying module buffers the copy target image forwards, copies the black block and the lower background to the position where the front buffer finally displays the black block in an opaque way. The final display position of the black block in the front buffer is the same as the position of the black block drawn in the rear buffer.
Through the above steps, fig. 3 realizes the window animation by 3-frame interpolation, in practice, more frames can be interpolated, and the smooth eye-fitting window animation is formed during high-speed display. Fig. 3 only uses displacement and transparency in copying. In practice, the display portion, the size, the shape, even the color temperature, the saturation, and the like can be changed constantly and smoothly when the animation is interpolated. Some basic graphic replication functions, a large number of GUIs are provided, such as displacement, partial, transparent, zoom, etc., and are very efficient and may even be hardware accelerated. Thus, the window animation can be easily realized through double-buffer interpolation, and the window animation has higher performance.
The embodiment of the invention performs comparison tests on a low-end CPU based on ARM9 and a resolution hardware platform of 1024 x 600, and when the window is larger before modification, only 2-5 frames can be drawn per second, the window animation can not work basically, and the blocking is rough. After the method is modified, not only is the animation mode enriched, but also the frame rate is as high as 20-30 frames per second, the effect is quite obvious, and the method looks very fine and beautiful. Furthermore, when the transparency option is enabled, the animation process has multiple points of afterimage effect because the previous frame of image cannot be completely erased, but the animation process seems to be more beautiful and cool.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (3)

1. The window animation acceleration method based on the double-buffer technology is characterized in that the target image drawn in the rear buffer is copied into the front buffer by an animation interpolation method, and the method comprises the following steps:
drawing a target image in a rear buffer;
before copying the target image to a final display position in a front buffer, converting each frame of the target image into N frames of images in the front buffer through a graph copying function according to a window animation effect; wherein N is greater than or equal to 1, and the graph copy function is an interpolation algorithm, and the graph copy function at least comprises one or more of displacement, part, transparency and scaling.
2. Window animation accelerating device based on double buffering technology, which is characterized by comprising:
a drawing module for drawing the target image in the rear buffer;
the copying module is used for converting each frame of target image into N frames of images in the front buffer through the copying function of the graph according to the window animation effect before copying the target image to the final display position in the front buffer; wherein N is greater than or equal to 1, and the graph copy function is an interpolation algorithm, and the graph copy function at least comprises one or more of displacement, part, transparency and scaling.
3. A computer readable storage medium, wherein the computer readable storage medium comprises a stored computer program, and wherein the computer program when executed controls a device in which the computer readable storage medium is located to perform the window animation acceleration method according to claim 1.
CN202010103434.XA 2020-02-19 2020-02-19 Window animation acceleration method and device based on double-buffer technology and storage medium Active CN111354060B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010103434.XA CN111354060B (en) 2020-02-19 2020-02-19 Window animation acceleration method and device based on double-buffer technology and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010103434.XA CN111354060B (en) 2020-02-19 2020-02-19 Window animation acceleration method and device based on double-buffer technology and storage medium

Publications (2)

Publication Number Publication Date
CN111354060A CN111354060A (en) 2020-06-30
CN111354060B true CN111354060B (en) 2023-07-07

Family

ID=71195730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010103434.XA Active CN111354060B (en) 2020-02-19 2020-02-19 Window animation acceleration method and device based on double-buffer technology and storage medium

Country Status (1)

Country Link
CN (1) CN111354060B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1246370A1 (en) * 2001-03-28 2002-10-02 Lucent Technologies Inc. Decoding method for block codes used for the purpose of channel coding
US6975322B2 (en) * 2002-03-12 2005-12-13 Sun Microsystems, Inc. Dynamically adjusting a number of rendering passes in a graphics system
CN102129705A (en) * 2010-01-18 2011-07-20 腾讯科技(深圳)有限公司 Animation production method and device, and animation playing method and device
CN103049883A (en) * 2013-01-29 2013-04-17 陕西汽车集团有限责任公司 Method and device for rapid plotting
CN109035131A (en) * 2017-06-12 2018-12-18 龙芯中科技术有限公司 Show method, apparatus, readable storage medium storing program for executing and the electronic equipment of image

Also Published As

Publication number Publication date
CN111354060A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
KR100834568B1 (en) Video display device and method for video display
JP4453647B2 (en) Moving image display device and moving image display method
US6151030A (en) Method of creating transparent graphics
TW564387B (en) Method and apparatus for processing video picture data for display on a display device
JP5464819B2 (en) Moving image processing apparatus and method, and program
US20050138569A1 (en) Compose rate reduction for displays
US20100207957A1 (en) Overlaying videos on a display device
JP2004240317A (en) Display method, display device and data writing circuit to be used for the device
JP2007304204A (en) Image display device, signal processing device, image processing method and computer program
US7616220B2 (en) Spatio-temporal generation of motion blur
JP2008517343A (en) Animation judder compensation
CN109118556B (en) Method, system and storage medium for realizing animation transition effect of UI (user interface)
JP5479064B2 (en) Image processing apparatus, control method therefor, and program
CN111354060B (en) Window animation acceleration method and device based on double-buffer technology and storage medium
JP2009109694A (en) Display unit
US20230162329A1 (en) High quality ui elements with frame extrapolation
US20220028360A1 (en) Method, computer program and apparatus for generating an image
JPH04174497A (en) Display controlling device
JP2008216648A (en) Video display device, video display method, and video display system
JP4923635B2 (en) Moving image display device and moving image display method
JPH06301794A (en) Three-dimensional image generating display device
US8194185B2 (en) Video picture display method to reduce the effects of blurring and double contours and device implementing this method
JP4113069B2 (en) Video processing circuit, video processing method, video display device, and video display method
JP2009093012A (en) Image signal processing apparatus, image signal generating method, image display apparatus, image signal processing program, and recording medium
CN112506601A (en) Embedded graphic device updating display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 510555 No. 107 Bowen Road, Huangpu District, Guangzhou, Guangdong

Applicant after: Guangzhou Ankai Microelectronics Co.,Ltd.

Address before: Unit 301, 302, 303, 3 / F, C1 area, 182 science Avenue, Science City, Guangzhou hi tech Industrial Development Zone, Guangzhou, Guangdong 510000

Applicant before: ANYKA (GUANGZHOU) MICROELECTRONICS TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant