WO2021190335A1 - 拼图的生成方法、设备及存储介质 - Google Patents

拼图的生成方法、设备及存储介质 Download PDF

Info

Publication number
WO2021190335A1
WO2021190335A1 PCT/CN2021/080759 CN2021080759W WO2021190335A1 WO 2021190335 A1 WO2021190335 A1 WO 2021190335A1 CN 2021080759 W CN2021080759 W CN 2021080759W WO 2021190335 A1 WO2021190335 A1 WO 2021190335A1
Authority
WO
WIPO (PCT)
Prior art keywords
puzzle
unit
value
picture
width
Prior art date
Application number
PCT/CN2021/080759
Other languages
English (en)
French (fr)
Inventor
姜苏珈
Original Assignee
京东方科技集团股份有限公司
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 京东方科技集团股份有限公司 filed Critical 京东方科技集团股份有限公司
Publication of WO2021190335A1 publication Critical patent/WO2021190335A1/zh

Links

Images

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/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing

Definitions

  • the present disclosure relates to the field of image processing technology, and in particular to a method, equipment and storage medium for generating puzzles.
  • the present disclosure provides a method for generating a puzzle, including: acquiring at least two initial images used to form a puzzle; acquiring size information of a puzzle template according to the at least two initial images; acquiring layout according to the size information of the puzzle template Data and canvas data; according to the at least two initial images, the size information, the canvas data, and the layout data, a unit sub-picture is generated, and the unit sub-picture is adapted to each of the puzzle templates
  • the first puzzle is obtained; when the first editing operation based on the frame of the first puzzle is detected, the second is determined according to the minimum side length of the unit sub-picture and the width of the frame of the puzzle template.
  • the width value of the frame of a puzzle is determined according to the width value of the frame of the first puzzle to determine the first layout information of the unit sub-picture; adjusted according to the width value of the frame of the first puzzle and the first layout information
  • the first jigsaw puzzle obtains the second jigsaw puzzle.
  • the method further includes: after obtaining the first puzzle, acquiring second layout information of the unit sub-picture; according to the minimum side length of the unit sub-picture and the width of the frame of the puzzle template
  • the value determines the width value of the frame of the first puzzle
  • the first layout information of the unit sub-picture is determined according to the frame value of the first puzzle, including: according to the minimum side length of the unit sub-picture and the puzzle
  • the canvas frame width value of the template determines the maximum frame width value of the first puzzle; the frame width value of the first puzzle is determined according to the maximum frame width value; the canvas layout size of the first puzzle is subtracted from all According to the width value of the frame of the first puzzle, the converted canvas size is obtained; the size information of the unit sub-picture is determined according to the converted canvas size and the second layout information; according to the width value of the frame of the first puzzle and the The size information of the unit sub-picture determines the first layout information.
  • the first layout information of the unit submap includes: the minimum coordinate value of the unit submap on the X axis is MinX+border/2, and the minimum coordinate value of the unit submap on the Y axis is MinY+border/2, the width of the unit submap is Width-border, and the height of the unit submap is Height-border, where MinX is the minimum coordinate value of the unit submap on the X axis, and MinY is The smallest coordinate value of the unit sub-image on the Y axis, Width is the width of the unit sub-image, Height is the height of the unit sub-image, and border is the width value of the border of the first puzzle.
  • the maximum border width value of the first puzzle is determined according to the minimum side length of the unit sub-picture and the canvas border width value of the puzzle template, including, when the minimum side length is the height of the unit sub-picture Calculate the maximum border width value according to the following formula (1);
  • maxBoder (pHeight*canvasFrame.height–MinHeight)/(1+pHeight) (1);
  • maxBorder (pWidth*canvasFrame.width-MinWidth)/(1+pWidth) (2)
  • maxBoder is the maximum frame width value
  • pHeight is the ratio of the height of the smallest unit sub-image in the first puzzle to the height of the canvas
  • canvasFrame.height is the height of the canvas
  • pWidth is the smallest size in the first puzzle
  • MinHeight is the rated minimum height value
  • MinWidth is the rated minimum width value.
  • the method further includes: when a second editing operation based on the rounding of the unit sub-picture is detected, determining a target rounding value corresponding to the second editing operation; and according to the unit sub-picture The minimum side length determines the maximum rounding value of the unit subgraph; when the target rounding value is not greater than the maximum rounding value, the second editing operation is performed for the unit subgraph, if the When the maximum rounding value is greater than the maximum rounding value, the second editing operation is not responded.
  • the method further includes: after performing the second editing operation for the unit subgraph, re-determining the rated minimum side length of the unit subgraph according to the target fillet value; Recalculate the maximum frame width value of the second puzzle with the minimum side length; reset the second puzzle when the calculated maximum frame width of the second puzzle is less than the actual frame width of the second puzzle Layout information of all the unit sub-maps in.
  • the method further includes: the first layout information and the second layout information include position information of each unit sub-picture, wherein the unit sub-picture includes an upper side, a lower side, a first side, and On the second side, the position information includes the index of the unit subgraph that is on the same line as the upper edge of the unit subgraph, the index of the unit subgraph that is on the same line as the lower edge of the unit subgraph, and The index of the unit subgraph whose first side is on the same straight line of the unit subgraph, and the index of the unit subgraph which is on the same straight line with the second side of the unit subgraph.
  • the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the following when the program is executed:
  • a unit sub-picture is generated, and the unit sub-picture is adapted to each unit of the puzzle template to obtain the first A puzzle
  • the width value of the frame of the first puzzle is determined according to the minimum side length of the unit sub-picture and the width of the frame of the puzzle template, Determining the first layout information of the unit sub-picture according to the width value of the frame of the first puzzle;
  • the first puzzle is adjusted according to the width value of the frame of the first puzzle and the first layout information to obtain the second puzzle.
  • the width value of the frame of the first puzzle is determined according to the minimum side length of the unit sub-picture and the width of the frame of the puzzle template, and the first of the unit sub-picture is determined according to the frame value of the first puzzle.
  • Layout information including:
  • the first layout information is determined according to the width value of the frame of the first puzzle and the size information of the unit sub-picture.
  • the first layout information of the unit sub-picture includes:
  • the minimum coordinate value of the unit subgraph on the X axis is MinX+border/2
  • the minimum coordinate value of the unit subgraph on the Y axis is MinY+border/2
  • the width of the unit subgraph is Width-border
  • the height of the unit subgraph is Height-border
  • MinX is the minimum coordinate value of the unit subgraph on the X axis
  • MinY is the minimum coordinate value of the unit subgraph on the Y axis
  • Width is the minimum coordinate value of the unit subgraph on the Y axis.
  • the width of the unit sub-picture, Height the height of the unit sub-picture, and the border is the width value of the border of the first puzzle.
  • the maximum border width value of the first puzzle is determined according to the minimum side length of the unit sub-picture and the canvas border width value of the puzzle template, including, when the minimum side length is the height of the unit sub-picture Calculate the maximum border width value according to the following formula (1);
  • maxBoder (pHeight*canvasFrame.height–MinHeight)/(1+pHeight) (1);
  • maxBorder (pWidth*canvasFrame.width-MinWidth)/(1+pWidth) (2)
  • maxBoder is the maximum frame width value
  • pHeight is the ratio of the height of the smallest unit sub-image in the first puzzle to the height of the canvas
  • canvasFrame.height is the height of the canvas
  • pWidth is the smallest size in the first puzzle
  • MinHeight is the rated minimum height value
  • MinWidth is the rated minimum width value.
  • the second editing operation is performed for the unit sub-picture, and if the maximum rounded corner value is greater than the maximum rounded corner value, no response will be taken. Describe the second editing operation.
  • determining the maximum rounding value of the unit subgraph according to the minimum side length of the unit subgraph includes calculating the maximum rounding value according to the following formula:
  • maxCorner MinSide/2, where maxCorner is the maximum fillet value, and MinSide is the minimum side length.
  • the first layout information and the second layout information include position information of each unit sub-picture, where the unit sub-picture includes an upper side, a lower side, a first side, and a second side, and the position information includes ,
  • the index of the unit subgraph that is on the same line as the upper edge of the unit subgraph, the index of the unit subgraph that is on the same line as the lower edge of the unit subgraph, and the first side edge of the unit subgraph The index of the unit subgraph that is on the same straight line, and the index of the unit subgraph that is on the same straight line as the second side of the unit subgraph.
  • the first editing operation is an operation of dragging the frame of the first puzzle
  • the second editing operation is an operation of dragging the rounded corners to change the size of the rounded corners
  • the rounded corner value of the rounded corner of the unit sub-picture performs a setting operation to change the size of the rounded corner.
  • the present disclosure also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the generation method described above.
  • Fig. 1 is a flowchart of a method for generating a puzzle according to some embodiments of the present disclosure
  • FIG. 2 is a sequence diagram of a method for generating a puzzle according to some embodiments of the present disclosure
  • FIG. 3 is a block diagram of an electronic device according to some embodiments of the disclosure.
  • Fig. 1 is a flowchart of a method for generating a puzzle according to some embodiments of the present disclosure. As shown in Fig. 1, the method includes:
  • Step 102 Obtain at least two initial images used to form a puzzle
  • the above-mentioned at least two initial images may be a set of initial images input by the user to the puzzle software for performing puzzles, and the set of initial images may be provided to the puzzle software in the form of an image array, for example.
  • Step 104 Obtain size information of the puzzle template according to the at least two initial images
  • the size information of the puzzle template can be obtained from the database according to the size of the image array.
  • the database may store template information corresponding to 2-8 images, for example, the template information may be an array.
  • Step 106 Obtain layout data and canvas data according to the size information of the puzzle template
  • the layout array (an example of the above-mentioned layout data) and the background frame (an example of the above-mentioned canvas data) can be obtained according to the size information of the puzzle template.
  • Step 108 Generate a unit sub-picture according to the at least two initial images, the size information, the canvas data, and the layout data, and adapt the unit sub-picture to each unit of the puzzle template , Get the first puzzle;
  • the layout array an example of the above at least two initial images
  • the layout array an example of the above at least two initial images
  • the background frame a new frame is generated through the comparison calculation, and the generated new frame is adapted to each cell in the puzzle template In, you get the first puzzle.
  • Step 110 When the first editing operation based on the frame of the first puzzle is detected, determine the size of the frame of the first puzzle according to the minimum side length of the unit sub-picture and the width of the frame of the puzzle template. A width value, determining the first layout information of the unit sub-picture according to the width value of the border of the first puzzle;
  • the user can drag the frame of the first puzzle to edit the frame.
  • the first editing operation is, for example, dragging the frame of the first puzzle.
  • the content of the puzzle template is displayed tiled with template ratio information. Therefore, when the user sets the frame, it is necessary to calculate the layout of all sub-unit diagrams in the current puzzle template and the frame value of the template.
  • the minimum side length of the above unit subgraph is the minimum value among the side lengths of all the unit subgraphs in the first puzzle.
  • the maximum border width value maxBorder that can be set for the first puzzle can be determined according to the minimum side length of the unit sub-picture and the width of the border of the puzzle template, and a value smaller than maxBorder can be taken as the border width value of the first puzzle, where, Determine the maximum border width value of the first puzzle according to the minimum side length of the unit sub-picture and the canvas border width value of the puzzle template, which may include, when the minimum side length is the height of the unit sub-picture, according to The following formula (1) calculates the maximum border width value;
  • maxBoder (pHeight*canvasFrame.height–MinHeight)/(1+pHeight) (1);
  • maxBorder (pWidth*canvasFrame.width-MinWidth)/(1+pWidth) (2)
  • maxBoder is the maximum frame width value
  • pHeight is the ratio of the height of the smallest unit sub-image in the first puzzle to the height of the canvas
  • canvasFrame.height is the height of the canvas
  • pWidth is the smallest size in the first puzzle
  • MinHeight is the rated minimum height value
  • MinWidth is the rated minimum width value.
  • Step 112 Adjust the first puzzle according to the width value of the frame of the first puzzle and the first layout information to obtain a second puzzle.
  • the width value of the frame can be modified according to the editing operation based on the first puzzle, and each unit in the puzzle can be dynamically adjusted according to the modified frame width value
  • the layout information of the sub-pictures realizes the purpose of quickly constructing the puzzle and automatically adjusting the puzzle, which improves the efficiency of constructing the puzzle.
  • the method for generating the above-mentioned puzzle may further include:
  • the second layout information of the unit sub-picture is obtained; after the first puzzle is obtained, the second layout information of each unit sub-picture in the puzzle has been determined. After being edited, when re-determining the first layout information of each unit submap, the second layout information is needed. Therefore, after obtaining the first puzzle, the second layout information of each unit submap can be obtained. For example, a copy of Current layout information can be copied through the NSCopy protocol. Based on this, the width value of the frame of the first puzzle is determined according to the minimum side length of the unit sub-picture and the width of the frame of the puzzle template, and the unit sub-picture is determined according to the frame value of the first puzzle
  • the first layout information of can include:
  • the maximum frame width value of the first puzzle is determined according to the minimum side length of the unit sub-picture and the canvas frame width value of the puzzle template.
  • the maximum frame width value can be calculated by the above formula (1).
  • the width value of the border of the first puzzle is determined according to the maximum border width value; for example, the width value border of the border of the first puzzle is set within a range less than the maximum border width value.
  • the sub-picture refers to that in the puzzle template, there is no interval between the unit sub-pictures, and the frame of each unit sub-pic
  • the first layout information of the unit sub-picture is determined, for example, the first layout information of the unit sub-picture may include :
  • the minimum coordinate value of the unit subgraph on the X axis is MinX+border/2
  • the minimum coordinate value of the unit subgraph on the Y axis is MinY+border/2
  • the width of the unit subgraph is Width-border
  • the height of the unit subgraph is Height-border
  • MinX is the minimum coordinate value of the unit subgraph on the X axis
  • MinY is the minimum coordinate value of the unit subgraph on the Y axis
  • Width is the minimum coordinate value of the unit subgraph on the Y axis.
  • the width of the unit sub-picture, Height the height of the unit sub-picture, and the border is the width value of the border of the first puzzle.
  • the configuration of the frame of the puzzle is completed, but because the frame configuration is carried out at the same time as the rounded corners, when the rounded corners exceed 1/2 of the minimum side length of the current unit sub-pictures, the problem of sharp rounded corners will be caused. .
  • the rounded corner value can also be reconfigured. Based on this, the method for generating the above-mentioned puzzle may further include:
  • determining the maximum rounding value of the unit subgraph according to the minimum side length of the unit subgraph may be calculating the maximum rounding value according to the following formula:
  • maxCorner MinSide/2, where maxCorner is the maximum fillet value, and MinSide is the minimum side length.
  • the second editing operation is performed for the unit sub-picture, and if the maximum rounded corner value is greater than the maximum rounded corner value, no response is made Describe the second editing operation.
  • the minimum side length of the unit subgraph is taken into consideration, and the maximum rounded corner value and the maximum border width are determined based on the minimum side length Value, based on the maximum rounded value to limit the target rounded corner value, and based on the maximum border width value to determine the target width of the frame, so that the layout of all unit submaps can be corrected quickly and efficiently, and the frame and rounded corners are guaranteed Uniqueness and unity.
  • the editing operation for the rounded corners can occur in any process of constructing the puzzle.
  • the editing operation for the rounded corners is detected as an exemplary situation, but in the construction Any editing operation of rounded corners detected during the puzzle must meet the above conditions.
  • the calculation of the rounded corners of the frame is only a logical judgment of a single operation when no rounded corners of the frame are operated after the first puzzle is obtained.
  • the border value will be recalculated.
  • the rated minimum side length of each unit subgraph is cornerValue (rounded corner value)*2.
  • the width value of the border is determined based on the rounded corners, and when the original side width box value (refers to When the width of the border before the width of the border is not changed according to the rounded corner value) exceeds the calculated maximum border width, the layout of all sub-pictures in the puzzle is reset and determined.
  • the method for generating the above-mentioned puzzle may further include: after performing the second editing operation for the unit sub-image, determining the value of the unit sub-image according to the target rounding value.
  • autoresizeingMask is a relative layout setting. After enabling autoresizeingMask, the relative layout of the child view and the parent view can be automatically set.
  • the method for generating the above-mentioned puzzle may further include: the first layout information and the second layout information include position information of each unit sub-picture, wherein the unit sub-picture includes the upper edge, the The position information includes the index of the unit subgraph that is on the same line as the upper edge of the unit subgraph, and the index of the unit subgraph that is on the same line as the lower edge of the unit subgraph.
  • the index of the unit subgraph, the index of the unit subgraph that is on the same line as the first side of the unit subgraph, and the index of the unit subgraph that is on the same line as the second side of the unit subgraph .
  • the original layout information of the template view model there are eight variables declared as NSSet. The eight variables are:
  • topSet record the indices of all unit subgraphs whose minY of the current unit subgraph is maxY
  • topSameSet record the indices of all unit subgraphs whose minY of the current unit subgraph is minY
  • leftSet record the leftX of the current unit subgraph Is the index of all unit subgraphs of maxX
  • leftSameSet records the indices of all unit subgraphs whose leftX of the current unit subgraph is minX
  • bottomSet records the indices of all unit subgraphs whose maxY of the current unit subgraph is minY
  • bottomSameSet record the indices of all unit subgraphs whose maxY of the current unit subgraph is maxY
  • rightSet record the indices of all unit subgraphs whose maxX of the current unit subgraph is minX
  • rightSameSet record the maxX of the current unit subgraph It is the index of all unit subgraphs of maxX.
  • minY represents the minimum value of the current unit subgraph on the Y axis
  • maxY represents the maximum value of the current unit subgraph on the Y axis
  • maxX represents the maximum value of the current unit subgraph on the X axis
  • leftX represents the current unit subgraph The minimum value on the X axis.
  • each unit subgraph can support the logic of dragging and exchanging the unit subgraph, after the exchange is completed, the previous animation is deleted, and the current and original positions are exchanged. In this way, the sub-picture of the unit is shifted.
  • Some embodiments of the present disclosure provide a method for generating puzzles based on the MVVM architecture.
  • the MVVM architecture is divided into a Model (model) layer, a ViewModel (view model) layer, a View (view) layer, and a Controller (control) layer.
  • Model layer involves the layout ratio, page logic, and the preservation of the border Model.
  • Controller layer Used to bind the ViewModel and the View, connect the communication between the Controller and the Controller, and the external association between the View and the View.
  • View layer template view, gesture view, and all interfaces involved in each sub-module function.
  • View-Model layer template singleton ViewModel (view model), scale Model, background Model, layout Model, border ViewModel.
  • the control layer may include TemplateVC (template control) and BorderVC (border control
  • the view layer may include TemplateView (template view) and GestureView.
  • the model layer can include: ViewModel (view model) and BorderViewModel (border view model), this method can be implemented by calling a custom class BIPOperationPublicManager (hereinafter referred to as Manager), where the input of Manager is multiple images ,
  • Manager custom class BIPOperationPublicManager
  • the input of Manager is multiple images
  • the output is a puzzle based on the multiple image components, as shown in Figure 2, the method includes:
  • Step 1 Call the Manager and pass in an image array NSArray whose content is UIImage;
  • Step 2 Manager passes the image array NSArray to TemplateVC
  • Step 3 TemplateVC obtains the proportion information of the template from the database according to the size of the image array (an example of the size information of the above puzzle template), initializes the proportion information and the image array, and sends it to TemplateView;
  • Step 4 TemplateView sends the image array, layout array, and canvas array (an example of the above-mentioned painting data) to the ViewModel that uniformly manages all template operations;
  • Step 5 ViewModel initializes the image array, layout array, and canvas array and sends it to GestureView; among them, the ViewModel layer mainly contains the original layout information, and the ViewModel layer compares the image array, layout array, and canvas array based on the above ratio information. Generate a new frame to fit each unit submap, and save it as the original canvas layout array;
  • Step 6 Copy a copy of Current layout information (an example of the above-mentioned second layout information) to ViewModel through the NSCopy protocol;
  • the reserved statement is the BIPTemplateBorderModel border model, which involves the rounded corner value, border value (that is, the border value of the above border) and gradient value, while retaining the template ratio interface, the maximum border value, and the minimum border Value and background image.
  • Step 7 ViewModel sends the current layout information to TemplateView
  • Step 8 TemplateVC binds the ViewModel to the TemplateView, displays the interface, passes the data into the TemplateView, and provides an interface for configuring borders, rounded corners, and gradients;
  • Step 9 Re-match the canvasFrame (canvas information) of the TemplateView every time the view inside the TemplateView appears, recalculate the content in the GestureView through the Current layout information in the ViewModel, and bind all the GestureViews to the TemplateView to obtain the above first puzzle.
  • Step 10 The border-based editing operation is detected, the editing command is obtained, and the editing command is sent to BorderVC;
  • Step 11 BorderVC sends a message to modify the canvas layout to the ViewModel
  • Step 12 ViewModel sends a reset message to TemplateView
  • Step 13 TemplateView performs re-layout calculation: compare the difference between the actual height value of the smallest size GestureView and the rated minimum side, the difference may be greater than 0 and less than 100, and the maximum border width value maxBorder is calculated. After calculation, when the minimum value in gestureView.frame (the side length of the unit subgraph) is height (height), there is the following formula:
  • maxBoder (layoutModel.pHeight*canvasFrame.height–MinHeight)/(1+layoutModel.pHeight);
  • pHeight is the ratio of the height of the current smallest unit sub-image in canvasFrame.height (canvas height), and its value is less than 1.
  • maxBorder (layoutModel.pWidth*canvasFrame.width-MinWidth)/(1+layoutModel.pWidth);
  • pWidth is the ratio of the width of the current smallest unit sub-image to the width of the canvas, and its value is also less than 1.
  • Step 14 In the range less than the maxBorder value, set the border width and border value. First, subtract the border value from the canvasFrame (canvas frame) saved in the ViewModel, and re-output. The new value of canvasFrame is not saved, just as convertFrame (converted frame). ) To facilitate re-layout
  • Step 15 Traverse the current layout array, take out the layoutModel of gestureView, and output the assumed borderless gesuterFrame according to the proportion of the above recalculated convertFrame;
  • Step 16 Put the border width box value in gestureFrame and re-modify it as follows:
  • gestureView.frame CGRectMake(MinX(gestureFrame)+border/2, MinY(gestureFrame)+border/2, Width(gesutreFrame)-border, Height(gestureFrame)-border).
  • Step 17 Modify the border value to boder.
  • Step 19 Save maxCorner to ViewModel. When the rounded corner value exceeds maxCorner, no operation is performed.
  • Step 20 BorderVC detects the operation of modifying the rounded corner value, and sends a message to modify the rounded corner value to BorderViewModel;
  • Step 21 BorderViewModel sets the rounded corner value and calculates the maximum border value.
  • the border width value When entering the borderVC and operating the rounded corners, the border width value will be recalculated. At this time, the minimum rated size of the gestureView is cornerValue*2, and the calculated maximum border width value is also changed. The maximum border width value is determined based on the rounded corners. When the original border value exceeds the maximum border width value, all layouts of the puzzle are reset.
  • the exported UIImage picture is rotated and saved with cgImageCopy (redrawn picture), causing the picture
  • cgImageCopy redrawn picture
  • Some embodiments of the present disclosure also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor executes the program, it implements any of the above-mentioned puzzles.
  • the method of generation is also provided.
  • Some embodiments of the present disclosure also provide a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to cause the computer to execute any of the above-mentioned puzzles. Generation method.
  • the methods in some embodiments of the present disclosure may be executed by a single device, such as a computer or a server.
  • the method in this embodiment can also be applied in a distributed scenario, and multiple devices cooperate with each other to complete.
  • one of the multiple devices can only perform one or more steps in the methods of some embodiments of the present disclosure, and the multiple devices will interact with each other to complete The method described.
  • the apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
  • FIG. 3 shows a more specific schematic diagram of the hardware structure of an electronic device provided by this embodiment.
  • the device may include a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050.
  • the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040 realize the communication connection between each other in the device through the bus 1050.
  • the processor 1010 may be implemented by a general CPU (Central Processing Unit, central processing unit), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for execution related Programs to implement the technical solutions provided by the embodiments of the present disclosure.
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • the memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc.
  • the memory 1020 may store an operating system and other application programs.
  • related program codes are stored in the memory 1020 and called and executed by the processor 1010.
  • the input/output interface 1030 is used to connect an input/output module to realize information input and output.
  • the input/output/module can be configured in the device as a component (not shown in the figure), or can be connected to the device to provide corresponding functions.
  • the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
  • the communication interface 1040 is used to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices.
  • the communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
  • the bus 1050 includes a path to transmit information between various components of the device (for example, the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040).
  • the above device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include the equipment necessary for normal operation. Other components.
  • the above-mentioned device may also include only the components necessary to implement the solutions of some embodiments of the present disclosure, and not necessarily include all the components shown in the figures.
  • the computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • the figures provided may or may not show the well-known power supply associated with integrated circuit (IC) chips and other components. / Ground connection.
  • the devices may be shown in the form of block diagrams in order to avoid making some embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details about the implementation of these block diagram devices are highly dependent on the implementation of some embodiments of the present disclosure. Examples of the platform (that is, these details should be fully within the understanding of those skilled in the art).
  • DRAM dynamic RAM

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

