Image processing method and device, terminal and storage medium

文档序号:987768 发布日期:2020-11-06 浏览:8次 中文

阅读说明:本技术 图像处理的方法及装置、终端和存储介质 (Image processing method and device, terminal and storage medium ) 是由 张平 宗宇 齐奉飞 金磊 于 2020-07-29 设计创作,主要内容包括:本公开提供图像处理的方法及装置、终端和存储介质。图像处理的方法包括:获取可缩放矢量图形源文件;将所述可缩放矢量图形源文件处理成静态抽象语法树;其中,所述静态抽象语法树包括若干节点;遍历所述若干节点,得到每个所述若干节点对应的属性;获取属性列表,根据所述属性列表将所述属性处理为动态属性,以使所述静态抽象语法树变为动态抽象语法树;及将所述动态抽象语法树生成以所述动态属性为参数的函数文件。本公开的图像处理方法能够在只加载一个文件的情况下切换呈现多种图像效果。(The present disclosure provides a method and apparatus for image processing, a terminal, and a storage medium. The image processing method comprises the following steps: obtaining a scalable vector graphics source file; processing the scalable vector graphics source file into a static abstract syntax tree; wherein the static abstract syntax tree comprises a plurality of nodes; traversing the plurality of nodes to obtain attributes corresponding to each of the plurality of nodes; acquiring an attribute list, and processing the attribute into a dynamic attribute according to the attribute list so as to change the static abstract syntax tree into a dynamic abstract syntax tree; and generating the dynamic abstract syntax tree into a function file with the dynamic attribute as a parameter. The image processing method disclosed by the invention can be used for switching and presenting multiple image effects under the condition of only loading one file.)

1. A method of image processing, comprising:

obtaining a scalable vector graphics source file;

processing the scalable vector graphics source file into a static abstract syntax tree; wherein the static abstract syntax tree comprises a plurality of nodes;

traversing the plurality of nodes to obtain attributes corresponding to each of the plurality of nodes;

acquiring an attribute list, and processing the attribute into a dynamic attribute according to the attribute list so as to change the static abstract syntax tree into a dynamic abstract syntax tree; and

and generating a function file with the dynamic attribute as a parameter by using the dynamic abstract syntax tree.

2. The method of claim 1, wherein the step of processing the scalable vector graphics source file into a static abstract syntax tree comprises:

loading a scalable vector graphics source file in an extensible markup language form into corresponding data in a JavaScript object notation format; and

and filtering the data to generate the static abstract syntax tree.

3. The method of claim 1, wherein the attributes comprise a stroke attribute, a color attribute, and a position attribute, and wherein the list of attributes comprises a bounding list, a color list, and a position list.

4. The method of claim 3, wherein the bounding box list includes bounding box values corresponding to the stroke attribute; the color list comprises a number of color values corresponding to the color attribute; the location list includes a number of location values corresponding to the location attribute.

5. The method of claim 3, wherein the step of processing the attribute into a dynamic attribute according to the attribute list comprises:

acquiring color values in the color list; and

matching the color values with the color attributes, respectively; if one of the color values is the same as one of the color attributes, then the color attribute is processed as the dynamic attribute.

6. The method of claim 1, wherein the step of processing the attribute as a dynamic attribute according to the attribute list further comprises:

entering one of the plurality of nodes;

sequentially processing the attribute corresponding to the node into a dynamic attribute according to the attribute list;

exiting the dynamic property in reverse order; and

and closing the one node and entering the next node of the one node.

7. The method of claim 1, wherein the step of generating the dynamic abstract syntax tree as a function file further comprises:

and generating the dynamic abstract syntax tree into a corresponding function file according to different parameters through a generator.

8. An apparatus for image processing, comprising:

an obtaining module for obtaining a scalable vector graphics source file and an attribute list;

a processing module for processing the scalable vector graphics source file into a static abstract syntax tree and processing the attributes into dynamic attributes according to the attribute list, so that the static abstract syntax tree becomes a dynamic abstract syntax tree;

the traversing module is used for traversing the nodes; and

and the generating module is used for generating the dynamic abstract syntax tree into a function file with the dynamic attribute as a parameter.

9. A terminal, comprising:

at least one memory and at least one processor;

wherein the at least one memory is configured to store program code and the at least one processor is configured to invoke the program code stored in the at least one memory to perform the method of any of claims 1 to 7.

10. A storage medium for storing program code for performing the method of any one of claims 1 to 7.

Technical Field

The present disclosure relates to the field of computer technologies, and in particular, to an image method and apparatus, a terminal, and a storage medium.

Background

