Specific embodiment
Below in conjunction with the attached drawing in this specification embodiment, the technical solution in this specification embodiment is carried out clear
Chu is fully described by, it is clear that described embodiment is only this specification a part of the embodiment, rather than whole implementation
Example.The embodiment of base in this manual, those of ordinary skill in the art are obtained without creative efforts
Every other embodiment, all should belong to this specification protection range.
Please refer to Fig. 1, Fig. 2, Fig. 3, Fig. 4 and Fig. 5.This specification embodiment provides a kind of image generating method.The figure
As generation method is using terminal device as executing subject.The terminal device can be movable equipment, such as smart phone, plate
Electronic equipment, portable computer, personal digital assistant (PDA), mobile unit, POS machine or intelligent wearable device etc..Alternatively,
The terminal device can also be desk device, such as television set, server, industrial personal computer (industrial control computer), personal meter
Calculation machine (PC machine), all-in-one machine or intelligent self-service terminal (kiosk) etc..The image generating method of the present embodiment may include following
Step.
Step S10: multiple images that user chooses are obtained.
In the present embodiment, the storage format of described image includes but is not limited to bitmap format (BMP), joint photo expert
Group format (JPEG) and label image file format (TIFF) etc..The color space of described image includes but is not limited to YUV color
Space, YCbCr color space, rgb color space and HSL color space etc..The size of multiple images can whole phases
Together, can also part it is identical, can also be all different.
The terminal device can provide image and choose interface.Multiple images can be shown by choosing interface in described image
Image identification.Image identification can be used for identifying image, such as may include the title etc. of image.The terminal device can be adopted
Collection chooses instruction for the image of multiple images mark;It is corresponding that available described image chooses the image identification that instruction is directed toward
Image.Wherein, the terminal device can show the image identification of multiple images by a window, alternatively, can also pass through
Multiple windows show the image identification of multiple images.Described image, which chooses instruction, can be the triggered generation of user's operation.Example
Such as, the terminal device can be pressed, long-pressing (pressing for more than the predetermined time), click detecting image identification, double-clicking or
It streaks, and then generates image and choose instruction.
Certainly, other image informations can also be shown by choosing interface in described image.The terminal device can also acquire
Instruction is chosen for the image of a number of other image informations;Available described image chooses other image informations that instruction is directed toward
Corresponding image.For example, the thumbnail of image can also be shown by choosing interface in described image.Thumbnail can be used for reducing aobvious
The picture material of diagram picture.
Step S12: the first painting canvas of creation.
In the present embodiment, first painting canvas can be used for carrying the picture material of multiple images.Described first
The height of painting canvas can be greater than or equal to the sum of the height of multiple images;The width of the first image can be greater than or wait
The maximum in the width of multiple images.
The terminal device can directly create the first painting canvas after multiple images for getting user's selection.Alternatively,
The terminal device can also be after multiple images for getting user's selection;It acquires image and merges instruction;Can be created
One painting canvas.Described image, which merges instruction, can be the triggered generation of user's operation.For example, the terminal device can detect
It to any combination of one or more keys, is pressed, long-pressing, clicks, double-click or streak, and then generate image and merge instruction.
The key can be virtual key or physical button etc..As a further example, the terminal device can also recognize preset hand
Gesture, and then generate image and merge instruction.The preset gesture can be for example sliding to the left or sliding etc. to the right.
The terminal device can create the first painting canvas according to the first presetting rule.First presetting rule can be with are as follows:
Using SumT as the height of the first painting canvas;Using MaxW as the width of the first painting canvas.SumT can be the height of multiple images
The sum of degree;MaxW can be the maximum in the width of multiple images.Alternatively, first presetting rule can be with are as follows:
Using SumT+ (N-1) × G as the height of the first painting canvas;Using MaxW as the width of the first painting canvas.N can be multiple described figures
The quantity of picture;G can be longitudinal image gaps.Certainly, first presetting rule can also be other contents, herein not
It repeats again.
Step S14: the picture material of at least one image is plotted in first painting canvas.
In the present embodiment, the picture material of at least one image can be plotted in described by the terminal device one by one
In one painting canvas.During drafting, for image to be drawn, the terminal device can determine the image described first
The corresponding drawing area of painting canvas;The picture material of the image can be plotted in the drawing area.The drawing area
Height can be greater than or equal to the height of the image.The width of the drawing area can be greater than or equal to the width of the image.
The terminal device can determine the image in the corresponding Drawing zone of first painting canvas according to the second presetting rule
Domain.Second presetting rule can be associated with first presetting rule.For example, first presetting rule can be with are as follows:
Using SumT as the height of the first painting canvas;Using MaxW as the width of the first painting canvas.Correspondingly, second presetting rule can be with
Are as follows: using longitudinal upper distance the first painting canvas coboundary for SumY position as the coboundary of drawing area;With longitudinal upper distance the
One painting canvas coboundary is SumY+HiLower boundary of the position as drawing area;It is with laterally upper the first painting canvas of distance left marginLeft margin of the position as drawing area;It is with laterally upper the first painting canvas of distance left marginRight margin of the position as drawing area.SumY can be drawn image in multiple images for described in
The sum of height;HiIt can be the height of the image;WiIt can be the width of the image.Certainly, second presetting rule may be used also
Think other contents.For example, second presetting rule can be with are as follows: with longitudinal upper the first painting canvas of distance coboundary be SumY's
Coboundary of the position as drawing area;It is SumY+H with longitudinal upper the first painting canvas of distance coboundaryiPosition as Drawing zone
The lower boundary in domain;Using the first painting canvas left margin as the left margin of drawing area;It is with laterally upper the first painting canvas of distance left margin
WiRight margin of the position as drawing area.Certainly it will be appreciated by those skilled in the art that above the first presetting rule and
Second presetting rule is merely illustrative.In the actual process, first presetting rule and second presetting rule can also divide
It Wei not other contents.
Each pixel of the image can be corresponding with a pixel in the drawing area.The terminal device can be with
Attribute value by the attribute value of each pixel of the image, as corresponding pixel points in drawing area;To realize the figure
The picture material of picture is plotted in drawing area.Wherein, the attribute value of pixel can be used to indicate that the color of pixel.According to
The attribute value of the difference of the color space of the image, pixel can also be different.For example, the color space in the image is RGB
When color space, the attribute value of pixel can be the rgb value of 24 codings.It certainly, is other in the color space of the image
When color space, the attribute value of pixel can also be other encoded radios.
Step S16: target image is generated based on first painting canvas.
In the present embodiment, the target image may include the picture material of multiple images.Multiple described images
Picture material can in the target image longitudinal arrangement.The picture material of multiple images can be in the target figure
It is able to maintain as in complete.
In an embodiment of the present embodiment, the terminal device can be equal by the picture material of multiple images
It is plotted in first painting canvas;And then first painting canvas can be stored as the target image.
In the another embodiment of the present embodiment, it is limited to the capacity of the terminal device memory headroom, the end
End equipment is possible to be plotted in the picture material of multiple images in first painting canvas.In this way, in order to prevent
Memory overflow, during drafting, for image to be drawn, the terminal device can by the data volume of the image with it is interior
The residual capacity for depositing space is compared.
When the data volume of the image is less than or equal to the residual capacity, the terminal device can be by the figure of the image
As content is plotted in first painting canvas.When the data volume of the image is greater than the residual capacity, the terminal device is just
Think that memory is possible to overflow, the first image can be generated based on the picture material drawn in first painting canvas, thus real
Existing releasing memory space.Here required memory headroom when the data volume of image can be understood as reading image to memory.For example,
One having a size of 900 × 600 pixels and color space is the image of rgb color space, and data volume is 900 × 600 × 3=
1620000 bytes, required memory headroom is 1620000 bytes when being read to memory.The first image may include institute
State the picture material that image has been drawn in multiple images.First painting canvas directly can be stored as by the terminal device
One image.The size of the first image can be identical as first painting canvas in this way.Alternatively, only will in view of the terminal device
The picture material of parts of images is plotted in first painting canvas in multiple described images, and first painting canvas may include blank
Region.The terminal device can remove the white space;The first later painting canvas of white space can will be removed to be stored as
First image.The size of the first image can be less than first painting canvas in this way.The terminal device can create second
Painting canvas;The picture material that at least one can be drawn image is plotted in second painting canvas;It can be based on described the
Two painting canvas generate the second image;Target image can be generated based on the first image and second image.Described second draws
Cloth can be used for carrying the picture material for not being drawn image in multiple described images.The height of second painting canvas can be greater than
Or equal to the sum of the height for not being drawn image in multiple described images;The determination process of the second painting canvas height may refer to
The determination process of aforementioned first painting canvas height.For example, the terminal device can be not to be drawn image in multiple described images
Height as the second painting canvas of the sum of height.In addition, the picture material of image is plotted in the second painting canvas by the terminal device
Process, can with process that the picture material of image is plotted in the first painting canvas, it is similar.
Further, the terminal device can draw the picture material for not being drawn image in multiple described images
In second painting canvas;And then second painting canvas can be stored as the second image.Second image may include institute
State the picture material for not being drawn image in multiple images.The terminal device can be by second image and first figure
As merging into target image.Combined mode for example may include splicing etc..
Further, it is limited to the capacity of the terminal device memory headroom, the terminal device is possible to can not be by institute
The picture material for stating not drawn image in multiple images is plotted in second painting canvas.In this way, memory overflows in order to prevent
Out, during drafting, for image to be drawn, the terminal device can also be empty by the data volume of the image and memory
Between residual capacity be compared.When the data volume of the image is less than or equal to the residual capacity, the terminal device can
The picture material of the image to be plotted in second painting canvas.When the data volume of the image is greater than the residual capacity,
The terminal device just thinks that memory is possible to overflow, and the can be generated based on the picture material drawn in second painting canvas
Two images, to realize releasing memory space.The terminal device can create third painting canvas;Can will at least one do not drawn
Imaged picture material is plotted in the third painting canvas;Third image can be generated based on the third painting canvas;It can be with base
Target image is generated in the first image, second image, the third image.It can be seen that in the present embodiment, according to
The data volume of the capacity of memory headroom and multiple images, the terminal device can also create three or three or more and draw
Cloth;The picture material of multiple images can be plotted in respectively in described three or three or more painting canvas;Can respectively by
Described three or three or more painting canvas are stored as image;Target image can be generated based on the image of storage.
In the present embodiment, multiple images that the available user of the terminal device chooses;The first painting canvas can be created,
First painting canvas is used to carry the picture material of multiple images;The picture material of at least one image can be plotted in
In first painting canvas;Target image can be generated based on first painting canvas.The terminal device described in this way can keep scheming
In the case where as content intact, the picture material of multiple images is merged in an image.
Please refer to Fig. 6.This specification embodiment also provides a kind of video generation device.Described image generating means can wrap
It includes with lower unit.
Acquiring unit 20, for obtaining multiple images of user's selection;
Creating unit 22, for creating the first painting canvas;First painting canvas is used to carry in the image of multiple images
Hold;
Drawing unit 24, for the picture material of at least one image to be plotted in first painting canvas;
Generation unit 26, for generating target image based on first painting canvas.
Please refer to Fig. 7.This specification embodiment also provides a kind of terminal device.The terminal device may include memory
And processor.
In the present embodiment, the memory can the memory can be implemented in any suitable manner.For example, institute
Stating memory can be read-only memory, mechanical hard disk, solid state hard disk or USB flash disk etc..The memory can be used for storing calculating
Machine instruction.
In the present embodiment, the processor can be implemented in any suitable manner.For example, processor can take example
Such as microprocessor or processor and storage can by (micro-) processor execute computer readable program code (such as software or
Firmware) computer-readable medium, logic gate, switch, specific integrated circuit (Application Specific
Integrated Circuit, ASIC), programmable logic controller (PLC) and the form etc. for being embedded in microcontroller.The processor
The computer instruction can be executed and perform the steps of multiple images for obtaining user's selection;Create the first painting canvas;Described
One painting canvas is used to carry the picture material of multiple images;The picture material of at least one image is plotted in described first to draw
In cloth;Target image is generated based on first painting canvas.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment it
Between the same or similar part may refer to each other, the highlights of each of the examples are it is different from other embodiments it
Place.For video generation device embodiment and terminal device embodiment, since it is substantially similar to image generation side
Method embodiment, so being described relatively simple, related place illustrates referring to the part of image generating method embodiment.
Further it will be understood that those skilled in the art may not need creativeness after reading this specification file
Labour some or all of expects enumerating this specification embodiment and carries out any combination, these combinations are also in this disclosure
In the range of protection.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip 2.Moreover, nowadays, substitution manually makes IC chip, and this programming is also used instead mostly
" logic compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development
Seemingly, and the source code before compiling also handy specific programming language is write, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed is most generally used at present
Integrated Circuit Hardware Description Language) and Verilog2.Those skilled in the art
It will be apparent to the skilled artisan that only needing method flow slightly programming in logic and being programmed into integrated circuit with above-mentioned several hardware description languages
In, so that it may it is readily available the hardware circuit for realizing the logical method process.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification
It can realize by means of software and necessary general hardware platform.Based on this understanding, the technical solution of this specification
Substantially the part that contributes to existing technology can be embodied in the form of software products in other words, the computer software
Product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes each embodiment of this specification or embodiment
Certain parts described in method.
This specification can be used in numerous general or special purpose computing system environments or configuration.Such as: personal computer,
Server computer, handheld device or portable device, laptop device, multicomputer system, microprocessor-based system,
Set top box, programmable consumer-elcetronics devices, network PC, minicomputer, mainframe computer including any of the above system are set
Standby distributed computing environment etc..
This specification can describe in the general context of computer-executable instructions executed by a computer, such as journey
Sequence module.Generally, program module include routines performing specific tasks or implementing specific abstract data types, programs, objects,
Component, data structure etc..This specification can also be practiced in a distributed computing environment, in these distributed computing environment
In, by executing task by the connected remote processing devices of communication network.In a distributed computing environment, program module
It can be located in the local and remote computer storage media including storage equipment.
Although depicting this specification by embodiment, it will be appreciated by the skilled addressee that there are many become for this specification
Shape and the spirit changed without departing from this specification, it is desirable to which the attached claims include these deformations and change without departing from this
The spirit of specification.