Search

CN-119997318-B - Animation effect realization method, equipment and medium for Bluetooth lamp string

CN119997318BCN 119997318 BCN119997318 BCN 119997318BCN-119997318-B

Abstract

The invention discloses an animation effect realization method, equipment and medium of a Bluetooth lamp string, wherein the method comprises the following steps of S1, creating a graph drawing device according to preset graph data, drawing a plurality of lamp bead graphs by the graph drawing device, wherein the lamp bead graphs form a lamp string graph, S2, creating an animation frame generator according to an animation type, generating an animation frame object by the animation frame generator, S3, starting a display thread, acquiring the animation frame object by the display thread, sending the animation frame object to the graph drawing device, and respectively drawing display colors of the lamp bead graphs by the graph drawing device according to the animation frame object so as to enable a display view to display a corresponding animation effect and/or control the Bluetooth lamp string to display a corresponding light effect. The animation effect realization method has high dynamic adjustment efficiency and high flexibility.

Inventors

  • LIN FUFEI
  • SHI QIANG
  • HUANG CHUNMING

Assignees

  • 福州爱国者之星光电科技有限公司

Dates

Publication Date
20260505
Application Date
20250124

Claims (8)

  1. 1. The method for realizing the animation effect of the Bluetooth lamp string is characterized by comprising the following steps of: s1, creating a graph drawing device according to preset graph data, wherein the graph drawing device draws a plurality of lamp bead graphs, and the lamp bead graphs form a lamp string graph; S2, creating an animation frame generator according to the animation type, wherein the animation frame generator generates an animation frame object; S3, starting a display thread, wherein the display thread acquires the animation frame object and sends the animation frame object to the graphic renderer, and the graphic renderer respectively renders the display colors of the plurality of lamp bead graphics according to the animation frame object so as to enable the display view to display the corresponding animation effect and/or control the Bluetooth lamp string to display the corresponding light effect; in step S2, the animation frame generator generates an animation frame object, which comprises calculating a gradient color array of each lamp bead graph according to a preset color array and the number of lamp bead graphs, creating an animation frame object, configuring animation frame parameters for the animation frame object and placing the animation frame parameters into a storage frame queue, calculating a refresh period, refreshing the animation frame parameters of the animation frame object according to the refresh period to generate a new animation frame object, and placing the new animation frame object into the storage frame queue; In step S3, the display thread acquires the animation frame object, which comprises that the display thread acquires the animation frame object from the storage frame queue; also comprises the following steps And refreshing the animation frame object after delaying corresponding time after dormancy or all the animation frame objects are read.
  2. 2. The animation effect implementing method according to claim 1, wherein in step S1, creating a graphics renderer from preset graphics data comprises: And determining a drawing form according to the preset graphic data, wherein the drawing form comprises a graphic drawing mode and graphic drawing parameters, and creating a graphic drawing device based on the drawing form.
  3. 3. The animation effect realizing method according to claim 1, wherein in step S1, the graphic renderer renders a plurality of bead patterns, comprising the graphic renderer generating a bead array and rendering a plurality of bead patterns from the bead array.
  4. 4. The animation effect realization method according to claim 3, wherein the preset graphic data comprises a plurality of preset graphic parameters corresponding to a plurality of the lamp bead graphics one by one, and the preset graphic parameters comprise a lamp bead position and a lamp bead size; the graph drawing device generates a lamp bead array, and comprises the steps of creating the lamp bead array, calculating a scaling factor according to the size of a preset view of the preset graph and the size of a display view, traversing the preset graph parameters, and generating corresponding lamp bead objects according to the scaling factor and the preset graph parameters, wherein the lamp bead objects are stored in the lamp bead array.
  5. 5. The method of claim 1, wherein creating an animation frame generator from an animation effect in step S2 comprises determining an animation type from the animation effect and creating an animation frame generator from the animation type.
  6. 6. The method of claim 1, wherein the animation frame object comprises at least one of an animation type, an animation speed, an animation direction, and an animation pattern density, wherein the animation pattern density is used to calculate the number of bead patterns that produce an animation according to the animation frame object.
  7. 7. An electronic device comprising a processor, a memory storing a computer program configured to enable the animation effect implementation method of any of claims 1-6 when executed by the processor.
  8. 8. A computer readable electronic medium, characterized in that the electronic medium is a computer readable storage medium storing a computer program, which when executed by a processor is capable of realizing the animation effect realizing method according to any of claims 1-6.

