CN106327429B - A kind of picture synthetic method, device and terminal device - Google Patents

A kind of picture synthetic method, device and terminal device Download PDF

Info

Publication number
CN106327429B
CN106327429B CN201610947970.1A CN201610947970A CN106327429B CN 106327429 B CN106327429 B CN 106327429B CN 201610947970 A CN201610947970 A CN 201610947970A CN 106327429 B CN106327429 B CN 106327429B
Authority
CN
China
Prior art keywords
paster
editing area
master map
picture
composite signal
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
CN201610947970.1A
Other languages
Chinese (zh)
Other versions
CN106327429A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610947970.1A priority Critical patent/CN106327429B/en
Publication of CN106327429A publication Critical patent/CN106327429A/en
Application granted granted Critical
Publication of CN106327429B publication Critical patent/CN106327429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4084Scaling of whole images or parts thereof, e.g. expanding or contracting in the transform domain, e.g. fast Fourier transform [FFT] domain scaling

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

A kind of picture synthetic method of offer of the embodiment of the present invention, device and terminal device, this method include:The master map of selection is imported into editing area, and by the addition of the paster of selection on the master map that the editing area is shown;Edit operation is detected, paster described in the first process editing is passed through;By first process according to the display status information of edited paster, the picture composite signal of the editing area is determined, and record the picture composite signal of the editing area;When detecting picture synthetic instruction, the second process is called, obtains the picture composite signal of the editing area according to interprocess communication by second process;Wherein, the first process Installed System Memory corresponding with the second process is mutually not take up;By second process according to the picture composite signal of the editing area, the corresponding master map of the editing area and edited paster are combined to.The embodiment of the present invention can reduce the probability that OOM occurs during picture synthesizes.

Description