At present, the processing schemes of icons or pictures of scalable vector graphics files are only single-color switching, the logic of switching is covered by the attributes of cascading style sheets, and the same icon or picture can only be subjected to one color conversion. In addition, for different subjects of the same icon or picture, the existing scheme is realized by enumerating different scalable vector graphics files, needs a large amount of data and occupies a large amount of space.

Disclosure of Invention

To solve the existing problems, the present disclosure provides an image processing method and apparatus, a terminal, and a storage medium.

The present disclosure adopts the following technical solutions.

In some embodiments, the present disclosure provides a method of image processing, comprising:

obtaining a scalable vector graphics source file;

processing the scalable vector graphics source file into a static abstract syntax tree; wherein the static abstract syntax tree comprises a plurality of nodes;

traversing the plurality of nodes to obtain attributes corresponding to each of the plurality of nodes;

acquiring an attribute list, and processing the attribute into a dynamic attribute according to the attribute list so as to change the static abstract syntax tree into a dynamic abstract syntax tree; and

and generating a function file with the dynamic attribute as a parameter by using the dynamic abstract syntax tree.

In some embodiments, the present disclosure provides an apparatus for image processing, comprising:

an obtaining module for obtaining a scalable vector graphics source file and an attribute list;

a processing module for processing the scalable vector graphics source file into a static abstract syntax tree and processing the attributes into dynamic attributes according to the attribute list, so that the static abstract syntax tree becomes a dynamic abstract syntax tree;

the traversing module is used for traversing the nodes; and

and the generating module is used for generating the dynamic abstract syntax tree into a function file with the dynamic attribute as a parameter.

In some embodiments, the present disclosure provides a terminal comprising: at least one memory and at least one processor;

wherein the at least one memory is used for storing program codes, and the at least one processor is used for calling the program codes stored in the at least one memory to execute the method.

In some embodiments, the present disclosure provides a storage medium for storing program code for performing the above-described method.

The image processing method provided by the disclosure can change the image attribute through the abstract syntax tree, a dynamic configuration mechanism corresponding to different settings of the position information of the attribute, and different theme styles are transformed through a single file.

Drawings

The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.

Fig. 1 is a flowchart of an image processing method of an embodiment of the present disclosure.

Fig. 2 is a schematic diagram of color transformation of an icon/image of an embodiment of the present disclosure.

Fig. 3 is a schematic diagram of border transformation of an icon/image according to an embodiment of the disclosure.

Fig. 4 is an end point transformation schematic of an icon/image of an embodiment of the disclosure.

Fig. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure.

Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.

Detailed Description

Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.

It should be understood that various steps recited in method embodiments of the present disclosure may be performed in parallel and/or in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.

The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.

It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.

It is noted that references to "a" or "an" in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.

The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.

The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

As shown in fig. 1, fig. 1 is a flowchart of an image processing method according to an embodiment of the present disclosure, including the following steps.

S100, obtaining a scalable vector graphics source file.

Specifically, scalable vector graphics is an extensible markup language-based graphics format for describing two-dimensional vector graphics, which is an open standard. Scalable vector graphics strictly follow the syntax of the extensible markup language and use a descriptive language in text format to describe the image content, and is therefore a vector graphics format independent of image resolution. In embodiments of the present disclosure, scalable vector graphics source files are available from an open source library. It is to be appreciated that the source of scalable vector graphics source files of embodiments of the present disclosure may not be limited to the open source library described above.

S200, processing the scalable vector graphics source file into a static abstract syntax tree; wherein the static abstract syntax tree comprises a number of nodes.

Specifically, the scalable vector graphics source file in the form of the extensible markup language can be loaded into the corresponding data in the simplified notation format of the JavaScript object; and filtering the data to generate the static abstract syntax tree. The JavaScript object notation is a lightweight data exchange format, and adopts a text format completely independent of a programming language to store and represent data. In computer science, an abstract syntax tree is an abstract representation of the syntax structure of a source code. It represents the syntactic structure of the programming language in the form of a tree, each node on the tree representing a structure in the source code. The syntax is said to be "abstract" in that the syntax does not represent every detail that appears in the true syntax. A tree structure is a common form of information presentation that can visually display a hierarchical structure of a set of information. During the translation and compilation of source code, an abstract syntax tree is typically created by a parser. The parser, which is typically presented as a component of a compiler or interpreter, functions to perform syntax checking and to build a data structure consisting of the input words.

S300, traversing the plurality of nodes to obtain the attribute corresponding to each node.

