[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112083865B - Image generation method and device, terminal and readable storage medium - Google Patents

Image generation method and device, terminal and readable storage medium Download PDF

Info

Publication number
CN112083865B
CN112083865B CN202011020042.3A CN202011020042A CN112083865B CN 112083865 B CN112083865 B CN 112083865B CN 202011020042 A CN202011020042 A CN 202011020042A CN 112083865 B CN112083865 B CN 112083865B
Authority
CN
China
Prior art keywords
primitive
path
transformation
drawing path
rendering
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
CN202011020042.3A
Other languages
Chinese (zh)
Other versions
CN112083865A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011020042.3A priority Critical patent/CN112083865B/en
Priority to CN202210788262.3A priority patent/CN115167735A/en
Publication of CN112083865A publication Critical patent/CN112083865A/en
Application granted granted Critical
Publication of CN112083865B publication Critical patent/CN112083865B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides an image generation method, which comprises the steps of obtaining a drawing path; performing path rendering on the drawing path to generate a basic primitive; and primitive processing the base primitive to obtain at least one transformed pattern. The image generation method provided by the embodiment of the application does not need to rely on images preset by a manufacturer or downloaded on the internet to set the image displayed on the screen, the screen locking wallpaper and the like, the drawing path can be rendered to generate the basic primitive, and then the primitive processing is carried out on the basic primitive to obtain at least one conversion pattern to be used as the image displayed on the screen, the screen locking wallpaper and the like. The user can draw a drawing path in any shape at will, and can generate the transformation pattern in an individualized way according to the drawing path, the requirement on drawing power is low, the shape change of the drawing path is more, the variety of the obtained transformation pattern is more, and abundant individualized experience is realized. The application also provides an image generation device, a terminal and a non-volatile computer readable storage medium.

Description

Image generation method and device, terminal and readable storage medium
Technical Field
The present application relates to the field of image technologies, and in particular, to an image generation method, an image generation apparatus, a terminal, and a non-volatile computer-readable storage medium.
Background
At present, screen savers, screen locking wallpapers and wallpaper displayed by a display (such as a display of a terminal) and information screen display images widely used on a mobile phone at present are all preset by manufacturers or downloaded from the internet and cannot be designed by users in a self-defined way, although some image drawing software exists, satisfactory patterns can be made only by strong drawing power, and personalized experience is poor.
Disclosure of Invention
Embodiments of the present application provide an image generation method, an image generation apparatus, a terminal, and a non-volatile computer-readable storage medium.
The image generation method of the embodiment of the application comprises the steps of obtaining a drawing path; performing path rendering on the drawing path to generate a base primitive; and performing primitive processing on the base primitive to obtain at least one transform pattern.
The image generation device comprises an acquisition module, a processing module and a generation module. The acquisition module is used for acquiring a drawing path; the rendering module is further configured to perform path rendering on the drawing path to generate a base primitive; the generation module is configured to perform primitive processing on the base primitive to obtain at least one transformed pattern.
The terminal of one embodiment of the present application includes a housing and an image generating device disposed within the housing. The image generation device comprises an acquisition module, a processing module and a generation module. The acquisition module is used for acquiring a drawing path; the rendering module is further configured to perform path rendering on the drawing path to generate a base primitive; the generation module is configured to perform primitive processing on the base primitive to obtain at least one transformed pattern.
The terminal of another embodiment of the present application includes a processor configured to obtain a rendering path; performing path rendering on the drawing path to generate a base primitive; and performing primitive processing on the base primitive to obtain at least one transform pattern.
A non-transitory computer-readable storage medium embodying a computer program that, when executed by one or more processors, causes the processors to perform an image generation method. The image generation method comprises the steps of obtaining a drawing path; performing path rendering on the drawing path to generate a basic primitive; and performing primitive processing on the base primitive to obtain at least one transform pattern.
According to the image generation method, the image generation device, the terminal and the nonvolatile computer readable storage medium, the image displayed on the screen, the screen locking wallpaper and the like can be set without relying on the image preset by a manufacturer or downloaded on the internet, the drawing path can be rendered to generate the basic primitive, and then the primitive processing is carried out on the basic primitive to obtain at least one conversion pattern to be used as the image displayed on the screen, the screen locking wallpaper and the like. The user can draw a drawing path with any shape at will, and can generate the transformation pattern according to the drawing path in a personalized way, the requirement on drawing power is low, the shape change of the drawing path is more, the variety of the obtained transformation pattern is more, and therefore rich personalized experience is achieved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of an image generation method of certain embodiments of the present application;
FIG. 2 is a block schematic diagram of an image generation apparatus according to some embodiments of the present application;
FIG. 3 is a schematic plan view of a terminal according to some embodiments of the present application;
FIGS. 4a and 4b are schematic diagrams of path rendering for an image generation method according to some embodiments of the present application;
FIGS. 5a and 5b are schematic diagrams of primitive processing for an image generation method according to some embodiments of the present application;
FIG. 6 is a schematic view of a scene of an image generation method of some embodiments of the present application;
FIG. 7 is a schematic illustration of a scene of an image generation method of some embodiments of the present application;
FIG. 8 is a schematic view of a scene of an image generation method of some embodiments of the present application;
FIG. 9 is a schematic view of a scene of an image generation method of some embodiments of the present application;
FIG. 10 is a schematic flow chart diagram of an image generation method of certain embodiments of the present application;
FIG. 11 is a schematic illustration of an image generation method according to certain embodiments of the present application;
FIG. 12 is a schematic illustration of an image generation method according to certain embodiments of the present application;
FIG. 13 is a schematic illustration of an image generation method according to certain embodiments of the present application;
FIG. 14 is a schematic flow chart diagram of an image generation method of certain embodiments of the present application;
FIG. 15 is a schematic flow chart diagram of an image generation method of certain embodiments of the present application; and
FIG. 16 is a schematic diagram of a connection between a processor and a computer readable storage medium according to some embodiments of the present application.
Detailed Description
Embodiments of the present application will be further described below with reference to the accompanying drawings. The same or similar reference numbers in the drawings identify the same or similar elements or elements having the same or similar functionality throughout. In addition, the embodiments of the present application described below in conjunction with the accompanying drawings are exemplary and are only for the purpose of explaining the embodiments of the present application, and are not to be construed as limiting the present application.
Referring to fig. 1, an image generation method according to an embodiment of the present disclosure includes the following steps:
011: obtaining a drawing path;
012: performing path rendering on the drawing path to generate a basic primitive; and
013: primitive processing is performed on the base primitive to obtain at least one transformed pattern.
Referring to fig. 2, an image generating apparatus 10 according to an embodiment of the present disclosure includes an obtaining module 11, a rendering module 12, and a processing module 13. The obtaining module 11, the rendering module 12 and the processing module 13 are configured to perform step 011, step 012 and step 013, respectively. Namely, the obtaining module 11 is configured to obtain a drawing path; the rendering module 12 is configured to perform path rendering on the drawing path to generate a base primitive; the processing module 13 is configured to perform primitive processing on the base primitive to obtain at least one transform pattern.
Referring to fig. 3, the terminal 100 includes a processor 20. The processor 20 is configured to obtain a rendering path; performing path rendering on the drawing path to generate a basic primitive; and generating a final image according to the transformed pattern. That is, step 011, step 012, and step 013 can be implemented by processor 20.
Specifically, the terminal 100 includes a housing 40, an image generation device 10, a processor 20, and a touch display screen 30. The terminal 100 may be a mobile phone, a tablet computer, a display device, a notebook computer, a teller machine, a gate, a smart watch, a head-up display device, a game console, etc. As shown in fig. 3, the embodiment of the present application is described by taking the terminal 100 as an example, and it should be understood that the specific form of the terminal 100 is not limited to a mobile phone. The processor 20 may be provided within the image generation apparatus 10, and the acquisition module 11, the rendering module 12, and the processing module 13 of the image generation apparatus 10 may perform the corresponding image generation method through the processor 20. The image generating apparatus 10 may further include a plurality of processing circuits, each processing circuit corresponds to one module (such as the obtaining module 11, the rendering module 12, or the processing module 13), and the obtaining module 11, the rendering module 12, and the processing module 13 of the image generating apparatus 10 may execute the corresponding image generating method through the corresponding processing circuit.
The housing 40 may be used to install functional modules of the terminal 100, such as the image generation device 10, the display device (i.e., the touch display screen 30), the processing device (i.e., the processor 20), the imaging device, the power supply device, and the communication device, i.e., the image generation device 10, the display device (i.e., the touch display screen 30), the processing device (i.e., the processor 20), the imaging device, the power supply device, and the communication device, so that the housing 40 provides protection for the functional modules, such as dust prevention, falling prevention, and water prevention.
The terminal 100 can set the pattern, the lock screen pattern, the wallpaper and the like displayed on the screen by self-definition, and the pattern, the lock screen pattern, the wallpaper and the like displayed on the screen can be downloaded from the network, can be selected from a local photo album, and can be manufactured by the existing image design software. However, the existing automatic pattern generation schemes generally transform a basic pattern, which is generally pre-stored in a database, for example, the basic pattern is a basic pattern (triangle, rectangle, etc.), and when an image is automatically generated, the selected basic pattern is subjected to image transformation, so as to generate a final pattern, however, the type of the basic pattern is limited, and the type of the generated pattern is also less.
The image generation method of the present application can obtain a drawing path by manual drawing by a user, thereby generating a transformation pattern based on the drawing path. The following description is given by taking an example that a user manually draws a pattern displayed by a user-defined information screen, and the principle that the user manually draws the pattern displayed by the user-defined information screen, wallpaper and the like is basically similar, and is not repeated herein.
The user may manually draw the drawing path on the touch display screen 30. The touch display screen 30 may be configured to receive an input operation from a user, for example, the user performs a touch operation on the touch display screen 30, and the processor 20 may obtain a touch position according to the touch operation received by the touch display screen 30, so as to determine a drawing path according to a change of the touch position. In another embodiment, when the terminal 100 is a notebook computer, the input operation of the user may be received through a mouse. The drawing path may be a point, a line, or an irregular shape, etc. Alternatively, the user may sample a preset basic graph to obtain the drawing path, for example, select one of the basic graphs, or one or more small segments of the basic graph, or select multiple points of the basic graph and connect, so as to generate the drawing path based on the sampling of the basic graph, where the basic graph includes at least one of geometric graphs (e.g., triangles, rectangles, diamonds, circles, polygons, etc.) and function curves (e.g., trigonometric function curves, hyperbolic function curves, etc.), and specifically, the basic graph of the present application includes geometric graphs and function curves, so as to provide more choices for the user to sample, thereby generating more diversified drawing paths.
Upon acquiring the rendering path, the processor 20 may perform path rendering on the rendering path to generate a corresponding base primitive in real time, where the path rendering may include at least one of thickness rendering of the rendering path, style rendering of the rendering path, color rendering of the rendering path, and smoothness rendering of the rendering path. For example, as shown in fig. 4a, when the touch display screen 30 receives a touch operation and a portion (e.g., a point or a small segment, for example, a small segment) is drawn on the touch display screen 30, the processor 20 performs real-time rendering on the current drawing path L. The user may pre-select the rendering type: rendering the thickness of the drawing path L (for example, three types of thickness, medium thickness and thin thickness, or more thickness levels for the user to select), the style of the drawing path L (for example, a brush pen style, a pencil style, a pen style, a crayon style, etc.), the color of the drawing path L (for example, the color of black, white, red, green, gradient colors of different colors, etc.), the smoothness of the drawing path L (for example, zero level smoothness, first level smoothness, second level smoothness, third level smoothness, etc. are selected, the higher the level is, the larger the smoothness is, the smaller the curvature after the drawing path is smoothed is), if the path pre-selected by the user is rendered to be thick, brush pen style, black and first level smoothness, the processor 20 renders the drawing path L in real time according to the path rendering selected by the user, so that the drawing path L is rendered to be the drawing path L from the thick black brush pen, and can smooth the drawing path L based on a preset curve generation algorithm, the change of the drawing path L is made smoother, resulting in the base primitive P0. In this way, rendering of the drawing path is realized through different path rendering, so that more diversified drawing paths can be generated. For another example, the user samples a preset basic graphic to obtain a drawing path, as shown in fig. 4b, the user selects a combination of a triangle and a diamond to be spliced as the drawing path L ', and selects path rendering to be coarse, pencil style, black, and zero-level smoothing, and then the processor 20 renders the drawing path L' in real time according to the path rendering selected by the user, so that the drawing path L 'is rendered as the drawing path L' drawn by a black thick pencil, and the zero-level smoothing indicates that the processor 20 does not perform smoothing processing on the drawing path L ', thereby generating the basic primitive P0'.
While the processor 20 performs primitive processing on the base primitive P0, the primitive processing includes at least one of spiral, zoom, rotation, mirror, translation, stretch, rotation zoom, mirror zoom, etc., the primitive processing may be a combination of one or more primitive processing randomly selected by the processor 20 or a combination of one or more primitive processing manually selected by a user.
Wherein, the spiral means to rotate for a plurality of times according to different rotation centers; primitive processing comprises multiple levels, for example, scaling comprises zero level, first level, second level, third level, etc., wherein zero level scaling refers to not scaling the base primitive P0, first level scaling refers to scaling the base primitive P0 once, and second level scaling refers to scaling the scaled base primitive P0 again after scaling the base primitive P0 once; for another example, the rotation includes zero-level rotation, i.e., rotation of the base primitive P0 is not performed, first-level rotation refers to rotation of the base primitive P0, and second-level rotation refers to rotation of the base primitive P0 after rotation of the base primitive P0; the rotation angle may be related to the number of stages of rotation, for example, a rotation angle α is β/(N +1), where β is a predetermined angle (e.g., 180 degrees, 360 degrees, etc., and the predetermined angle β is 360 degrees), N is a natural number, and for example, a rotation angle α of the secondary rotation is 360/(2+1) 120 degrees, and a rotation angle α of the tertiary rotation is 360/(3+1) 90 degrees; rotation scaling refers to the simultaneous rotation and scaling of the base primitive P0; mirroring refers to the simultaneous mirroring and scaling of the base primitive P0. In other embodiments, primitive processing also includes restoring, which refers to restoring the primitive processing effects that have been performed to restore the transformation pattern P1 to the base primitive P0 when not primitive processed.
For example, as shown in fig. 5a, the primitive selected by the user is processed as a first-level scaling, a second-level rotation and a first-level mirroring, and the processor 20 sequentially performs the first-level scaling, the second-level rotation and the first-level mirroring on the basic primitive P0 in fig. 4a to obtain the transformed transformation pattern P1 in fig. 5a, specifically, the processor 20 performs the first-level scaling on the basic primitive P0 to obtain a first intermediate transformation pattern P01, then performs the second-level rotation on the first intermediate transformation pattern P01 to obtain a second intermediate transformation pattern P02, and then performs the first-level mirroring on the second intermediate transformation pattern P02 to obtain the final transformation pattern P1. It is understood that the touch display screen 30 may display the first intermediate transformation pattern P01 and the second intermediate transformation pattern P02, and if the user likes the first intermediate transformation pattern P01 and the second intermediate transformation pattern P02, the user may directly use the liked intermediate transformation pattern as the transformation pattern P1.
For another example, as shown in fig. 5b, the primitive selected by the user is processed as a three-level rotation and a one-level mirroring, and the processor 20 sequentially performs the three-level rotation and the one-level mirroring on the basic primitive P0 'in fig. 4b to obtain the transformed transformation pattern P1' of fig. 5 b. Specifically, the processor 20 performs a three-level rotation on the base primitive P0 'to obtain a third intermediate transformed pattern P03, and then performs a one-level mirroring on the third intermediate transformed pattern P03 to obtain a final transformed pattern P1'.
As shown in fig. 3, the center of the primitive processing such as rotating, zooming, mirroring and the like may be the center of the predetermined drawing area a, only the predetermined drawing area a can receive the touch operation and generate the drawing path L according to the touch operation, taking the display area of the touch display screen 30 as a rounded rectangle as an example, the predetermined drawing area a may be any inscribed circle of the rounded rectangle or the predetermined drawing area a may be located in any inscribed circle of the rounded rectangle, thereby ensuring that when the drawing path L is located in the predetermined drawing area a, the generated transformation pattern P1 is partially located outside the predetermined drawing area a regardless of whether the rotation, the zooming or the mirroring is performed, and the integrity of the transformation pattern P1 is affected.
As the drawing path L is drawn, the basic primitive P0 and the transformation pattern P1 change in real time synchronously, for example, a user prepares to draw an irregular ellipse, as the user draws the irregular ellipse, a little point of the irregular ellipse is drawn, the processor 20 renders the drawn part in real time to obtain the corresponding basic primitive P0 and performs primitive processing to obtain the transformation pattern P1, and when the user finishes drawing the irregular ellipse, the transformation pattern P1 corresponding to the entire irregular ellipse is generated. It can be understood that, during the process of drawing the drawing path L, the touch display screen 30 displays the transformation pattern P1 corresponding to the current drawing path in real time, and if the user is satisfied with the transformation pattern P1, the drawing may be terminated. Therefore, the user can view the transformation pattern P1 corresponding to the current drawing path L in real time so as to carry out modification or storage and other operations, and the user is prevented from missing a satisfactory transformation pattern P1 in the drawing process.
In an example, the drawing path is an irregular ellipse, the path is rendered to be thick, black, pencil and smooth in a first level, the primitive processing is rotation scaling, five-level rotation and mirror image, as shown in fig. 6 to 9, as the drawing path is gradually drawn, the processor 20 generates a base primitive in real time according to the current drawing path and performs the primitive processing to sequentially generate a corresponding transformation pattern P11, a transformation pattern P12, a transformation pattern P13 and a transformation pattern P14, wherein the transformation pattern P14 is a transformation pattern corresponding to the irregular ellipse, the transformation pattern P11, the transformation pattern P12 and the transformation pattern P13 are respectively intermediate transformation patterns which are generated in real time during the irregular ellipse drawing process and displayed on the touch display screen 30, and a user can modify the transformation patterns according to the transformation patterns generated in real time and store the transformation patterns when satisfied.
In the image generation method, the image generation apparatus 10, and the terminal 100 according to the embodiment of the application, it is not necessary to set an image for screen display, a screen locking wallpaper, and the like by relying on an image preset by a manufacturer or downloaded from a network, a rendering path may be performed to generate a basic primitive, and then the primitive processing may be performed on the basic primitive to obtain at least one transformed pattern as the image for screen display, the screen locking wallpaper, and the like. The user can draw a drawing path with any shape at will (such as manually drawing or drawing by sampling a basic graph), and can generate the transformation pattern individually according to the drawing path, the requirement on drawing power is low, the shape change of the drawing path is more, compared with the prior art that only the preset basic pattern is processed to obtain the image, the variety of the image is less, the variety of the transformation pattern generated individually according to the drawing path is more, and rich individual experience can be realized.
Referring to FIG. 10, in some embodiments, the primitive includes a plurality of primitives; step 012 further includes the steps of:
0121: respectively carrying out primitive processing on each basic primitive to obtain an intermediate pattern corresponding to each basic primitive; and
0122: the plurality of intermediate patterns are superimposed to obtain a transformed pattern.
Referring again to fig. 2, in some embodiments, the rendering module 12 is further configured to perform step 0121 and step 0122. That is, the rendering module 12 is further configured to perform primitive processing on each basic primitive to obtain an intermediate pattern corresponding to each basic primitive; and superposing the plurality of intermediate patterns to obtain a transformed pattern.
Referring again to fig. 3, in some embodiments, the processor 20 is further configured to perform primitive processing on each basic primitive to obtain an intermediate pattern corresponding to each basic primitive; and superposing the plurality of intermediate patterns to obtain a transformed pattern. That is, steps 0121 and 0122 may be implemented by the processor 20.
Specifically, the base primitives include a plurality of primitives, and the processor 20 performs real-time rendering on the rendering path, where each portion (such as a point or a small segment) of the rendering path is rendered by the processor 20 in real time to obtain corresponding base primitives, that is, each base primitive corresponds to a different portion of the rendering path. For example, when the touch display 30 receives a touch operation of a user to generate a drawing path, it may identify whether the user has finished drawing (for example, if the touch operation of the user is not received within a predetermined time (for example, 0.5S, 1S, etc.), the user is considered to have finished drawing), and each pen is taken as a part of the drawing path. Each part corresponds to a basic primitive and an intermediate pattern processed by the primitive, and different primitive processing can be respectively carried out on the basic primitives corresponding to different parts. For example, as shown in fig. 11 and 12, the drawing path includes a first arc L1 and a second arc L2, the user selects the rendering type to be thin, pencil, black and one-level smooth, the processor 20 renders the first arc L1 and the second arc L2 in real time to obtain a first arc L1 and a second arc L2 shown in fig. 11 and 12, and of course, the processor 20 may also render the first arc L1 and the second arc L2 respectively using different rendering types to obtain more diversified drawing paths. Then, the processor 20 performs a first-level scaling, a second-level rotation and a first-level mirroring on one portion (the first arc L1 in fig. 11) to obtain the fourth intermediate image P04, and performs a second-level translation and a first-level mirroring on the other portion (the second arc L2 in fig. 12) to obtain the fifth intermediate image P05, and the processor 20 superimposes the intermediate patterns (i.e., P04 and P05) corresponding to the multiple portions of the drawing path to obtain the transformed pattern P2 (as shown in fig. 13) corresponding to the entire drawing path, thereby further improving the diversity of the transformed pattern P2. In other embodiments, processor 20 may perform different path renderings on the entire rendering path to generate different base primitives, and then superimpose multiple intermediate patterns resulting from primitive processing of multiple base primitives to generate the transformed pattern.
Referring to fig. 14, in some embodiments, after step 013, the image generation method further includes:
14: and saving data of the drawing path, data of path rendering and data of primitive processing.
Referring again to fig. 2, in some embodiments, the image generation apparatus 10 further includes a saving module 14. The saving module 14 is also configured to perform step 014. That is, the saving module 14 is also used for saving data of drawing paths, data of path rendering, and data of primitive processing.
Referring again to fig. 3, in some embodiments, the terminal 100 further includes a memory 50, and the memory 50 is further configured to store data of a drawing path, data of a path rendering, and data of a primitive processing. That is, step 014 may be implemented by memory 50.
Specifically, when the user finishes drawing the drawing path and determines that the corresponding transformation pattern is an image displayed on a screen, the transformation pattern can be selected to be saved, when the transformation pattern is saved, the processor 20 can directly save the determined transformation pattern, and when the subsequent requirement is met, the processor 20 can take out the transformation pattern from the memory 50 for use; or the generated transformation pattern is not directly stored, but the data of the drawing path, the data of the path rendering and the data of the primitive processing corresponding to the transformation pattern are stored in a storage 50 connected with the transformation pattern, the data of the drawing path, the data of the path rendering and the data of the primitive processing can be stored in a text in a character string form, and when needed later, the processor 20 takes out the stored text with the data of the drawing path, the data of the path rendering and the data of the primitive processing from the storage 50 and generates the corresponding transformation pattern according to the data of the drawing path, the data of the path rendering and the data of the primitive processing again, so that the transformation pattern occupying a large memory does not need to be stored, and the storage space can be saved.
Referring to fig. 15, in some embodiments, the image generation method further includes the following steps:
015: restoring at least one transformation pattern according to the stored data of the drawing path, the data of the path rendering and the data of the primitive processing; and
016: at least one transformed pattern is displayed.
Referring again to fig. 2, in some embodiments, the image generating apparatus 10 further includes a restoring module 15 and a display module 16. The restoring module 15 and the displaying module 16 are respectively used for executing the steps 015 and 016. That is, the restoring module 15 is configured to restore at least one transformation pattern according to the saved data of the rendering path, the data of the path rendering, and the data of the primitive processing; and a display module 16 for displaying at least one transformed pattern.
Referring again to fig. 3, in some embodiments, the terminal 100 further includes a touch display 30, and the processor 20 is further configured to restore at least one transformation pattern according to the saved data for drawing the path, the data for rendering the path, and the data for processing the primitive; the touch display screen 30 is used for displaying at least one conversion pattern. That is, step 015 can be implemented by the processor 20, and step 016 can be implemented by the touch display screen 30.
Specifically, after the user stores the drawing path, the path rendering, and the primitive processing corresponding to the transform pattern in the memory 50, the processor 20 may restore at least one transform pattern according to the stored data of the drawing path, the data of the path rendering, and the data of the primitive processing; for example, if the user stores the transformation pattern and sets the transformation pattern as an image displayed on the touch screen, when the touch screen 30 is touched to perform screen saver, the processor 20 obtains the stored data of the drawing path, the path rendering data, and the primitive processing data, and then restores at least one transformation pattern according to the stored data of the drawing path, the path rendering data, and the primitive processing data.
When the image displayed in the screen saver is a static image, the processor 20 may retrieve the stored transformation pattern from the memory 50, or restore the transformation pattern corresponding to the complete drawing path according to the stored data of the drawing path, the path rendering data, and the data of the primitive processing, and then statically display the transformation pattern on the touch display screen 30 in the screen saver.
Or when the image displayed on the screen is a display animation, the processor 20 may restore a plurality of transform patterns (e.g., transform pattern P11, transform pattern P12, transform pattern P13, and transform pattern P14 shown in fig. 6 to 9) according to the saved data of the rendering path, the data of the path rendering, and the data of the primitive processing. Specifically, the processor 20 redraws according to the drawing path and generates a transformation pattern corresponding to the current drawing path in real time, and each time the processor 20 draws a part of the drawing path (for example, draws a predetermined number of points, the predetermined number may be 1, 5, 10, 50, etc.), the processor 20 generates a corresponding transformation pattern in real time according to the currently drawn drawing path, and the processor 20 generates a continuous multi-frame display image according to the plurality of transformation patterns and the generation time of the transformation pattern (i.e., a continuous multi-frame display image may be generated according to the transformation pattern P11, the transformation pattern P12, the transformation pattern P13, and the transformation pattern P14), and then the touch display screen 30 continuously displays the multi-frame display image to form a display animation, and compared to storing the display animation in advance, the storage space required for storing the data of the drawing path, the data of the path rendering, and the data of the primitive processing is smaller, and display animation does not need to be made in advance.
The display animation embodies the drawing process from the beginning of drawing the path to the final generation of the transformation pattern corresponding to the complete drawing path, and the personalized information screen display is realized. Of course, since the number of points possibly included in the drawing path is large, if each point is drawn to perform primitive processing to obtain a corresponding transformation pattern, the number of transformation patterns is large, which results in too long time for generating the display animation, and too large calculation amount of the processor 20, therefore, the predetermined number can be set to be large, and the primitive processing is performed to obtain the transformation pattern after each point with the predetermined number is drawn, so that the number of transformation patterns is reduced, the animation time is short, and the calculation amount of the processor 20 is small.
Alternatively, the processor 20 may statically display the transition pattern for a first predetermined period of time and display the animation for a second predetermined period of time. If the first predetermined period is night (e.g., 0 o 'clock to 7 o' clock) and the second predetermined period is day (e.g., 7 o 'clock to 24 o' clock), the static display transform pattern is used during the night of the terminal 100, and the animation of the display formed by the continuous play of the plurality of transform patterns is displayed during the day of the terminal 100.
Referring to fig. 16, a non-volatile computer readable storage medium 300 storing a computer program 302 according to an embodiment of the present disclosure, when the computer program 302 is executed by one or more processors 200, the processor 200 may execute the image generation method according to any of the embodiments.
For example, referring to fig. 1, the computer program 302, when executed by the one or more processors 200, causes the processors 200 to perform the steps of:
011: acquiring a drawing path;
012: performing path rendering on the drawing path to generate a basic primitive; and
013: primitive processing is performed on the base primitive to obtain at least one transformed pattern.
For another example, referring to fig. 10, when the computer program 302 is executed by the one or more processors 200, the processors 200 may further perform the following steps:
0121: respectively carrying out primitive processing on each basic primitive to obtain an intermediate pattern corresponding to each basic primitive; and
0122: the plurality of intermediate patterns are superimposed to obtain a transformed pattern.
For another example, referring to fig. 14, when the computer program 302 is executed by the one or more processors 200, the processors 200 may further perform the steps of:
14: and saving the drawing path, path rendering and primitive processing.
In the description herein, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example" or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more program modules for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
Although embodiments of the present application have been shown and described above, it is to be understood that the above embodiments are exemplary and not to be construed as limiting the present application, and that changes, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (9)

1. An image generation method, comprising:
obtaining a drawing path;
performing path rendering on the drawing path to generate a base primitive;
performing primitive processing on the basic primitive to sequentially obtain a plurality of transformation patterns;
in the process of drawing the drawing path, displaying the transformation pattern corresponding to the current drawing path in real time through a display screen;
storing the data of the drawing path, the data of the path rendering and the data of the primitive processing;
when the image displayed on the screen is animation, restoring a plurality of transformation patterns according to the stored data of the drawing path, the data rendered by the path and the data processed by the graphics primitive, wherein the plurality of transformation patterns are formed in the process of generating a final transformation image based on the same basic graphics primitive; and
and generating continuous multi-frame display images by utilizing a plurality of transformation patterns formed in the process of generating the final transformation image based on one base primitive and the generation time of each transformation pattern, and continuously displaying a plurality of frames of the display images to form the display animation.
2. The image generation method according to claim 1, wherein the acquiring a rendering path includes:
acquiring the drawing path according to the input operation of a user; and/or
Sampling a base graph to obtain the drawing path, the base graph including at least one of a geometric graph and a function curve.
3. The image generation method according to claim 1, wherein the path rendering includes at least one of a thickness rendering of a drawing path, a style rendering of a drawing path, a color rendering of a drawing path, and a smoothness rendering of a drawing path.
4. An image generation method according to claim 1, wherein the primitive processing includes at least one of spiral, scaling, rotation, mirroring, translation and stretching.
5. An image generation method according to claim 1, wherein the base primitive comprises a plurality; the primitive processing the base primitive to obtain at least one transform pattern, comprising:
respectively carrying out primitive processing on each basic primitive to obtain an intermediate pattern corresponding to each basic primitive; and
superimposing a plurality of the intermediate patterns to obtain the transformed pattern.
6. An image generation apparatus, comprising:
the acquisition module is used for acquiring a drawing path;
the rendering module is used for performing path rendering on the drawing path to generate a basic primitive;
the processing module is used for carrying out primitive processing on the basic primitive to sequentially obtain a plurality of transformation patterns and controlling the transformation patterns corresponding to the current drawing path to be displayed in real time through a display screen in the process of drawing the drawing path;
the storage module is used for storing the data of the drawing path, the data of the path rendering and the data of the primitive processing;
the restoring module is used for restoring a plurality of transformation patterns according to the stored data of the drawing path, the data rendered by the path and the data processed by the graphic primitive when the image displayed on the display screen is the display animation, wherein the plurality of transformation patterns are formed in the process of generating the final transformation image based on the same basic graphic primitive; and
and the display module is used for generating continuous multi-frame display images by utilizing a plurality of transformation patterns formed in the process of generating the final transformation image based on one base primitive and the generation time of each transformation pattern, and continuously displaying the multi-frame display images to form the display animation.
7. A terminal, characterized in that the terminal comprises a housing and an image generating device according to claim 6, which image generating device is arranged within the housing.
8. A terminal comprising a processor configured to obtain a render path; performing path rendering on the drawing path to generate a base primitive; performing primitive processing on the base primitive to obtain a plurality of transformation patterns; in the process of drawing the drawing path, controlling a display screen to display the transformation pattern corresponding to the current drawing path in real time; controlling and storing the data of the drawing path, the data of the path rendering and the data of the primitive processing; when the image displayed on the display screen and the information screen is animation, restoring a plurality of transformation patterns according to the stored data of the drawing path, the data rendered by the path and the data processed by the graphic primitive, wherein the plurality of transformation patterns are formed in the process of generating a final transformation image based on the same basic graphic primitive; and the plurality of transformation patterns are formed in the process of generating the final transformation image based on the same basic primitive, and generate continuous multi-frame display images according to the plurality of transformation patterns formed in the process of generating the final transformation image and the generation time of each transformation pattern, and control the continuous display of the multi-frame display images to form the display animation.
9. A non-transitory computer-readable storage medium containing a computer program which, when executed by a processor, causes the processor to perform the image generation method of any one of claims 1 to 5.
CN202011020042.3A 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium Active CN112083865B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011020042.3A CN112083865B (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium
CN202210788262.3A CN115167735A (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011020042.3A CN112083865B (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210788262.3A Division CN115167735A (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium

Publications (2)

Publication Number Publication Date
CN112083865A CN112083865A (en) 2020-12-15
CN112083865B true CN112083865B (en) 2022-07-12

Family

ID=73739870

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202011020042.3A Active CN112083865B (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium
CN202210788262.3A Pending CN115167735A (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210788262.3A Pending CN115167735A (en) 2020-09-24 2020-09-24 Image generation method and device, terminal and readable storage medium

Country Status (1)

Country Link
CN (2) CN112083865B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118535058A (en) * 2020-12-30 2024-08-23 华为技术有限公司 Off-screen display method and electronic equipment

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140085942A (en) * 2012-12-28 2014-07-08 삼성전자주식회사 Method for controlling two or three dimensional figure based on touch and device thereof
CN104281308A (en) * 2013-07-11 2015-01-14 深圳富泰宏精密工业有限公司 Touch electronic device and drawing method thereof
CN103488395A (en) * 2013-09-06 2014-01-01 广东明创软件科技有限公司 Touch-screen mobile terminal based line drawing method and touch-screen mobile terminal
CN104267838A (en) * 2014-10-22 2015-01-07 陈华 Intelligent handwriting input method and input system
CN106569834A (en) * 2016-11-14 2017-04-19 福建天泉教育科技有限公司 Animation production method and animation production system based on browser
CN107103634A (en) * 2017-04-20 2017-08-29 广州视源电子科技股份有限公司 Graph track drawing method, device and equipment and computer storage medium
CN109725811A (en) * 2017-10-27 2019-05-07 珠海金山办公软件有限公司 A kind of method and apparatus that PDF draws arrow figure
CN110221898B (en) * 2019-06-19 2024-04-30 北京小米移动软件有限公司 Display method, device and equipment of screen-extinguishing picture and storage medium
CN110796712A (en) * 2019-10-24 2020-02-14 北京达佳互联信息技术有限公司 Material processing method, device, electronic equipment and storage medium
CN111107264A (en) * 2019-11-11 2020-05-05 宇龙计算机通信科技(深圳)有限公司 Image processing method, image processing device, storage medium and terminal
CN111459593B (en) * 2020-03-31 2023-03-24 杭州海康威视数字技术股份有限公司 Drawing method, device and equipment
CN111459438A (en) * 2020-04-07 2020-07-28 苗圣全 System, method, terminal and server for synchronizing drawing content with multiple terminals

Also Published As

Publication number Publication date
CN115167735A (en) 2022-10-11
CN112083865A (en) 2020-12-15

Similar Documents

Publication Publication Date Title
CN110266971B (en) Short video making method and system
US11729514B2 (en) Image processing method and apparatus
CN110287368B (en) Short video template design drawing generation device and short video template generation method
US11217015B2 (en) Method and apparatus for rendering game image
US11928305B2 (en) Techniques to modify content and view content on mobile devices
US8614708B2 (en) System and method for scalable rendering of diffusion curves
US9607408B2 (en) Rendering semi-transparent user interface elements
CN111583379B (en) Virtual model rendering method and device, storage medium and electronic equipment
US7688317B2 (en) Texture mapping 2-D text properties to 3-D text
CN109688346A (en) A kind of hangover special efficacy rendering method, device, equipment and storage medium
US20140002487A1 (en) Animated visualization of alpha channel transparency
CN111402385B (en) Model processing method and device, electronic equipment and storage medium
US20230326174A1 (en) Image processing method and apparatus, computer device and computer program product
CN113240783B (en) Stylized rendering method and device, readable storage medium and electronic equipment
CN112083865B (en) Image generation method and device, terminal and readable storage medium
CN109598672B (en) Map road rendering method and device
CN106648623B (en) Display method and device for characters in android system
CN114581594A (en) Rendering method, device, equipment and medium for sub-surface scattering effect
CN114758046B (en) Image processing method, device, electronic equipment and storage medium
CN114820878B (en) Image editing method and device
CN111462007B (en) Image processing method, device, equipment and computer storage medium
US11989807B2 (en) Rendering scalable raster content
CN109189537A (en) The dynamic display method of page info calculates equipment and computer storage medium
CN112579083B (en) Image display method, device, electronic equipment and storage medium
CN110992438B (en) Picture editing 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
GR01 Patent grant
GR01 Patent grant