A kind of picture synthetic method, device and terminal device
Technical field
The present invention relates to picture Processing Technique fields, are set specifically, being related to a kind of picture synthetic method, device and terminal It is standby.
Background technology
Picture synthesis refers to that the process of one or more pasters is added on master map using a master map as Background;Picture It is relatively extensively that the picture that user is more commonly used handles skill that synthesis is applied under User Defined picture, the scenes such as publication picture Art.
Picture synthesis relates generally to editing process of the paster on master map, is combined to, edited paster and master map Process.Currently, user is mainly the application with image synthesis function by being loaded on terminal device, to realize that picture closes At;The application can provide editing area, and the selected master map of user and paster can import in editing area, and user can be to leading in editing area The paster entered realizes the adjustment of paster position on master map, the change etc. of size into edlin;It, will after the completion of paster editor The paster that editor completes is combined to master map, then picture synthesis can be achieved.
It was found by the inventors of the present invention that the Installed System Memory of terminal device is often limited, paster and paster and master map phase are edited The process of synthesis is often possible to the case where occupying excessive memory occur, and so as to cause OOM, (Out Of Memory, memory overflow Make mistake) generation, the phenomenon that causing application crashes occurs, especially larger in the data volume of master map, the paster number that need to be synthesized It measures under more scene, the probability of happening of OOM is larger.Therefore, how in synthesising picture, the generation of OOM is reduced, becomes this Field technology personnel problem needed to be considered.
Invention content
In view of this, a kind of picture synthetic method of offer of the embodiment of the present invention, device and terminal device, in synthesising picture When, reduce the generation of OOM.
To achieve the above object, the embodiment of the present invention provides the following technical solutions:
A kind of picture synthetic method, including:
The master map of selection is imported into editing area, and by the addition of the paster of selection on the master map that the editing area is shown;
Edit operation is detected, passes through paster described in the first process editing so that edited paster is on the master map Display status information is corresponding to the edit operation;
By first process according to the display status information of edited paster, determine that the picture of the editing area closes At information, and record by first process picture composite signal of the editing area;
When detecting picture synthetic instruction, the second process is called, is obtained according to interprocess communication by second process Take the picture composite signal of the editing area;Wherein, the first process Installed System Memory corresponding with the second process is mutually not take up;
By second process according to the picture composite signal of the editing area, by the corresponding master map of the editing area and Edited paster is combined to.
The embodiment of the present invention also provides a kind of picture synthesizer, including:
Master map import modul, the master map for that will select import editing area;
Paster import modul, the paster for that will select add the master map shown in the editing area;
Editor module passes through paster described in the first process editing so that edited paster exists for detecting edit operation Display status information on the master map is corresponding to the edit operation;
Picture composite signal determining module, for being believed according to the dispaly state of edited paster by first process Breath, determines the picture composite signal of the editing area;
Picture composite signal logging modle, the picture for recording the editing area by first process synthesize letter Breath;
Acquisition module calls the second process for when detecting picture synthetic instruction, by second process according to Interprocess communication obtains the picture composite signal of the editing area;Wherein, the first process Installed System Memory corresponding with the second process Mutually it is not take up;
Synthesis module is used for through second process according to the picture composite signal of the editing area, by the editor The corresponding master map in area and edited paster are combined to.
The embodiment of the present invention also provides a kind of terminal device, including picture synthesizer described above.
Based on the above-mentioned technical proposal, in picture synthetic method provided in an embodiment of the present invention, by the first process to editor The paster on master map that area is shown passes through the picture composite signal of the first process record editing area into edlin;Carrying out figure When piece synthesizes, the embodiment of the present invention obtains first by calling the second process different from the first process, according to interprocess communication The picture composite signal for the editing area that process is recorded, to be synthesized according to the picture of acquired editing area by the second process The corresponding master map of editing area and edited paster are combined to by information, realize the purpose of picture synthesis.Due to the first process with The corresponding Installed System Memory of second process is mutually not take up, and the second process obtains the editor that the first process records according to interprocess communication The picture composite signal in area realizes the synthesis of picture, therefore the embodiment of the present invention carries out the occupied memory of paster editor, with general Master map and paster are combined to occupied memory and do not interfere with each other, i.e. the synthesis of the editor of paster, paster and master map can be by not Same process is realized so that the memory of the second process is able to the synthesis for being exclusively used in carrying out paster and master map, avoids proceeding internal memory Occupied by other unnecessary work, reducing OOM, there is a situation where the phenomenon that reducing application crashes.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is the flow chart of picture synthetic method provided in an embodiment of the present invention;
Fig. 2 is the schematic diagram of edit page;
Fig. 3 is another schematic diagram of edit page;
Signaling process figures of the Fig. 4 between the first process and the second process;
Fig. 5 is another flow chart of picture synthetic method provided in an embodiment of the present invention;
Fig. 6 be the first process carry out paster editor, master map size conversion schematic diagram;
Fig. 7 is the method flow diagram that the second process provided in an embodiment of the present invention synthesizes master map and paster after editor;
Fig. 8 is the schematic diagram of the second process synthesising picture provided in an embodiment of the present invention;
The signalling diagram of Fig. 9 interactions between process provided in an embodiment of the present invention;
Figure 10 is editor's schematic diagram of paster;
Figure 11 is the structure diagram of picture synthesizer provided in an embodiment of the present invention;
Figure 12 is the structure diagram of master map import modul provided in an embodiment of the present invention;
Figure 13 is the structure diagram of picture composite signal determining module provided in an embodiment of the present invention;
Figure 14 is the structure diagram of synthesis module provided in an embodiment of the present invention;
Figure 15 is the hardware block diagram of terminal device provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is the flow chart of picture synthetic method provided in an embodiment of the present invention, and this method can be applied to terminal device, should Terminal device can be mounted with the application (APP) with image synthesis function, picture synthetic method provided in an embodiment of the present invention Mainly realize in this application;
The application can provide picture Composite service, to issue out the picture after synthesis when user issues picture;It should Using can also be user in self-defined picture, picture Composite service is provided;
Referring to Fig.1, this method may include:
Step S100, the master map of selection is imported into editing area, and the addition of the paster of selection is shown in the editing area On master map;
Optionally, user can carry out the selection of master map, and in the master map by the application with image synthesis function On add the paster of selection;The embodiment of the present invention can determine that user selects from the picture databases such as photograph album as Background Master map, and the selected master map of user is imported into editing area;
The embodiment of the present invention can only there are one editing areas, it is possibility to have multiple editing areas;And an editing area can only be led Enter the master map of user selection;
Optionally, editing area can reside in the editing interfaces such as edit page, and an edit page is corresponding with multiple volumes In the case of collecting area, Fig. 2 shows corresponding schematic diagrames;Edit page can have multiple editing areas, and terminal device single screen Only show that an editing area, the switching of edit interval can be realized by the editing area handover operation of user, editing area handover operation It such as horizontally slips, left and right directions key control, can specifically be set according to actual conditions;
The embodiment of the present invention can also create editing area in edit page, as shown in figure 3, edit page can be corresponding with Multiple editing areas, and editing area can be created by the editing area new buttons in edit page;Obviously, the embodiment of the present invention The quick operating mode of other newly-built editing areas can be set;Fig. 3 also shows the button that other in edit page instruct, can Reference;
Under single editing area or more editing area scenes, a certain master map of user's selection imports an editing area of edit page Afterwards, user can select area, selection to need add on the master map of the editing area at least one to put up paper in the paster of edit page, And be added to selected paster on the master map that the editing area is shown, it is compiled to realize that a master map for selecting user imports In the editing area for collecting the page, and by the addition of the paster of selection on the master map of the imported display of the editing area;Paster selects area It can be imported with the paster picture stored in paster database such as Fig. 2,3 corresponding instructions, paster selection area.
Step S110, edit operation is detected, passes through paster described in the first process editing so that edited paster is described Display status information on master map is corresponding to the edit operation;
Optionally, after the paster for selecting user is added on the master map that editing area is shown, user can be to editing area The paster added on master map (can also be to paster all in editing area into edlin to part in editing area into edlin Paster into edlin);In the case that the quantity of editing area is multiple, what user can be one by one compiles each editing area or part The paster added on the master map in volume area is into edlin;
The editor of paster is mainly triggered by the edit operation of user, and is executed by the first process;The operable adjustment of user Position etc. of the size, direction, paster of paster on master map, realizes the input of edit operation;In the editor behaviour for detecting user After work, the first process is to the paster operated by user into edlin so that dispaly state of the edited paster on master map, with The edit operation of user is corresponding;
It being moved to the left on master map as user adjusts paster, then the first process can adjust the paster and be moved to the left accordingly, Realize the editor to the paster;Display status information of the edited paster on master map is edited paster on master map Dispaly state information indicate;
Optionally, the first process can be the host process of system, and the embodiment of the present invention can realize that paster exists by host process Editor on master map, so as to adjust dispaly state (such as direction, size, position) of the paster on master map;Optionally, step S100 can be executed by picture selector and paster selector, and picture selector can select picture from the databases such as photograph album Process, paster selector can be from paster database select paster process, picture selector and paster selector can Can also be the independent process for being not take up host process memory to occupy the memory of host process;
Optionally, when the quantity of editing area is multiple, on the discriminable master map to each editing area of the embodiment of the present invention Paster into edlin, subsequently when master map and paster to be combined to, the corresponding master map of each editing area of synthesis that also can be successively and Paster.
Step S120, the editor is determined according to the display status information of edited paster by first process The picture composite signal in area, and record by first process picture composite signal of the editing area;
Optionally, the embodiment of the present invention can call the first process to determine the picture composite signal of editing area, and in determination When the picture composite signal of editing area, the first process is realized according to the display status information of edited paster;That is this hair Bright embodiment can execute the first process, and the first process can be according to the display status information of edited paster, described in determination The picture composite signal of editing area;
Optionally, picture composite signal is the information for the picture synthesis critical data item for recording editing area, in editing area Master map information, paster information, edited display status information of paster etc.;When the quantity of editing area is multiple, the present invention Embodiment can record the picture composite signal of each editing area one by one;
The picture composite signal of editing area is recorded by the first process, occupies the memory of the first process.
Step S130, when detecting picture synthetic instruction, the second process is called, by second process according to process Between communication obtain the picture composite signal of the editing area;
Second process is setting of the embodiment of the present invention independently of the first process, for by the corresponding master map of editing area and patch The process that paper is combined to;The occupied memory of second process is different from the memory that the first process occupies, i.e. the first process and second The corresponding Installed System Memory of process is mutually not take up;
Optionally, after the completion of the paster editor of editing area, user, which can trigger, carries out the corresponding master map of editing area and paster Synthesis (such as pass through the synthesis button of edit page or other shortcuts triggering), user triggering editing area is corresponding When master map and paster are combined to, picture synthetic instruction will be generated;The embodiment of the present invention, can when detecting the picture synthetic instruction The second process is called, the synthesis of editing area corresponding master map and paster is realized by the second process;
Since the second process is not related to master map selection early period, paster selection and the editing of paster, the second process It needs through interprocess communication, the picture composite signal for the editing area that first process of acquisition is recorded, to by acquired The picture composite signal of editing area determines that editing area synthesizes critical data item for carrying out the picture of picture synthesis, realizes editor The synthesis of the corresponding picture in area and paster after editor;
Optionally, the second process obtains the mode of the picture composite signal of editing area according to interprocess communication, can be the Two processes obtain the picture composite signal for the editing area that the first process is transmitted, can also be the second process according to interprocess communication According to interprocess communication, the picture composite signal of the editing area of the first process record is read.
Step S140, by second process according to the picture composite signal of the editing area, by the editing area pair The master map and edited paster answered are combined to.
Optionally, the corresponding master map of editing area can be the master map shown in editing area, alternatively, the master shown in editing area The artwork of figure.
As can be seen that in picture synthetic method provided in an embodiment of the present invention, editing area is shown by the first process Paster on master map passes through the picture composite signal of the first process record editing area into edlin;When carrying out picture synthesis, The embodiment of the present invention obtains the first process by calling second process different from the first process, according to interprocess communication and is recorded Editing area picture composite signal, to by the second process according to the picture composite signal of acquired editing area, will compile It collects the corresponding master map in area and edited paster is combined to, realize the purpose of picture synthesis.Due to the first process and the second process Corresponding Installed System Memory is mutually not take up, and the second process obtains the picture for the editing area that the first process records according to interprocess communication Composite signal, realizes the synthesis of picture, therefore the embodiment of the present invention carries out the occupied memory of paster editor, and by master map and patch Paper is combined to occupied memory and does not interfere with each other, i.e., the editor of paster, paster are realized from the synthesis of master map by different processes, So that the memory of the second process is able to the synthesis for being exclusively used in carrying out paster and master map, proceeding internal memory is avoided by other unnecessary works Occupied by work, reducing OOM, there is a situation where the phenomenon that reducing application crashes.
Fig. 4 shows the signaling process between the first process and the second process for ease of understanding, can refer to;It can from Fig. 4 Go out, the first process is responsible for paster and is edited on master map and the record of the corresponding picture composite signal of editing area, and the second process is responsible for The synthesis of editing area corresponding master map and edited paster, the occupied memory of the two are not interfere with each other, and avoid proceeding internal memory By other unnecessary occupied situations of work.
Optionally, the first process can be the host process of system, the second process can be independently of host process it is independent into Journey;It should be noted that the present inventor has found during studying the present invention, picture synthesizes the paster being related at present Editor, and, the synthesis of paster and master map is to be executed by host process, and a large amount of core is often run in host process after editor Heart business and User Page, the memory that host process can distribute to the synthesis of paster and master map after paster editor, editor are often Limited, this is resulted in picture building-up process, and OOM, application are also often collapsed frequent occurrence;
And the embodiment of the present invention is by paster editor, the responsible process phase separation of the synthesis institute of paster and master map after editor passes through Setting and mutually independent second process of host process, realize the synthesis of paster and master map after editor, may make paster and master after editor The synthesis of figure exclusively enjoys an occupied memory of process, greatly reduces the probability of OOM generations, reduces application crashes generation Phenomenon.
Optionally, since the master map of selection needs to show in editing area, and selected from the picture databases such as photograph album The size of master map is often mismatched with the size of editing area, therefore the embodiment of the present invention can be to the master that is selected from picture database The artwork of figure after carrying out the size conversion being adapted to editing area, then the master map after size conversion is imported in editing area and is shown; Correspondingly, after paster editor, rear paster after editor can be added in the artwork for the master map that editing area is shown, realize figure Piece synthesizes, to ensure the clarity of synthesising picture;
Optionally, Fig. 5 shows another flow chart of picture synthetic method provided in an embodiment of the present invention, should with reference to Fig. 5 Method may include:
Step S200, master map artwork is selected from picture database;
Optionally, when carrying out picture synthesis, as background when user can select to synthesize from the picture databases such as photograph album The master map of figure, selected master map is the original image of master map without size conversion at this time.
Step S210, according to the size of the editing area, the original size of selected master map artwork is converted, is obtained Master map after to size conversion, wherein the size of the master map after size conversion is corresponding to the size of the editing area;
When to make master map be shown in editing area, it can be adapted with the size of editing area, the embodiment of the present invention can root According to the size of the editing area, size conversion is carried out to selected master map artwork so that the master map after size conversion and editor The size in area is corresponding;
Specifically, after selecting master map artwork from picture database, master map artwork selected by decodable code of the embodiment of the present invention Original size (herein only decode master map artwork size, do not decode the content pixel of master map artwork), if selected master The original size of primitive figure is more than the size of editing area, then can be according to the size of editing area, to the original of selected master map artwork Beginning size, which is compressed, (such as to be taken the width of editing area high compressed wide high as master map, is carried out to which the width to picture artwork is high Compression) so that the size of the master map after size compression is corresponding to the size of editing area;Herein, by selected master map artwork Size compressed, except enabling the master map after size compression to be adapted to display in editing area, additionally it is possible to further decrease The data volume of master map carries out the memory occupied needed for editing to reduce the first process, and the generation for further decreasing OOM is general Rate;
Optionally, if the original size of selected master map artwork is less than the size of editing area, the embodiment of the present invention The size of selected master map artwork can be extended according to the size of editing area so that size and volume after master map extension The size for collecting area is corresponding.
Step S220, the master map after size conversion is imported into the editing area, and the paster of selection is added in the volume It collects on the master map that area is shown;
After the original size to selected master map artwork is converted, it may make the master map after size conversion that can lead Enter and is adapted to display in editing area;Meanwhile at least one paster addition may be selected on the master map that editing area is shown in user.
Step S230, edit operation is detected, passes through paster described in the first process editing so that edited paster is described Display status information on master map is corresponding to the edit operation;
Step S240, the mark of master map in editing area is determined by first process, the mark of paster, the master map The display status information of size conversion ratio and edited paster;The size conversion ratio of the master map is the master map pair The ratio of the original size answered and the size of the editing area;
Optionally, by the first process to paster into after edlin, paster is in master map after the first process can determine editor On display status information, meanwhile, determine the mark of master map in editing area, the mark of paster and the size conversion ratio of master map; Wherein, a master map corresponds to the mark of a master map, and master map is identified as the foundation that master map is distinguished from multiple master maps, based on master The mark of figure can search out corresponding master map from picture database;One paster corresponds to the mark of a paster, is based on paster Mark, corresponding paster can be searched out from paster database;The size conversion ratio expression of master map, master map artwork The ratio of original size and size after conversion, the i.e. ratio of the size of the original size and editing area of master map artwork.
Step S250, by first process according to the mark of master map in the editing area, the mark of paster, the master The size conversion ratio of figure and the display status information of edited paster, generate the picture composite signal of the editing area;
Optionally, the first process can be based in editing area, the edited display status information of paster, the mark of master map, patch The size conversion ratio of the mark of paper and the master map generates the corresponding picture composite signal of the editing area;
If the quantity of editing area is multiple, paster is edited aobvious in each editing area of determination that the first process can be one by one Show the size conversion ratio of status information, the mark of master map, the mark of paster and master map, it is corresponding to obtain each editing area Picture composite signal;
As can be seen that the corresponding picture composite signal of an editing area at least can include following content:After paster editor The mark of display status information (rotation angle, position, the size of such as paster), master map (can position master from picture database Figure), the mark (paster can be positioned from paster database) of paster and the size conversion ratio of master map;Optionally, the mark of paster Knowing can also use the corresponding picture bitmap (bitmap file) of paster to replace.
Step S260, the picture composite signal of the editing area is recorded by first process;
Optionally, if the quantity of editing area is multiple, what the first process can be one by one records the corresponding picture of each editing area Composite signal;
Optionally, the selection of the master map, paster that are imported in editing area can also be realized by the first process, correspondingly, Fig. 6 is shown First process carry out paster editor, master map size conversion optional schematic diagram, can refer to.
Step S270, when detecting picture synthetic instruction, the second process is called, by second process according to process Between communication obtain the picture composite signal of the editing area;Wherein, the first process Installed System Memory corresponding with the second process is not mutually It occupies;
The picture composite signal of editing area acquired in second process includes at least above-mentioned corresponding content.
Step S280, corresponding master is obtained from picture database according to the mark of the master map by second process Primitive figure, and corresponding paster is obtained from paster database according to the mark of the paster;By second process according to Acquired paster is carried out size conversion by the size conversion ratio;By second process according to the dispaly state Information adds the paster after size conversion in acquired master map artwork.
As it can be seen that the second process can directly acquire out master map artwork and paster after the picture composite signal for obtaining editing area, And according to early period master map be import editing area used in size conversion ratio, the paster of acquisition is reverted in master map artwork, And according to corresponding display status information after paster editor, dispaly state of the adjustment paster in master map artwork;
Optionally, if it is assumed that the size conversion ratio (such as size compression ratio) of master map is x, since transformation is in proportion Transformation, relative to master map artwork, size of the paster in master map artwork should be:The original size * x of paster;Further, if It is assumed that the rotation angle that the edited display status information of paster contains paster is r, then pass through Matrix matrix class pair simultaneously After paster carries out r angle rotations, it includes on the painting canvas of master map artwork that the postrotational paster of angle, which is plotted to,.
As it can be seen that the embodiment of the present invention when carrying out paster editor, is to import the master map after size conversion in editing area, and The size of editing area through reasonable settings may make the master map after size conversion significantly to be pressed compared to original master map Contracting reduces EMS memory occupation when the first process editing;
And by second process different from the first process used in paster editor, it is independent into paster after edlin and master The synthesis of figure may make the synthesis of volume rear paster and master map to exclusively enjoy the memory of a process;
Further, the embodiment of the present invention is that paster will be synthesized with master map artwork after editing, rather than will be pasted after editor Paper is synthesized with the master map after size conversion in editing area;Master map is compared master map artwork, is certainly existed after size conversion Situations such as picture distortion is fuzzy, so if paster after editor and the master map after size conversion in editing area are directly closed At then the clarity of synthesising picture may being made poor, or even there is a situation where that distortion is fuzzy;And the embodiment of the present invention passes through Two processes obtain the picture composite signal of the editing area of the first process record, to obtain master map artwork and paster, and based on editor Edited paster is restored and is shown by the display status information of paster afterwards, master map corresponding size conversion ratio in editing area In master map artwork, the synthesis of paster and master map artwork after editor is realized, it is ensured that the quality and clarity of synthesising picture.
Optionally, the picture composite signal for the editing area that the first process is recorded can save in memory;Further, first Process can maintain a queue in memory, pass through the picture composite signal of the queue record editing area;Optionally, editing area Quantity can be at least one, correspondingly, can record the corresponding picture of each editing area in the queue that the first process is maintained Composite signal;
Correspondingly, the second process realizes master map and volume in the picture composite signal for the editing area for obtaining the first process record Collecting the synthesis of rear paster can be:Second process obtains the queue that is maintained of the first process according to interprocess communication, and successively time The corresponding picture composite signal of each editing area that queue is recorded is gone through, to the picture for the editing area that the first process of realization is recorded The acquisition of composite signal;When the second process often traverses the picture composite signal of an editing area, the volume that will can currently traverse It collects the corresponding picture in area and edited paster is synthesized;Synthesis mode can also be straight as shown in Fig. 5 steps S280 The master map after the size conversion that will be shown in editing area is connect to synthesize with edited paster;
Optionally, Fig. 7 shows the method flow diagram of the second process synthesis master map and paster after editor, with reference to Fig. 7, the stream Journey may include:
Step S300, by second process, the queue that first process is maintained is obtained according to interprocess communication;
Step S310, the corresponding picture of each editing area that the queue is recorded is traversed successively by second process to close At information;
Step S320, when second process often traverses the corresponding picture composite signal of an editing area, pass through institute The second process is stated to be combined to the corresponding master map of the editing area traversed and edited paster, until recorded in the queue Each corresponding master map of editing area and edited paster synthesize completion.
Optionally, the corresponding picture composite signal of each editing area can record, the corresponding master map of the editing area Mark, the mark of paster, the edited display status information of size conversion ratio and paster of master map;Second process often traverses When picture composite signal corresponding to an editing area, the master map artwork and paster of traversed editing area can be obtained, to According to the size conversion ratio in the picture synthesis traversed, acquired paster is subjected to size conversion, and size is turned Paster after changing is added according to the display status information in the picture synthesis traversed in acquired master map artwork, real Edited paster is synthesized in present master map artwork;
Optionally, the second process can also be by edited paster, with the master map after the size conversion that is shown in editing area It is combined to.
Optionally, the second process can will be schemed after being combined to the corresponding master map of editing area with paster after editor after synthesis The address of piece passes to the first process, to realize the transferring of composited picture subsequently through the first process, to show.
Optionally, if the quantity of editing area is multiple, the second process is synthesized according to the picture of the editing area traversed successively Information, carry out successively the corresponding master map of each editing area with after editor when the synthesis of paster, the editing area that can first have been synthesized upper one Corresponding master map and the occupied memory of paster are recycled, then to the corresponding master map of next editing area and edited paster It is synthesized;
Specifically, after having synthesized the corresponding master map of an editing area and edited paster by the second process, by Two processes synthesize the corresponding master map of the editing area and the occupied memory of edited paster is recycled, after recycling memory The second process synthesize the corresponding master map of next editing area and edited paster.
The flow in conjunction with shown in Fig. 7, Fig. 8 show the schematic diagram of the second process synthesising picture, can refer to.
Optionally, the interprocess communication between the first process and the second process can be realized by AIDL interfaces;AIDL is The abbreviation of Android Interface Definition Language, it is a kind of android inter process communications interface Description language can define the communication interface between process by its embodiment of the present invention.
Optionally, host process can maintain thread pool, and the thread in the thread pool occupies the memory of host process, and the present invention is real The editor of master map and paster can be carried out by the thread in thread pool in edit page by applying example;And in the second process initiation, line Picture composite signal can be transferred to the second process by the thread in Cheng Chi by AIDL interfaces, by the second process according to the original of master map Scheme bitmap and create painting canvas, and by the way that edited paster to be plotted on painting canvas, realizes the synthesis of paster and master map artwork;Phase It answers, Fig. 9 shows corresponding signalling diagram, can refer to.
Optionally, LargeHeap (increase memory techniques) also can be used in the embodiment of the present invention, promotes the first process, and/ Or, the occupied memory of the second process, to be the more workable memories of picture synthesis distribution;Specifically, the present invention is real It is true to apply example largeHeap is arranged in AndroidManifest files so that a process and/or the second course allocation arrive More memories.
It should be noted that paster can be expression picture, bubble (it is a kind of be used for indicating human dialog input word Special paster), (system provides different fonts for user's selection to input word to font, belongs to a kind of patch of specific type Paper) etc.;
User can set the paster region that the rectangular area in Figure 10 is added as user when carrying out paster editor;Rectangle Left upper apex has " deletion " button, and paster can be deleted by clicking the button;Rectangle bottom right vertex has the Warp button, user singly to refer to Being done when pinning the button clockwise or counterclockwise can press paster equidirectional rotation;When user singly refers to button the Warp button Into paster center, paster can be pressed displacement distance scale smaller by movement;User singly refers to when pinning the Warp button along paster center Being displaced outwardly can be by paster by displacement distance ratio enlargement;When user singly refers to paster and the mobile finger pinned in blue rectangle, Paster will follow finger shift position to move;User's two fingers by paster and simultaneously move inward finger can be by paster by movement Scale smaller;Two fingers by paster and being displaced outwardly finger and can amplify paster by moving ratio simultaneously;Obviously, above-mentioned patch Paper edit operation is only optional, and specific edit operation can be set according to actual conditions.
The embodiment of the present invention realizes the editor of paster, paster from the synthesis of master map by different processes so that paster The memory that a process can be exclusively enjoyed with the synthesis of master map avoids proceeding internal memory occupied by other unnecessary work, reduces There is a situation where the phenomenon that reducing application crashes by OOM.Further, by restoring edited paster in master map artwork On, and synthesized, it is ensured that the clarity and quality of the picture after synthesis.
Picture synthesizer provided in an embodiment of the present invention is introduced below, picture synthesizer described below can Reference is corresponded with above-described picture legal manner.
Figure 11 is the structure diagram of picture synthesizer provided in an embodiment of the present invention, which can apply In terminal device, specifically following picture synthesis dresses can be realized in the application with image synthesis function that terminal device loads The functional module framework set;
Referring to Fig.1 1, which may include:
Master map import modul 100, the master map for that will select import editing area;
Paster import modul 200, the paster for that will select add the master map shown in the editing area;
Editor module 300 passes through paster described in the first process editing so that edited patch for detecting edit operation Display status information of the paper on the master map is corresponding to the edit operation;
Picture composite signal determining module 400 is used for through first process according to the display shape of edited paster State information determines the picture composite signal of the editing area;
Picture composite signal logging modle 500, the picture for recording the editing area by first process synthesize Information;
Acquisition module 600, for when detecting picture synthetic instruction, calling the second process, passing through second process The picture composite signal of the editing area is obtained according to interprocess communication;Wherein, the first process system corresponding with the second process Memory is mutually not take up;
Synthesis module 700 is used for through second process according to the picture composite signal of the editing area, by the volume It collects the corresponding master map in area and edited paster is combined to.
Optionally, Figure 12 shows the alternative construction of master map import modul 100, referring to Fig.1 2, master map import modul 100 can To include:
Artwork selecting unit 110, for selecting master map artwork from picture database;
Size conversion unit 120, for the size according to the editing area, to the original size of selected master map artwork It is converted, obtains the master map after size conversion, wherein the size phase of the size of the master map after size conversion and the editing area It answers;
Execution unit 130 is imported, for the master map after size conversion to be imported the editing area.
Optionally, Figure 13 shows the alternative construction of picture composite signal determining module 400, referring to Fig.1 3, picture synthesis Information determination module 400 may include:
Data item determination unit 410, the mark for determining master map in editing area by first process, the mark of paster Know, the size conversion ratio of the master map and the display status information of edited paster;The size conversion ratio of the master map For the ratio of the size of the corresponding original size of master map and the editing area;
Generation unit 420 is used for through first process according to the mark of master map in the editing area, the mark of paster Know, the size conversion ratio of the master map and the display status information of edited paster, the picture for generating the editing area closes At information.
Optionally, after the picture composite signal for obtaining editing area, editor can be accomplished in the following manner in synthesis module 700 The synthesis of area corresponding master map and edited paster;Correspondingly, Figure 14 shows the alternative construction of synthesis module 700, reference Figure 14, synthesis module 700 may include:
Artwork and paster acquiring unit 710 are corresponding for being obtained according to the mark of the master map by second process Master map artwork, and corresponding paster is obtained according to the mark of the paster;
Paster size conversion unit 720 is used for through second process according to the size conversion ratio, will be acquired Paster carry out size conversion;
Paster adding device 730 is used for through second process according to the display status information, after size conversion Paster add in acquired master map artwork.
Optionally, the quantity of the corresponding editing area of edit page can be at least one, and an editing area is corresponded to and imported One selected master map;
Correspondingly, picture composite signal logging modle 500 is particularly used in, recorded in the queue that the first process is maintained The picture composite signal of the editing area, the queue record have the corresponding picture composite signal of each editing area;
Acquisition module 600 is particularly used in, and by second process, first process is obtained according to interprocess communication The queue maintained;By second process, the corresponding picture synthesis of each editing area that the queue is recorded is traversed successively Information.
Optionally, synthesis module 700 can often traverse the corresponding picture synthesis letter of an editing area in second process When breath, the corresponding master map of the editing area traversed and edited paster are combined to by second process, until described The corresponding master map of each editing area recorded in queue and edited paster synthesize completion.
Optionally, picture synthesizer provided in an embodiment of the present invention can be additionally used in, and one is being synthesized by the second process After a corresponding master map of editing area and edited paster, the second process is synthesized into the corresponding master map of the editing area and edited The occupied memory of paster is recycled, by recycle the second process after memory synthesize the corresponding master map of next editing area and Edited paster.
Optionally, picture synthesizer provided in an embodiment of the present invention can be additionally used in, using LargeHeap, described in promotion First process and/or the occupied memory of the second process.
The embodiment of the present invention also provides a kind of terminal device, which may include that picture synthesis described above fills It sets.
Optionally, Figure 15 shows the hardware block diagram of terminal device, referring to Fig.1 5, which may include: Processor 1, communication interface 2, memory 3 and communication bus 4;
Wherein processor 1, communication interface 2, memory 3 complete mutual communication by communication bus 4;
Optionally, communication interface 2 can be the interface of communication module, such as the interface of gsm module;
Processor 1, for executing program;
Memory 3, for storing program;
Program may include program code, and said program code includes computer-managed instruction.
Processor 1 may be a central processor CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit), or be arranged to implement the integrated electricity of one or more of the embodiment of the present invention Road.
Memory 3 may include high-speed RAM memory, it is also possible to further include nonvolatile memory (non-volatile Memory), a for example, at least magnetic disk storage.
Wherein, program can be specifically used for:
The master map of selection is imported into editing area, and by the addition of the paster of selection on the master map that the editing area is shown;
Edit operation is detected, passes through paster described in the first process editing so that edited paster is on the master map Display status information is corresponding to the edit operation;
By first process according to the display status information of edited paster, determine that the picture of the editing area closes At information, and record by first process picture composite signal of the editing area;
When detecting picture synthetic instruction, the second process is called, is obtained according to interprocess communication by second process Take the picture composite signal of the editing area;Wherein, the first process Installed System Memory corresponding with the second process is mutually not take up;
By second process according to the picture composite signal of the editing area, by the corresponding master map of the editing area and Edited paster is combined to.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with other The difference of embodiment, just to refer each other for identical similar portion between each embodiment.For device disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so description is fairly simple, related place is said referring to method part It is bright.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, depends on the specific application and design constraint of technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest range caused.