Wherein the attributes may include a stroke attribute, a color attribute, and a location attribute. Specifically, in the embodiment of the present disclosure, as shown in fig. 2, fig. 2 is a schematic diagram of color transformation of an icon/image according to the embodiment of the present disclosure. In fig. 2, the image/icon shown may be divided into three parts: background layer, tile 1 and tile 2 located above the background layer. Wherein, the tile 1 may include a location attribute 1, a color attribute 1, and a border attribute 1; tile 2 may include location attribute 2, color attribute 2, and bounding box attribute 2; the background layer may include a color attribute of 3 and a border attribute of 3. Specifically, in this embodiment of the present disclosure, the location attribute may be, for example, a display parameter corresponding to the tile on the background layer, which may include coordinate information and size information of the tile, and specifically may include an X coordinate of a first pixel in an upper left corner of the tile on the background layer, a Y coordinate of a first pixel in an upper left corner of the tile on the background layer, a length and a width of the tile, and the like. Therefore, the image block can be positioned according to the coordinate information and the size determined by the four display parameters on the background image layer. The tile may be represented by display start coordinates and length and width, setting a defined area of the tile. Although the tiles shown in fig. 2 are regular shapes, any image, icon or tile of the present embodiment may be a regular shape such as a rectangle, a diamond, or the like, or may include an irregular shape such as one identified by a boundary. In addition, the number of the blocks in the embodiments of the present disclosure is not limited, and any situation with more or less than two blocks as shown in fig. 2 is also included in the scope of the present disclosure.

S400, acquiring an attribute list, and processing the attribute into a dynamic attribute according to the attribute list so as to change the static abstract syntax tree into a dynamic abstract syntax tree.

The attribute list may include a frame list, a color list, and a position list. The frame list comprises a plurality of frame values corresponding to the stroke attributes; the color list comprises a number of color values corresponding to the color attribute; the location list includes a number of location values corresponding to the location attribute. Specifically, the frame value may include, for example, a numerical value of a different line width and a numerical value of a different end point; the color values may, for example, comprise different chrominance values and luminance values; the endpoint values may include, for example, different types of endpoint values such as rounded corners, square corners, and the like. The specific values in the attribute list may be used as parameters for presenting the corresponding dynamic effect. For example, embodiments of the present disclosure may obtain color values in the color list; and matching the color values with the color attributes, respectively; if one of the color values is the same as one of the color attributes, then the color attribute is processed as the dynamic attribute. In addition, the processing sequence in the embodiment of the present disclosure may be to enter one node of the plurality of nodes; sequentially processing the attribute corresponding to the node into a dynamic attribute according to the attribute list; exiting the dynamic property in reverse order; and closing the one node and entering a next node of the one node. The next node loops through the above process until all nodes are traversed.

And S500, generating a function file with the dynamic attribute as a parameter by using the dynamic abstract syntax tree.

Specifically, the embodiment of the present disclosure may generate the dynamic abstract syntax tree as a corresponding function file according to different parameters through a generator. More specifically, the location attributes may be used to locate different tiles; the attribute values corresponding to the color attribute and the border attribute with different labels can be set to be the same, different or partially the same. Referring to fig. 3, fig. 3 is a schematic diagram illustrating a frame transformation of an icon/image according to an embodiment of the disclosure. In fig. 3, the effect of different color combinations can be obtained according to the transformation parameters. For example, tile 1 may correspond to color 1, tile 2 may correspond to color 2, and the background layer may correspond to color 3. Wherein color 1, color 2, and color 3 may be the same, different, or partially the same. For another example, the border of tile 1 may be line width 1 end 1, tile 2 may be line width 2 end 2, and the background layer may be line width 3 end 3. Although fig. 3 shows that line widths of the pattern block 1, the pattern block 2, and the background pattern layer are the same, this is only one example, and in other examples, the line width 1, the line width 2, and the line width 3 may be the same or different. Embodiment of end point section referring to fig. 4, fig. 4 is a schematic diagram of end point transformation of icons/images according to an embodiment of the present disclosure. Similarly, although the end portions shown in fig. 4 are rounded, the different end properties may be the same, different, or partially the same. In particular, if there are coincident end points, the end point values of the segment 1 shown in fig. 4 and the upper right corner of the background layer are preferably consistent, so that the overlapping effect can be obtained. As described above, although fig. 3 and fig. 4 take two tiles on the background layer as an example, in other embodiments of the present disclosure, the number of tiles may be more or less.

The method provided by the embodiment of the disclosure can change the image attribute through the abstract syntax tree, set the corresponding dynamic processing mechanism according to different information corresponding to the attribute, and transform different style themes through a single file without loading a large number of files.