一种拼图的生成方法、设备及存储介质,其中,拼图的生成方法包括:获取用于构成拼图的至少两个初始图像;根据所述至少两个初始图像获取拼图模板的尺寸信息;根据拼图模板的尺寸信息获取布局数据以及画布数据;根据所述至少两个初始图像、所述尺寸信息、所述画布数据以及所布局数据,生成单元子图,并将单元子图适配至拼图模板的每个单元中,得到第一拼图;在检测到基于第一拼图的边框的第一编辑操作时,根据单元子图的最小边长以及拼图模板的边框的宽度值确定第一拼图的边框的宽度值,根据第一拼图的边框的宽度值确定单元子图的第一布局信息;根据第一拼图的边框的宽度值以及第一布局信息调整第一拼图,得到第二拼图。

Description

拼图的生成方法、设备及存储介质
相关申请的交叉引用
本申请主张在2020年3月26日在中国提交的中国专利申请号No.202010225897.3的优先权,其全部内容通过引用包含于此。
技术领域
本公开涉及图像处理技术领域,尤其涉及一种拼图的生成方法、设备及存储介质。
背景技术
随着智能移动终端的发展,人们常用智能移动终端进行拍照以及图像处理,目前,单一图像的处理已经不能满足用户日新月异的新需求。同时处理多张图片,拼成一张图片的各种各样的拼图软件也应运而生。在点击不同拼图模版,进行拼图这种简单的静态化处理也不能满足用户的需求。
发明内容
本公开提供了一种拼图的生成方法,包括:获取用于构成拼图的至少两个初始图像;根据所述至少两个初始图像获取拼图模板的尺寸信息;根据所述拼图模板的尺寸信息获取布局数据以及画布数据;根据所述至少两个初始图像、所述尺寸信息、所述画布数据以及所布局数据,生成单元子图,并将所述单元子图适配至所述拼图模板的每个单元中,得到第一拼图;在检测到基于所述第一拼图的边框的第一编辑操作时,根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框的宽度值确定所述单元子图的第一布局信息;根据所述第一拼图的边框的宽度值以及所述第一布局信息调整所述第一拼图,得到第二拼图。
可选的,所述方法还包括:在得到所述第一拼图之后,获取所述单元子 图的第二布局信息;根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框值确定所述单元子图的第一布局信息,包括:根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值;根据所述最大边框宽度值确定所述第一拼图的边框的宽度值;将所述第一拼图的画布布局尺寸减去所述第一拼图的边框的宽度值,得到转换画布尺寸;根据转换画布尺寸以及所述第二布局信息确定所述单元子图的尺寸信息;根据所述第一拼图的边框的宽度值以及所述单元子图的尺寸信息,确定所述第一布局信息。
可选的,所述单元子图的第一布局信息,包括:所述单元子图在X轴的最小坐标值为MinX+border/2,所述单元子图的在Y轴的最小坐标值为MinY+border/2,所述单元子图的宽度为Width-border,所述单元子图的高度为Height-border,其中,MinX为所述单元子图在X轴上的最小坐标值,MinY为所述单元子图在Y轴上的最小坐标值,Width为所述单元子图的宽度,Height所述单元子图的高度,border为所述第一拼图的边框的宽度值。
可选的,根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值,包括,当所述最小边长为单元子图的高时,根据如下公式(1)计算所述最大边框宽度值;
maxBoder=(pHeight*canvasFrame.height–MinHeight)/(1+pHeight)  (1);
当所述最小边长为单元子图的宽时,根据如下公式(2)计算所述最大边框宽度值;
maxBorder=(pWidth*canvasFrame.width-MinWidth)/(1+pWidth)  (2)
其中,maxBoder为所述最大边框宽度值,pHeight为所述第一拼图中尺寸最小的单元子图的高度占画布高度的比例,canvasFrame.height为画布高度,pWidth为所述第一拼图中尺寸最小的单元子图的宽度,MinHeight为额定最小高度值,MinWidth为额定最小宽度值。
可选的,所述方法还包括:在检测到基于所述单元子图的圆角的第二编辑操作时,确定与所述第二编辑操作对应的目标圆角值;根据所述单元子图的最小边长确定所述单元子图的最大圆角值;当所述目标圆角值不大于所述 最大圆角值时,为所述单元子图执行所述第二编辑操作,若所述最大圆角值大于所述最大圆角值时,不响应所述第二编辑操作。
可选的,根据所述单元子图的最小边长确定所述单元子图的最大圆角值,包括根据如下公式计算所述最大圆角值:maxCorner=MinSide/2,其中,maxCorner为所述最大圆角值,MinSide为所述最小边长。
可选的,所述方法还包括:在为所述单元子图执行所述第二编辑操作之后,根据所述目标圆角值重新确定所述单元子图的额定最小边长;根据所述额定最小边长重新计算所述第二拼图的最大边框宽度值;当计算得到的所述第二拼图的最大边框宽度值小于所述第二拼图的实际边框宽度值时,重置所述第二拼图中的所有单元子图的布局信息。
可选的,所述方法还包括:所述第一布局信息以及所述第二布局信息中包括各单元子图的位置信息,其中,所述单元子图包括上边、下边、第一侧边以及第二侧边,所述位置信息包括,与所述单元子图的上边处于同一直线上的单元子图的索引,与所述单元子图的下边处于同一直线上的单元子图的索引,与所述单元子图的第一侧边处于同一直线上的单元子图的索引,以及与所述单元子图的第二侧边处于同一直线上的单元子图的索引。
本公开还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现:
获取用于构成拼图的至少两个初始图像;
根据所述至少两个初始图像获取拼图模板的尺寸信息;
根据所述拼图模板的尺寸信息获取布局数据以及画布数据;
根据所述至少两个初始图像、所述尺寸信息、所述画布数据以及所布局数据,生成单元子图,并将所述单元子图适配至所述拼图模板的每个单元中,得到第一拼图;
在检测到基于所述第一拼图的边框的第一编辑操作时,根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框的宽度值确定所述单元子图的第一布局信息;
根据所述第一拼图的边框的宽度值以及所述第一布局信息调整所述第一 拼图,得到第二拼图。
可选的,所述处理器执行所述程序时实现:
在得到所述第一拼图之后,获取所述单元子图的第二布局信息;
根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框值确定所述单元子图的第一布局信息,包括:
根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值;
根据所述最大边框宽度值确定所述第一拼图的边框的宽度值;
将所述第一拼图的画布布局尺寸减去所述第一拼图的边框的宽度值,得到转换画布尺寸;
根据转换画布尺寸以及所述第二布局信息确定所述单元子图的尺寸信息;
根据所述第一拼图的边框的宽度值以及所述单元子图的尺寸信息,确定所述第一布局信息。
可选的,所述单元子图的第一布局信息,包括:
所述单元子图在X轴的最小坐标值为MinX+border/2,所述单元子图的在Y轴的最小坐标值为MinY+border/2,所述单元子图的宽度为Width-border,所述单元子图的高度为Height-border,其中,MinX为所述单元子图在X轴上的最小坐标值,MinY为所述单元子图在Y轴上的最小坐标值,Width为所述单元子图的宽度,Height所述单元子图的高度,border为所述第一拼图的边框的宽度值。
可选的,根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值,包括,当所述最小边长为单元子图的高时,根据如下公式(1)计算所述最大边框宽度值;
maxBoder=(pHeight*canvasFrame.height–MinHeight)/(1+pHeight)  (1);
当所述最小边长为单元子图的宽时,根据如下公式(2)计算所述最大边框宽度值;
maxBorder=(pWidth*canvasFrame.width-MinWidth)/(1+pWidth)  (2)
其中,maxBoder为所述最大边框宽度值,pHeight为所述第一拼图中尺寸最 小的单元子图的高度占画布高度的比例,canvasFrame.height为画布高度,pWidth为所述第一拼图中尺寸最小的单元子图的宽度,MinHeight为额定最小高度值,MinWidth为额定最小宽度值。
可选的,所述处理器执行所述程序时实现:
在检测到基于所述单元子图的圆角的第二编辑操作时,确定与所述第二编辑操作对应的目标圆角值;
根据所述单元子图的最小边长确定所述单元子图的最大圆角值;
当所述目标圆角值不大于所述最大圆角值时,为所述单元子图执行所述第二编辑操作,若所述最大圆角值大于所述最大圆角值时,不响应所述第二编辑操作。
可选的,根据所述单元子图的最小边长确定所述单元子图的最大圆角值,包括根据如下公式计算所述最大圆角值:
maxCorner=MinSide/2,其中,maxCorner为所述最大圆角值,MinSide为所述最小边长。
可选的,所述处理器执行所述程序时实现:
在为所述单元子图执行所述第二编辑操作之后,根据所述目标圆角值重新确定所述单元子图的额定最小边长;
根据所述额定最小边长重新计算所述第二拼图的最大边框宽度值;
当计算得到的所述第二拼图的最大边框宽度值小于所述第二拼图的实际边框宽度值时,重置所述第二拼图中的所有单元子图的布局信息。
可选的,所述处理器执行所述程序时实现:
所述第一布局信息以及所述第二布局信息中包括各单元子图的位置信息,其中,所述单元子图包括上边、下边、第一侧边以及第二侧边,所述位置信息包括,与所述单元子图的上边处于同一直线上的单元子图的索引,与所述单元子图的下边处于同一直线上的单元子图的索引,与所述单元子图的第一侧边处于同一直线上的单元子图的索引,以及与所述单元子图的第二侧边处于同一直线上的单元子图的索引。
可选的,所述第一编辑操作为拖拽所述第一拼图的边框的操作,所述第二编辑操作为对所述圆角的拖拽操作以改变所述圆角的大小,或对所述单元 子图的圆角的圆角值进行设置的操作以改变所述圆角的大小。
本公开还提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行如上所述的生成方法。
附图说明
为了更清楚地说明本公开一些实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开一些实施例的拼图的生成方法的流程图;
图2为本公开一些实施例的拼图的生成方法的时序图;
图3为本公开一些实施例电子设备的框图。
具体实施方式
为使本公开的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本公开进一步详细说明。
需要说明的是,除非另外定义,本公开一些实施例使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本公开一些实施例中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。
图1是根据本公开一些实施例提供的一种拼图的生成方法的流程图,如图1所示,该方法包括:
步骤102:获取用于构成拼图的至少两个初始图像;
例如,上述至少两个初始图像可以是用户向拼图软件输入的用于进行拼图的一组初始图像,该一组初始图像例如可以是以图像数组的形式提供给拼图软件。
步骤104:根据所述至少两个初始图像获取拼图模板的尺寸信息;
沿用上述例子,可根据上述图像数组的大小从数据库中获取到拼图模板的尺寸信息,其中,数据库中例如可以存储有2-8张图像对应的模板信息,该模板信息例如可以是一个数组,数组结构内容的单元信息为(pX,pY,pWidth,pHeight)其中,pX=单元子图左上顶点距离画布左上顶点的x轴值/当前画布宽度,pY=单元子图左上顶点距离画布左上顶点的y轴值/当前画布高度,pWidth=单元子图宽度/当前画布宽度,pHeight=单元子图高度/当前画布高度。
步骤106:根据所述拼图模板的尺寸信息获取布局数据以及画布数据;
沿用上述例子,可根据拼图模板的尺寸信息获取布局数组(为上述布局数据的一个示例)以及背景帧(为上述画布数据的一个示例)。
步骤108:根据所述至少两个初始图像、所述尺寸信息、所述画布数据以及所布局数据,生成单元子图,并将所述单元子图适配至所述拼图模板的每个单元中,得到第一拼图;
沿用上述例子,根据图像数组(为上述至少两个初始图像的一个示例)、布局数组以及背景帧通过比对计算生成新的帧,将生成的新帧适配到拼图模板中的每一个单元格中,即得到第一拼图。
步骤110:在检测到基于所述第一拼图的边框的第一编辑操作时,根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框的宽度值确定所述单元子图的第一布局信息;
可选地,在得到上述第一拼图后,用户可拖拽该第一拼图的边框以实现对边框的编辑,在该种场景下,上述第一编辑操作例如是拖拽第一拼图的边框的操作,例如,拼图模板中的内容以模板比例信息平铺显示,故,当用户对边框进行设置时,需计算当前拼图模板中所有子单元图的布局,以及模板的边框值。其中,上述单元子图的最小边长为上述第一拼图中所有单元子图 的边长中的最小值。例如,可根据上述单元子图的最小边长以及拼图模板的边框的宽度值确定出第一拼图可设置的最大边框宽度值maxBorder,可取小于maxBorder的值作为第一拼图的边框宽度值,其中,根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值,可包括,当所述最小边长为单元子图的高时,根据如下公式(1)计算所述最大边框宽度值;
maxBoder=(pHeight*canvasFrame.height–MinHeight)/(1+pHeight)  (1);
当所述最小边长为单元子图的宽时,根据如下公式(2)计算所述最大边框宽度值;
maxBorder=(pWidth*canvasFrame.width-MinWidth)/(1+pWidth)  (2)
其中,maxBoder为所述最大边框宽度值,pHeight为所述第一拼图中尺寸最小的单元子图的高度占画布高度的比例,canvasFrame.height为画布高度,pWidth为所述第一拼图中尺寸最小的单元子图的宽度,MinHeight为额定最小高度值,MinWidth为额定最小宽度值。
步骤112:根据所述第一拼图的边框的宽度值以及所述第一布局信息调整所述第一拼图,得到第二拼图。
根据本公开一些实施例的拼图的生成方法,在构建第一拼图后,可根据基于该第一拼图的编辑操作修改边框的宽度值,以及根据修改后的边框宽度值动态调整拼图中的各单元子图的布局信息,实现了快够构建拼图以及自动化调整拼图的目的,提高了构建拼图的效率。
在本公开一些实施例中,上述拼图的生成方法还可包括:
在得到所述第一拼图之后,获取所述单元子图的第二布局信息;在得到第一拼图之后,各单元子图在该拼图中的第二布局信息即已经确定,由于在拼图的边框被编辑后,重新确定各单元子图的第一布局信息时,需要用到该第二布局信息,故可在得到第一拼图之后,获得各单元子图的第二布局信息。例如,可通过NSCopy协议,拷贝出一份Current布局信息。基于此,根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框值确定所述单元子图的第一布局信息,可包括:
根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值,例如,可通过上述公式(1)来计算该最大边框宽度值。
根据所述最大边框宽度值确定所述第一拼图的边框的宽度值;例如,在小于最大边框宽度值的范围之内,设置第一拼图的边框的宽度值border。
将所述第一拼图的画布布局尺寸减去所述第一拼图的边框的宽度值,得到转换画布尺寸;例如,可仅输出计算得到的转换画布尺寸canvasFrame,而并不保存该值,使该值仅作为convertFrame,以方便对第一拼图中的各单元子图进行重新布局。
根据转换画布尺寸以及所述第二布局信息确定所述单元子图的尺寸信息;例如,可遍历current布局数组,取出各单元子图的layoutModel,该layoutModel指单元子图的四个坐标(pX,pY,pWidth,pHeight),其中,pX=单元子图左上顶点距离画布左上顶点的x轴值/当前画布宽度,pY=单元子图左上顶点距离画布左上顶点的y轴值/当前画布高度,pWidth=单元子图宽度/当前画布宽度,pHeight=单元子图高度/当前画布高度,以上述重新计算过的convertFrame重新按照比例输出假设无边框的各单元子图的尺寸,其中,假设无边框的单元子图指的是,在拼图模板中,各单元子图之间并不具有间隔,各单元子图的边框设置在各单元子图之内,这样,在移动各单元子图时,各单元子图的边框也随之一起移动。
根据所述第一拼图的边框的宽度值以及所述单元子图的尺寸信息,确定所述单元子图的所述第一布局信息,例如,所述单元子图的第一布局信息,可包括:
所述单元子图在X轴的最小坐标值为MinX+border/2,所述单元子图的在Y轴的最小坐标值为MinY+border/2,所述单元子图的宽度为Width-border,所述单元子图的高度为Height-border,其中,MinX为所述单元子图在X轴上的最小坐标值,MinY为所述单元子图在Y轴上的最小坐标值,Width为所述单元子图的宽度,Height所述单元子图的高度,border为所述第一拼图的边框的宽度值。
经过上述过程,完成对拼图的边框的配置,但由于边框配置伴随着圆角 同时进行,当圆角超过当前各单元子图的最小边长的1/2时,会造成圆角锐化的问题。为了防止这种情况的出现,在本公开一些实施例中,在对拼图的边框进行配置后,还可对圆角值进行重新配置。基于此,上述拼图的生成方法还可包括:
在检测到基于所述单元子图的圆角的第二编辑操作时,确定与所述第二编辑操作对应的目标圆角值;根据所述单元子图的最小边长确定所述单元子图的最大圆角值;第二编辑操作例如是对圆角的拖拽操作以改变圆角的大小,或对圆角值进行设置的操作以改变圆角的大小。例如,根据所述单元子图的最小边长确定所述单元子图的最大圆角值,可以是根据如下公式计算所述最大圆角值:
maxCorner=MinSide/2,其中,maxCorner为所述最大圆角值,MinSide为所述最小边长。
当所述目标圆角值不大于所述最大圆角值时,为所述单元子图执行所述第二编辑操作,若所述最大圆角值大于所述最大圆角值时,不响应所述第二编辑操作。
根据本公开一些实施例的拼图的生成方法,在对圆角值或边框的宽度值进行设置时,考虑到了单元子图的最小边长,基于该最小边长确定最大圆角值以及最大边框宽度值,基于最大圆角值对目标圆角值进行限制,以及基于最大边框宽度值确定边框的目标宽度,从而可快速高效地将所有单元子图的布局进行修正,并且保证了边框以及圆角的唯一与统一性。
需要说明的是,对圆角编辑操作可发生在构建拼图的任意一个过程中,上例中在对边框进行设置之后,检测到对圆角的编辑操作仅为一种示例性情况,但在构建拼图的任何过程中检测到对圆角的编辑操作均需满足上述条件。
在上述实施例中,边框圆角的计算仅仅是在得到第一拼图后,未操作任何边框圆角时的单一操作的逻辑判断。当编辑了圆角,那么会重新计算边框值,此时,各单元子图的额定最小边长即是cornerValue(圆角值)*2,此时,如需计算上述最大边框宽度值,也需使用此处计算得到的最小边长,相应的,计算出的最大边框宽度值也随之改变,此时是以圆角为基础来确定边框的宽度值,而当原始边的宽度框值(指在未根据圆角值改变边框的宽度值之前的 边框的宽度值)超过计算出的最大边框宽度值时,重置确定拼图中所有子图的布局。基于此,在本公开一些实施例中,上述拼图的生成方法还可包括:在为所述单元子图执行所述第二编辑操作之后,根据所述目标圆角值确定所述单元子图的额定最小边长;根据所述额定最小边长重新计算所述第二拼图的最大边框宽度值;当计算得到的所述第二拼图的最大边框宽度值小于所述第二拼图的实际边框宽度值时,重置所述第二拼图中的所有单元子图的布局信息。通过对圆角以及边框的动态调整,可处理边框与圆角逻辑冲突的问题,可解决对拼图进行拖动操作时启用autoresizeingMask引起帧计算偏移的问题,其中,autoresizeingMask是一种相对布局设置,在启用autoresizeingMask后,可自动设置子视图与父视图的相对布局。
在本公开一些实施例中,上述拼图的生成方法还可包括:所述第一布局信息以及所述第二布局信息中包括各单元子图的位置信息,其中,所述单元子图包括上边、下边、第一侧边以及第二侧边,所述位置信息包括,与所述单元子图的上边处于同一直线上的单元子图的索引,与所述单元子图的下边处于同一直线上的单元子图的索引,与所述单元子图的第一侧边处于同一直线上的单元子图的索引,以及与所述单元子图的第二侧边处于同一直线上的单元子图的索引。例如,可在模板视图模型的原始布局信息中,保存有八个声明为NSSet的变量,该八个变量分别为:
topSet:记录以当前单元子图的minY为maxY的所有单元子图的索引;topSameSet:记录当前当前单元子图的minY为minY的所有单元子图的索引;leftSet:记录以当前单元子图的leftX为maxX的所有单元子图的索引;leftSameSet:记录以当前单元子图的leftX为minX的所有单元子图的索引;bottomSet:记录以当前单元子图的maxY为minY的所有单元子图的索引;bottomSameSet:记录以当前单元子图的maxY为maxY的所有单元子图的索引;rightSet:记录以当前单元子图的maxX为minX的所有单元子图的索引;rightSameSet:记录以当前单元子图的maxX为maxX的所有单元子图的索引。其中,minY表示当前单元子图在Y轴上的最小值,maxY表示当前单元子图在Y轴上的最大值,maxX表示当前单元子图在X轴上的最大值,leftX表示当前单元子图在X轴上的最小值。
基于上述八个变量,每当用户拖动某一单元子图时,判定*Set、*SameSet中单元子图的最小值,确定该最小值,不能小于额定值,以及不能超出canvasFrame(画布)的范围,每当检测到基于单元子图的操作都进行一一比对,从而可实现对拼图中的单元子图的拖动过程,以及通过计算,完成拼图模版拖动的逻辑。可通过UIPanGestureRecoginizer(为平移手势识别器,能识别拖拽操作),对每一个单元子图可以支持拖动交换单元子图的逻辑,交换完毕,删除之前的动画,以及交换当前与原始中位置,从而使单元子图完成移位。
本公开一些实施例提供了一种拼图的生成方法可基于MVVM架构来实现,MVVM架构分为Model(模型)层、ViewModel(视图模型)层、View(视图)层以及Controller(控制)层。Model层:涉及布局比例、页面逻辑、以及边框Model的保存。Controller层:用于进行ViewModel与View绑定,连接Controller与Controller之间的通信,以及View与View之间的外部关联。View层:模版视图,手势视图,以及各个分模块功能所涉及所有界面。View-Model层:模版单例ViewModel(视图模型)、比例Model、背景Model、布局Model、边框ViewModel。
以下结合图2对基于MVVM架构实现拼图的生成方法进行说明,如图2所示,其中,控制层可包括TemplateVC(模板控制)以及BorderVC(边框控制,视图层可包括TemplateView(模板视图)以及GestureView(手势视图),模型层可包括:ViewModel(视图模型)以及BorderViewModel(边框视图模型),该方法可通过调用自定义的类BIPOperationPublicManager(以下简称Manager)来实现,其中,Manager的输入为多个图像,输出为基于该多个图像构件的拼图,如图2所示,该方法包括:
步骤1:调用Manager,向其传入一个内容为UIImage的图像数组NSArray;
步骤2:Manager将图像数组NSArray传给TemplateVC;
步骤3:TemplateVC根据图像数组大小,从数据库获取到模版的比例信息(为上述拼图模板的尺寸信息的一个示例),将该比例信息以及图像数组进行初始化后发送给TemplateView;
步骤4:TemplateView将图像数组、布局数组以及画布数组(为上述画 布数据的一个示例)发送给统一管理所有模版操作的ViewModel;
步骤5:ViewModel对图像数组、布局数组以及画布数组进行初始化后发送给GestureView;其中,ViewModel层主要包含原始布局信息,ViewModel层将图像数组、布局数组、以及画布数组根据上述比例信息通过比对计算生成新的帧适配到每一个单元子图中,再保存为原始画布布局数组;
步骤6:通过NSCopy协议,拷贝出一份Current布局信息(为上述第二布局信息的一个示例)给ViewModel;
除此之外,预留声明为BIPTemplateBorderModel边框模型,该模型涉及内容为圆角值、边框值(即为上述边框的边度值)以及渐变值,同时保留模版比例接口,最大边框值,最小边框值以及背景图。
步骤7:ViewModel将当前布局信息发送给TemplateView;
步骤8:TemplateVC将ViewModel与TemplateView进行绑定,进行界面展示,将数据传入TemplateView中,外部提供配置边框、圆角、以及渐变的接口;
步骤9:TemplateView内部每次视图出现时重新匹配TemplateView的canvasFrame(画布信息),通过ViewModel中Current布局信息重新计算GestureView中的内容,将所有GestureView全部绑定到TemplateView中,即得到上述第一拼图。
步骤10:检测到基于边框的编辑操作,得到编辑命令,将该编辑命令发送至BorderVC;
步骤11:BorderVC发送修改画布布局的消息给ViewModel;
步骤12:ViewModel向TemplateView发送重置消息;
步骤13:TemplateView进行重新布局计算:比对最小尺寸的GestureView与的实际高度值与额定最小边之间的差额,该差额例如可以大于0小于100,计算最大边框宽度值maxBorder。经过计算,当gestureView.frame(单元子图的边长)中最小值为height(高度)时,有如下公式:
maxBoder=(layoutModel.pHeight*canvasFrame.height–MinHeight)/(1+layoutModel.pHeight);
其中,pHeight为当前最小尺寸的单元子图的高度在canvasFrame.height (画布高度)中所占的比例,其值小于1。
当gestureView.frame中最小值为width(宽度)时,有如下公式:
maxBorder=(layoutModel.pWidth*canvasFrame.width-MinWidth)/(1+layoutModel.pWidth);
其中,pWidth为当前最小尺寸的单元子图的宽度在画布宽度中所占的比例,其值同样小于1。
步骤14:在小于maxBorder值的范围内,设置边框宽度border值,首先将ViewModel中所保存的canvasFrame(画布帧)减去border值,重新输出,并不保存canvasFrame新值,只是作为convertFrame(转换帧)方便重新布局
步骤15:遍历current布局数组,取出gestureView的layoutModel,以上述重新计算过的convertFrame重新按照比例输出假设无边框gesuterFrame;
步骤16:将边宽度框值在gestureFrame中,重新修改如下:
gestureView.frame=CGRectMake(MinX(gestureFrame)+border/2,MinY(gestureFrame)+border/2,Width(gesutreFrame)-border,Height(gestureFrame)-border)。
步骤17:将边框值修改为boder。
步骤18:BorderViewModel设置边框宽度值,计算最大圆角值,遍历current布局数组,得到gestureView中的最小值(即上述最小边长值),获取maxCorner=MinSide(gestureView.frame)/2;
步骤19:将maxCorner保存到ViewModel中,当圆角值超过maxCorner时,不进行任何操作。
步骤20:BorderVC检测到修改圆角值的操作,将修改圆角值的消息发送给BorderViewModel;
步骤21:BorderViewModel设置圆角值,计算最大边框值。
当进入到borderVC中,操作了圆角,那么会重新计算一下边框宽度值,此时,gestureView的最小额定尺寸即是cornerValue*2,而计算出的最大边框宽度值也随之改变,此时是以圆角为基础来进行判定最大边框宽度值,当原始边框值超过最大边框宽度值时,重置拼图的所有布局。
在本公开一些实施例中,在开启了HDR(High-Dynamic Range,高动态 范围图像)的拍照模式下,导出的UIImage图片,进行旋转、保存cgImageCopy(重新绘制的图片)的情况下,引起图片旋转,以及对称失真的情况下,可先对图片进行矫正,重新在绘制图像,在将绘制的图像传给上述Manager,以及与重新绘制的图像构建拼图。
本公开一些实施例还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任意一种拼图的生成方法。
本公开一些实施例还提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行上述任意一种拼图的生成方法。
需要说明的是,本公开一些实施例的方法可以由单个设备执行,例如一台计算机或服务器等。本实施例的方法也可以应用于分布式场景下,由多台设备相互配合来完成。在这种分布式场景的情况下,这多台设备中的一台设备可以只执行本公开一些实施例的方法中的某一个或多个步骤,这多台设备相互之间会进行交互以完成所述的方法。
上述对本公开一些实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本公开一些实施例时可以把各模块的功能在同一个或多个软件和/或硬件中实现。
上述实施例的装置用于实现前述实施例中相应的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。
图3示出了本实施例所提供的一种更为具体的电子设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。
处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本公开实施例所提供的技术方案。
存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本公开实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。
输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。
通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。
总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。
需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本公开一些实施例方案所必需的组件,而不必包含图中所示的全部组件。
本实施例的计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光 盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本公开的范围(包括权利要求)被限于这些例子;在本公开的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本公开一些实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。
另外,为简化说明和讨论,并且为了不会使本公开一些实施例难以理解,在所提供的附图中可以示出或可以不示出与集成电路(IC)芯片和其它部件的公知的电源/接地连接。此外,可以以框图的形式示出装置,以便避免使本公开一些实施例难以理解,并且这也考虑了以下事实,即关于这些框图装置的实施方式的细节是高度取决于将要实施本公开一些实施例的平台的(即,这些细节应当完全处于本领域技术人员的理解范围内)。在阐述了具体细节(例如,电路)以描述本公开的示例性实施例的情况下,对本领域技术人员来说显而易见的是,可以在没有这些具体细节的情况下或者这些具体细节有变化的情况下实施本公开一些实施例。因此,这些描述应被认为是说明性的而不是限制性的。
尽管已经结合了本公开的具体实施例对本公开进行了描述,但是根据前面的描述,这些实施例的很多替换、修改和变型对本领域普通技术人员来说将是显而易见的。例如,其它存储器架构(例如,动态RAM(DRAM))可以使用所讨论的实施例。
本公开一些实施例旨在涵盖落入所附权利要求的宽泛范围之内的所有这样的替换、修改和变型。因此,凡在本公开一些实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (19)

  1. 一种拼图的生成方法,包括:
    获取用于构成拼图的至少两个初始图像;
    根据所述至少两个初始图像获取拼图模板的尺寸信息;
    根据所述拼图模板的尺寸信息获取布局数据以及画布数据;
    根据所述至少两个初始图像、所述尺寸信息、所述画布数据以及所布局数据,生成单元子图,并将所述单元子图适配至所述拼图模板的每个单元中,得到第一拼图;
    在检测到基于所述第一拼图的边框的第一编辑操作时,根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框的宽度值确定所述单元子图的第一布局信息;
    根据所述第一拼图的边框的宽度值以及所述第一布局信息调整所述第一拼图,得到第二拼图。
  2. 根据权利要求1所述的方法,还包括:
    在得到所述第一拼图之后,获取所述单元子图的第二布局信息;
    根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框值确定所述单元子图的第一布局信息,包括:
    根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值;
    根据所述最大边框宽度值确定所述第一拼图的边框的宽度值;
    将所述第一拼图的画布布局尺寸减去所述第一拼图的边框的宽度值,得到转换画布尺寸;
    根据转换画布尺寸以及所述第二布局信息确定所述单元子图的尺寸信息;
    根据所述第一拼图的边框的宽度值以及所述单元子图的尺寸信息,确定所述第一布局信息。
  3. 根据权利要求2所述的方法,其中,所述单元子图的第一布局信息, 包括:
    所述单元子图在X轴的最小坐标值为MinX+border/2,所述单元子图的在Y轴的最小坐标值为MinY+border/2,所述单元子图的宽度为Width-border,所述单元子图的高度为Height-border,其中,MinX为所述单元子图在X轴上的最小坐标值,MinY为所述单元子图在Y轴上的最小坐标值,Width为所述单元子图的宽度,Height所述单元子图的高度,border为所述第一拼图的边框的宽度值。
  4. 根据权利要求2所述的方法,其中,根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值,包括,当所述最小边长为单元子图的高时,根据如下公式(1)计算所述最大边框宽度值;
    maxBoder=(pHeight*canvasFrame.height–MinHeight)/(1+pHeight)(1);
    当所述最小边长为单元子图的宽时,根据如下公式(2)计算所述最大边框宽度值;
    maxBorder=(pWidth*canvasFrame.width-MinWidth)/(1+pWidth)(2)其中,maxBoder为所述最大边框宽度值,pHeight为所述第一拼图中尺寸最小的单元子图的高度占画布高度的比例,canvasFrame.height为画布高度,pWidth为所述第一拼图中尺寸最小的单元子图的宽度,MinHeight为额定最小高度值,MinWidth为额定最小宽度值。
  5. 根据权利要求1所述的方法,还包括:
    在检测到基于所述单元子图的圆角的第二编辑操作时,确定与所述第二编辑操作对应的目标圆角值;
    根据所述单元子图的最小边长确定所述单元子图的最大圆角值;
    当所述目标圆角值不大于所述最大圆角值时,为所述单元子图执行所述第二编辑操作,若所述最大圆角值大于所述最大圆角值时,不响应所述第二编辑操作。
  6. 根据权利要求5所述的方法,其中,根据所述单元子图的最小边长确定所述单元子图的最大圆角值,包括根据如下公式计算所述最大圆角值:
    maxCorner=MinSide/2,其中,maxCorner为所述最大圆角值,MinSide 为所述最小边长。
  7. 根据权利要求5所述的方法,还包括:
    在为所述单元子图执行所述第二编辑操作之后,根据所述目标圆角值重新确定所述单元子图的额定最小边长;
    根据所述额定最小边长重新计算所述第二拼图的最大边框宽度值;
    当计算得到的所述第二拼图的最大边框宽度值小于所述第二拼图的实际边框宽度值时,重置所述第二拼图中的所有单元子图的布局信息。
  8. 根据权利要求2至7任一项所述的方法,还包括:
    所述第一布局信息以及所述第二布局信息中包括各单元子图的位置信息,其中,所述单元子图包括上边、下边、第一侧边以及第二侧边,所述位置信息包括,与所述单元子图的上边处于同一直线上的单元子图的索引,与所述单元子图的下边处于同一直线上的单元子图的索引,与所述单元子图的第一侧边处于同一直线上的单元子图的索引,以及与所述单元子图的第二侧边处于同一直线上的单元子图的索引。
  9. 根据权利要求5所述的方法,其中,所述第一编辑操作为拖拽所述第一拼图的边框的操作,所述第二编辑操作为对所述圆角的拖拽操作以改变所述圆角的大小,或对所述单元子图的圆角的圆角值进行设置的操作以改变所述圆角的大小。
  10. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现:
    获取用于构成拼图的至少两个初始图像;
    根据所述至少两个初始图像获取拼图模板的尺寸信息;
    根据所述拼图模板的尺寸信息获取布局数据以及画布数据;
    根据所述至少两个初始图像、所述尺寸信息、所述画布数据以及所布局数据,生成单元子图,并将所述单元子图适配至所述拼图模板的每个单元中,得到第一拼图;
    在检测到基于所述第一拼图的边框的第一编辑操作时,根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框的宽度值确定所述单元子图的第一布局信 息;
    根据所述第一拼图的边框的宽度值以及所述第一布局信息调整所述第一拼图,得到第二拼图。
  11. 根据权利要求10所述的电子设备,其中,所述处理器执行所述程序时实现:
    在得到所述第一拼图之后,获取所述单元子图的第二布局信息;
    根据所述单元子图的最小边长以及所述拼图模板的边框的宽度值确定所述第一拼图的边框的宽度值,根据所述第一拼图的边框值确定所述单元子图的第一布局信息,包括:
    根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值;
    根据所述最大边框宽度值确定所述第一拼图的边框的宽度值;
    将所述第一拼图的画布布局尺寸减去所述第一拼图的边框的宽度值,得到转换画布尺寸;
    根据转换画布尺寸以及所述第二布局信息确定所述单元子图的尺寸信息;
    根据所述第一拼图的边框的宽度值以及所述单元子图的尺寸信息,确定所述第一布局信息。
  12. 根据权利要求11所述的电子设备,其中,所述单元子图的第一布局信息,包括:
    所述单元子图在X轴的最小坐标值为MinX+border/2,所述单元子图的在Y轴的最小坐标值为MinY+border/2,所述单元子图的宽度为Width-border,所述单元子图的高度为Height-border,其中,MinX为所述单元子图在X轴上的最小坐标值,MinY为所述单元子图在Y轴上的最小坐标值,Width为所述单元子图的宽度,Height所述单元子图的高度,border为所述第一拼图的边框的宽度值。
  13. 根据权利要求11所述的电子设备,其中,根据所述单元子图的最小边长以及所述拼图模板的画布边框宽度值确定所述第一拼图的最大边框宽度值,包括,当所述最小边长为单元子图的高时,根据如下公式(1)计算所述最大边框宽度值;
    maxBoder=(pHeight*canvasFrame.height–MinHeight)/(1+pHeight)(1);
    当所述最小边长为单元子图的宽时,根据如下公式(2)计算所述最大边框宽度值;
    maxBorder=(pWidth*canvasFrame.width-MinWidth)/(1+pWidth)(2)其中,maxBoder为所述最大边框宽度值,pHeight为所述第一拼图中尺寸最小的单元子图的高度占画布高度的比例,canvasFrame.height为画布高度,pWidth为所述第一拼图中尺寸最小的单元子图的宽度,MinHeight为额定最小高度值,MinWidth为额定最小宽度值。
  14. 根据权利要求10所述的电子设备,其中,所述处理器执行所述程序时实现:
    在检测到基于所述单元子图的圆角的第二编辑操作时,确定与所述第二编辑操作对应的目标圆角值;
    根据所述单元子图的最小边长确定所述单元子图的最大圆角值;
    当所述目标圆角值不大于所述最大圆角值时,为所述单元子图执行所述第二编辑操作,若所述最大圆角值大于所述最大圆角值时,不响应所述第二编辑操作。
  15. 根据权利要求14所述的电子设备,其中,根据所述单元子图的最小边长确定所述单元子图的最大圆角值,包括根据如下公式计算所述最大圆角值:
    maxCorner=MinSide/2,其中,maxCorner为所述最大圆角值,MinSide为所述最小边长。
  16. 根据权利要求14所述的电子设备,其中,所述处理器执行所述程序时实现:
    在为所述单元子图执行所述第二编辑操作之后,根据所述目标圆角值重新确定所述单元子图的额定最小边长;
    根据所述额定最小边长重新计算所述第二拼图的最大边框宽度值;
    当计算得到的所述第二拼图的最大边框宽度值小于所述第二拼图的实际边框宽度值时,重置所述第二拼图中的所有单元子图的布局信息。
  17. 根据权利要求11至16任一项所述的电子设备,其中,所述处理器 执行所述程序时实现:
    所述第一布局信息以及所述第二布局信息中包括各单元子图的位置信息,其中,所述单元子图包括上边、下边、第一侧边以及第二侧边,所述位置信息包括,与所述单元子图的上边处于同一直线上的单元子图的索引,与所述单元子图的下边处于同一直线上的单元子图的索引,与所述单元子图的第一侧边处于同一直线上的单元子图的索引,以及与所述单元子图的第二侧边处于同一直线上的单元子图的索引。
  18. 根据权利要求14所述的电子设备,其中,所述第一编辑操作为拖拽所述第一拼图的边框的操作,所述第二编辑操作为对所述圆角的拖拽操作以改变所述圆角的大小,或对所述单元子图的圆角的圆角值进行设置的操作以改变所述圆角的大小。
  19. 一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1至9任一项所述的拼图的生成方法。
PCT/CN2021/080759 2020-03-26 2021-03-15 拼图的生成方法、设备及存储介质 WO2021190335A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010225897.3 2020-03-26
CN202010225897.3A CN113450251A (zh) 2020-03-26 2020-03-26 拼图的生成方法、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021190335A1 true WO2021190335A1 (zh) 2021-09-30

Family

ID=77807397

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080759 WO2021190335A1 (zh) 2020-03-26 2021-03-15 拼图的生成方法、设备及存储介质

Country Status (2)

Country Link
CN (1) CN113450251A (zh)
WO (1) WO2021190335A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046678A (zh) * 2012-11-12 2015-11-11 北京奇虎科技有限公司 一种实现图片拼接的装置、方法和图片处理系统
CN105867951A (zh) * 2016-06-20 2016-08-17 中国建设银行股份有限公司 数据处理方法、装置及屏幕设计器
CN106296622A (zh) * 2015-05-27 2017-01-04 阿里巴巴集团控股有限公司 一种自动布局的拼图方法及装置
CN106886418A (zh) * 2017-03-27 2017-06-23 湛江市霞山区新软佳科技有限公司 Html界面控件贴

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897826B (zh) * 2018-06-22 2021-09-14 上海哔哩哔哩科技有限公司 横幅图片快速生成方法、系统及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046678A (zh) * 2012-11-12 2015-11-11 北京奇虎科技有限公司 一种实现图片拼接的装置、方法和图片处理系统
CN106296622A (zh) * 2015-05-27 2017-01-04 阿里巴巴集团控股有限公司 一种自动布局的拼图方法及装置
CN105867951A (zh) * 2016-06-20 2016-08-17 中国建设银行股份有限公司 数据处理方法、装置及屏幕设计器
CN106886418A (zh) * 2017-03-27 2017-06-23 湛江市霞山区新软佳科技有限公司 Html界面控件贴

Also Published As

Publication number Publication date
CN113450251A (zh) 2021-09-28

Similar Documents

Publication Publication Date Title
US10761721B2 (en) Systems and methods for interactive image caricaturing by an electronic device
WO2014059886A1 (zh) 获取图像的方法和装置
JP6401855B2 (ja) Uiコントロールの背景を設定するための方法及び装置、並びに端末
TW201426493A (zh) 自繪控制項的螢幕適配方法及裝置
WO2014117559A1 (en) 3d-rendering method and device for logical window
JP2020533710A (ja) 画像ステッチング方法および装置、記憶媒体
KR102646977B1 (ko) 증강 현실에 기반한 디스플레이 방법 및 장치, 및 저장 매체
WO2017088605A1 (zh) 图片编辑中的图片显示控制方法及装置
CN111445566B (zh) 一种信息处理方法、装置及计算机可读存储介质
WO2018010440A1 (zh) 一种投影画面调整方法、装置和投影终端
US20140325404A1 (en) Generating Screen Data
CN113538623A (zh) 确定目标图像的方法、装置、电子设备及存储介质
WO2021190335A1 (zh) 拼图的生成方法、设备及存储介质
WO2023103684A1 (zh) 人像头发流动特效处理方法、装置、介质和电子设备
CN106354381B (zh) 图像文件的处理方法及装置
JP6287498B2 (ja) 電子ホワイトボード装置、電子ホワイトボードの入力支援方法、及びプログラム
CN111563956A (zh) 一种二维图片的三维显示方法、装置、设备及介质
WO2023077650A1 (zh) 三色图生成方法及相关设备
CN114185472B (zh) 一种幻灯片放映方法、装置、电子设备及存储介质
WO2023134537A1 (zh) 分屏特效道具生成方法、装置、设备和介质
CN114201251A (zh) 降低书写痕迹显示延时的方法、装置、设备及介质
CN114159782A (zh) 游戏模型摆放位置的确定方法、装置、终端和存储介质
CN114972701A (zh) 后处理区域的确定方法、装置、计算机设备及存储介质
CN115222867A (zh) 重叠检测方法、装置、电子设备和存储介质
CN115501589A (zh) 模型渲染方法、装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21777175

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21777175

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15.05.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21777175

Country of ref document: EP

Kind code of ref document: A1