Claims (12)

1. a kind of picture synthetic method, which is characterized in that be applied to the application with image synthesis function, the picture synthesis side Method includes:
The master map of selection is imported into editing area, and by the addition of the paster of selection on the master map that the editing area is shown;
Edit operation is detected, passes through paster described in the first process editing so that display of the edited paster on the master map Status information is corresponding to the edit operation;
By first process according to the display status information of edited paster, the picture synthesis letter of the editing area is determined It ceases, and records the picture composite signal of the editing area by first process;
When detecting picture synthetic instruction, the second process is called, institute is obtained according to interprocess communication by second process State the picture composite signal of editing area;Wherein, the first process is the host process of system, and the second process is independently of the first process, the One process Installed System Memory corresponding with the second process is mutually not take up;
By second process according to the picture composite signal of the editing area, by the corresponding master map of the editing area and editor Paster afterwards is combined to;
Wherein, described to include by the master map importing editing area of selection:
Master map artwork is selected from picture database;
According to the size of the editing area, the original size of selected master map artwork is converted, after obtaining size conversion Master map, wherein the size of the master map after size conversion is corresponding to the size of the editing area;
Master map after size conversion is imported into the editing area.
2. picture synthetic method according to claim 1, which is characterized in that it is described by first process according to editor The display status information of paster afterwards determines that the picture composite signal of the editing area includes:
Determine the mark of master map in editing area by first process, the mark of paster, the size conversion ratio of the master map, And the display status information of edited paster;The size conversion ratio of the master map is, the corresponding original size of the master map With the ratio of the size of the editing area;
By first process according to the mark of master map in the editing area, the mark of paster, the size conversion of the master map The display status information of ratio and edited paster generates the picture composite signal of the editing area.
3. picture synthetic method according to claim 2, which is characterized in that it is described by second process according to The picture composite signal of editing area, by the corresponding master map of the editing area and edited paster be combined to including:
Corresponding master map artwork, and the mark according to the paster are obtained according to the mark of the master map by second process Obtain corresponding paster;
By second process according to the size conversion ratio, acquired paster is subjected to size conversion;
By second process according to the display status information, the paster after size conversion is added in acquired master map In artwork.
4. picture synthetic method according to claim 1, which is characterized in that the quantity of editing area be it is at least one, and one A editing area, which corresponds to, imports a selected master map;
The picture composite signal that the editing area is recorded by first process includes:
The picture composite signal of the editing area is recorded in the queue that the first process is maintained, the queue record has each volume Collect the corresponding picture composite signal in area.
5. picture synthetic method according to claim 4, which is characterized in that it is described by second process according to process Between communication obtain the picture composite signal of the editing area and include:
By second process, the queue that first process is maintained is obtained according to interprocess communication;
By second process, the corresponding picture composite signal of each editing area that the queue is recorded is traversed successively.
6. picture synthetic method according to claim 5, which is characterized in that it is described by second process according to The picture composite signal of editing area, by the corresponding master map of the editing area and edited paster be combined to including:
When second process often traverses the corresponding picture composite signal of an editing area, by second process by institute The corresponding master map of editing area of traversal and edited paster are combined to, until each editing area recorded in the queue is corresponding Master map and edited paster synthesize completion.
7. picture synthetic method according to claim 6, which is characterized in that the method further includes:
It, should by the synthesis of the second process after having synthesized the corresponding master map of an editing area and edited paster by the second process The corresponding master map of editing area and the occupied memory of edited paster are recycled, and are closed by the second process after recycling memory At the corresponding master map of next editing area and edited paster.
8. picture synthetic method according to claim 1, which is characterized in that the method further includes:
Using memory techniques LargeHeap is increased, first process and/or the occupied memory of the second process are promoted.
9. a kind of picture synthesizer, which is characterized in that be applied to the application with image synthesis function, the picture synthesis dress Set including:
Master map import modul, the master map for that will select import editing area;
Paster import modul, the paster for that will select add the master map shown in the editing area;
Editor module passes through paster described in the first process editing so that edited paster is described for detecting edit operation Display status information on master map is corresponding to the edit operation;
Picture composite signal determining module, for by first process according to the display status information of edited paster, Determine the picture composite signal of the editing area;
Picture composite signal logging modle, the picture composite signal for recording the editing area by first process;
Acquisition module, for when detecting picture synthetic instruction, the second process being called, by second process according to process Between communication obtain the picture composite signal of the editing area;Wherein, the first process be system host process, the second process independently of First process, the first process Installed System Memory corresponding with the second process are mutually not take up;
Synthesis module is used for through second process according to the picture composite signal of the editing area, by the editing area pair The master map and edited paster answered are combined to;
Wherein, the master map import modul includes:
Artwork selecting unit, for selecting master map artwork from picture database;
Size conversion unit turns the original size of selected master map artwork for the size according to the editing area It changes, obtains the master map after size conversion, wherein the size of the master map after size conversion is corresponding to the size of the editing area;
Execution unit is imported, for the master map after size conversion to be imported the editing area.
10. picture synthesizer according to claim 9, which is characterized in that
The picture composite signal determining module includes:
Data item determination unit, the mark for determining master map in editing area by first process, the mark of paster are described The size conversion ratio of master map and the display status information of edited paster;The size conversion ratio of the master map is, described The ratio of the corresponding original size of master map and the size of the editing area;
Generation unit is used for through first process according to the mark of master map in the editing area, the mark of paster, the master The size conversion ratio of figure and the display status information of edited paster, generate the picture composite signal of the editing area.
11. picture synthesizer according to claim 10, which is characterized in that the synthesis module includes:
Artwork and paster acquiring unit, it is former for obtaining corresponding master map according to the mark of the master map by second process Figure, and corresponding paster is obtained according to the mark of the paster;
Paster size conversion unit is used for through second process according to the size conversion ratio, by acquired paster Carry out size conversion;
Paster adding device is used for through second process according to the display status information, by the paster after size conversion Addition is in acquired master map artwork.
12. a kind of terminal device, which is characterized in that including claim 9-11 any one of them picture synthesizers.
CN201610947970.1A 2016-10-24 2016-10-24 A kind of picture synthetic method, device and terminal device Active CN106327429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610947970.1A CN106327429B (en) 2016-10-24 2016-10-24 A kind of picture synthetic method, device and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610947970.1A CN106327429B (en) 2016-10-24 2016-10-24 A kind of picture synthetic method, device and terminal device