Description

Animation effect realization method, equipment and medium for Bluetooth lamp string Technical Field The invention relates to the technical field of display control, in particular to a method, equipment and medium for realizing animation effect of a Bluetooth lamp string. Background The intelligent Bluetooth lamp string is a lighting product which can be controlled by Bluetooth technology and is widely applied to scenes such as home decoration, stage performance, festival celebration and the like. The user can control the light string according to the light string control program on the terminal device, the light string control program can display the animation effect on the terminal device, and the Bluetooth light string is controlled to display the same animation effect. However, the animation effect of the existing bluetooth light string needs to calculate the color and position of each light bead in real time according to the image and the specific motion rule, and when complex animation is processed or a plurality of different animations are displayed at the same time, a large amount of calculation resources are needed, which causes the processor of the terminal device to be overloaded, easily causes the device to generate heat and be blocked, and seriously affects the performance and stability of the device. In addition, the existing animation effect of the bluetooth light string requires complex calculation work again when adjusting images or animation effects, which makes the change of the animation effect difficult and time consuming. Disclosure of Invention The invention aims to solve the technical problems of large computing resources and large animation effect change difficulty of the existing Bluetooth lamp string animation by providing a method, equipment and medium for realizing the animation effect of the Bluetooth lamp string. In order to solve the technical problems, the invention adopts the technical scheme that the method for realizing the animation effect of the Bluetooth lamp string comprises the following steps: s1, creating a graph drawing device according to preset graph data, wherein the graph drawing device draws a plurality of lamp bead graphs, and the lamp bead graphs form a lamp string graph; S2, creating an animation frame generator according to the animation type, wherein the animation frame generator generates an animation frame object; And S3, starting a display thread, wherein the display thread acquires the animation frame object and sends the animation frame object to the graphic renderer, and the graphic renderer respectively renders the display colors of the plurality of lamp bead graphics according to the animation frame object so as to enable the display view to display the corresponding animation effect and/or control the Bluetooth lamp string to display the corresponding light effect. Further, in step S1, creating a graphics renderer according to the preset graphics data includes: And determining a drawing form according to the preset graphic data, wherein the drawing form comprises a graphic drawing mode and graphic drawing parameters, and creating a graphic drawing device based on the drawing form. Further, in step S1, the pattern renderer renders a plurality of bead patterns, including the pattern renderer generating a bead array and rendering a plurality of bead patterns from the bead array. Further, the preset graphic data comprise a plurality of preset graphic parameters corresponding to the lamp bead graphics one by one, and the preset graphic parameters comprise the lamp bead positions and the lamp bead sizes; the graph drawing device generates a lamp bead array, and comprises the steps of creating the lamp bead array, calculating a scaling factor according to the size of a preset view of the preset graph and the size of a display view, traversing the preset graph parameters, and generating corresponding lamp bead objects according to the scaling factor and the preset graph parameters, wherein the lamp bead objects are stored in the lamp bead array. Further, in step S2, creating an animation frame generator from the animation effect includes determining an animation type from the animation effect and creating an animation frame generator from the animation type. Further, in step S2, the animation frame generator generates an animation frame object, which comprises calculating a gradient color array of each lamp bead graph according to a preset color array and the number of lamp bead graphs, creating an animation frame object, configuring animation frame parameters for the animation frame object and placing the animation frame parameters into a storage frame queue, calculating a refresh period, refreshing the animation frame parameters of the animation frame object according to the refresh period to generate a new animation frame object, and placing the new animation frame object into the storage frame queue. Further, in step S3, the display thread obtaining