As shown in fig. 5, an embodiment of the present disclosure also provides an apparatus 10 for image processing, which may include an obtaining module 30, a processing module 50, a traversing module 70, and a generating module 90. Wherein the retrieving module 30 is operable to retrieve the scalable vector graphics source file and the attribute list. Processing module 50 may be configured to process the scalable vector graphics source file into a static abstract syntax tree and process the attributes into dynamic attributes according to the attribute list, such that the static abstract syntax tree becomes a dynamic abstract syntax tree. Traversal module 70 may be used to traverse the number of nodes. The generating module 90 may be configured to generate the dynamic abstract syntax tree into a function file with the dynamic attribute as a parameter. In addition, the embodiment of the present disclosure may further include a loading module (not shown), which may be configured to load the scalable vector graphics source file in the form of the extensible markup language into data in the corresponding JavaScript object notation format.

For the embodiments of the apparatus, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described apparatus embodiments are merely illustrative, wherein the modules described as separate modules may or may not be separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

The image processing and searching method and apparatus of the present disclosure have been described above based on the embodiments and application examples. In addition, the present disclosure also provides a terminal and a storage medium, which are described below.

Referring now to fig. 6, a schematic diagram of an electronic device (e.g., a terminal device or server) 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 6, the electronic device 800 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.

Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 6 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.

In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.

It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.

The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.

The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods of the present disclosure as described above.

Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.

The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

According to one or more embodiments of the present disclosure, there is provided a method of image processing, including:

obtaining a scalable vector graphics source file;

processing the scalable vector graphics source file into a static abstract syntax tree; wherein the static abstract syntax tree comprises a plurality of nodes;

traversing the plurality of nodes to obtain attributes corresponding to each of the plurality of nodes;

acquiring an attribute list, and processing the attribute into a dynamic attribute according to the attribute list so as to change the static abstract syntax tree into a dynamic abstract syntax tree; and

and generating a function file with the dynamic attribute as a parameter by using the dynamic abstract syntax tree.

In accordance with one or more embodiments of the present disclosure, there is provided a method wherein the step of processing the scalable vector graphics source file into a static abstract syntax tree comprises:

loading a scalable vector graphics source file in an extensible markup language form into corresponding data in a JavaScript object notation format; and

and filtering the data to generate the static abstract syntax tree.

In accordance with one or more embodiments of the present disclosure, there is provided a method wherein the attributes include a stroke attribute, a color attribute, and a position attribute, and the attribute list includes a bounding box list, a color list, and a position list.

In accordance with one or more embodiments of the present disclosure, there is provided a method wherein the bounding box list includes a number of bounding box values corresponding to the stroke attribute; the color list comprises a number of color values corresponding to the color attribute; the location list includes a number of location values corresponding to the location attribute.

In accordance with one or more embodiments of the present disclosure, there is provided a method, wherein the step of processing the attribute as a dynamic attribute according to the attribute list comprises:

acquiring color values in the color list; and

matching the color values with the color attributes, respectively; if one of the color values is the same as one of the color attributes, then the color attribute is processed as the dynamic attribute.

In accordance with one or more embodiments of the present disclosure, there is provided a method, wherein the step of processing the attribute as a dynamic attribute according to the attribute list further comprises:

entering one of the plurality of nodes;

sequentially processing the attribute corresponding to the node into a dynamic attribute according to the attribute list; exiting the dynamic property in reverse order; and

and closing the one node and entering the next node of the one node.

In accordance with one or more embodiments of the present disclosure, there is provided a method, wherein the step of generating the dynamic abstract syntax tree into a function file further comprises:

and generating the dynamic abstract syntax tree into a corresponding function file according to different parameters through a generator.

According to one or more embodiments of the present disclosure, there is provided an apparatus for image processing, including:

an obtaining module for obtaining a scalable vector graphics source file and an attribute list;

a processing module for processing the scalable vector graphics source file into a static abstract syntax tree and processing the attributes into dynamic attributes according to the attribute list, so that the static abstract syntax tree becomes a dynamic abstract syntax tree;

the traversing module is used for traversing the nodes; and

and the generating module is used for generating the dynamic abstract syntax tree into a function file with the dynamic attribute as a parameter.

According to one or more embodiments of the present disclosure, there is provided a terminal including: at least one memory and at least one processor;

wherein the at least one memory is configured to store program code, and the at least one processor is configured to call the program code stored in the at least one memory to perform the method of any one of the above.

According to one or more embodiments of the present disclosure, there is provided a storage medium for storing program code for performing the above-described method.

The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:获取表情信息的方法、装置和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!