Publications (2)

Publication Number Publication Date
CN106327429A CN106327429A (en) 2017-01-11
CN106327429B true CN106327429B (en) 2018-09-07

Family

ID=57819445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610947970.1A Active CN106327429B (en) 2016-10-24 2016-10-24 A kind of picture synthetic method, device and terminal device

Country Status (1)

Country Link
CN (1) CN106327429B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109587390B (en) * 2017-09-29 2021-05-07 腾讯科技(深圳)有限公司 Picture rendering method, picture rendering device and storage medium
CN108055483A (en) * 2017-11-30 2018-05-18 努比亚技术有限公司 A kind of picture synthesis method, mobile terminal and computer readable storage medium
CN108614657B (en) * 2018-04-20 2021-02-19 惠州学院 Image synthesis method, device and equipment and image carrier thereof
CN110428365B (en) * 2019-07-25 2022-10-25 贵阳朗玛信息技术股份有限公司 Cloud-based code printing method and device
CN111176531A (en) * 2020-01-03 2020-05-19 京东方科技集团股份有限公司 Electronic device, interaction method thereof and computer-readable storage medium
CN115049544A (en) * 2021-03-09 2022-09-13 上海擎感智能科技有限公司 Picture processing method and device and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104658019A (en) * 2015-03-17 2015-05-27 北京千鱼教育科技服务有限公司 Manufacturing method of multimedia file
CN105700930A (en) * 2016-02-22 2016-06-22 青岛海信移动通信技术股份有限公司 Application accelerating method and device for embedded operation system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103123718B (en) * 2011-11-21 2016-06-22 腾讯科技(深圳)有限公司 A kind of image processing method and system
CN104240175A (en) * 2013-06-08 2014-12-24 阿里巴巴集团控股有限公司 Image editing and rendering method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104658019A (en) * 2015-03-17 2015-05-27 北京千鱼教育科技服务有限公司 Manufacturing method of multimedia file
CN105700930A (en) * 2016-02-22 2016-06-22 青岛海信移动通信技术股份有限公司 Application accelerating method and device for embedded operation system

Also Published As

Publication number Publication date
CN106327429A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
CN106327429B (en) A kind of picture synthetic method, device and terminal device
TWI291627B (en) Method, system for providing visual and scene graph interface in a computing environment and computer-readable medium for recording the associated instructions
WO2017202383A1 (en) Animation generation method, terminal, and storage medium
US8026910B2 (en) Offline optimization pipeline for 3D content in embedded devices
US7714864B2 (en) Visual resource profiler for graphical applications
US20120229501A1 (en) Method and a Computer System for Displaying and Selecting Images
US9460537B2 (en) Information processing apparatus, information processing method, and storage medium
CN106406794A (en) Screen adapting method and device
RO123609B1 (en) System for processing graphical information and other video information to be displayed by computer systems
KR20130043592A (en) System for controlling treemap and method thereof
CN110018759A (en) Interface display method, device, terminal and storage medium
JP4093053B2 (en) Image area specification and image correction
CN109032600A (en) Application interface update method, device, storage medium and electronic equipment
CN114549708A (en) Game object editing method and device and electronic equipment
CN113750519A (en) Scene terrain editing method and device, electronic terminal and machine-readable storage medium
JP4361950B2 (en) How to synthesize a dynamic virtual image
JP5803302B2 (en) Information processing apparatus, information processing method, and program
JP2000149046A (en) Cure generation device and method, recording medium storing program and corresponding point setting method
CN109656638A (en) A kind of user based on Purley platform customizes the implementation method of function
US20220206676A1 (en) Modifying drawing characteristics of digital raster images utilizing stroke properties
CN114548056A (en) Rich text editing method, device and equipment
JP6642964B2 (en) Information processing apparatus, information processing method, and program
JP2007241575A (en) Information processor and reproduction file determination method
CN110533742B (en) Image color filling method, device, equipment and storage medium
JP2002342696A (en) Device/method for creating business form, program and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant