CN108921917A - Adaptively divide shape drawing practice, equipment, system and storage medium - Google Patents

Adaptively divide shape drawing practice, equipment, system and storage medium Download PDF

Info

Publication number
CN108921917A
CN108921917A CN201810748254.XA CN201810748254A CN108921917A CN 108921917 A CN108921917 A CN 108921917A CN 201810748254 A CN201810748254 A CN 201810748254A CN 108921917 A CN108921917 A CN 108921917A
Authority
CN
China
Prior art keywords
graftal
point
scaling factor
drawing area
coordinate
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.)
Granted
Application number
CN201810748254.XA
Other languages
Chinese (zh)
Other versions
CN108921917B (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.)
Wuhan Polytechnic University
Original Assignee
Wuhan Polytechnic University
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 Wuhan Polytechnic University filed Critical Wuhan Polytechnic University
Priority to CN201810748254.XA priority Critical patent/CN108921917B/en
Publication of CN108921917A publication Critical patent/CN108921917A/en
Application granted granted Critical
Publication of CN108921917B publication Critical patent/CN108921917B/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
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Abstract

Adaptively divide shape drawing practice, equipment, system and storage medium the invention discloses a kind of.It determines in display interfaces to drawing area, IFS code based on original image to be drawn passes through interative computation, obtain the coordinate of each point in the graftal of the original image to be drawn, according to the coordinate of each point in the graftal, determine the graftal in the scaling factor to drawing area, the horizontal offset and offset of vertical amount of the graftal are determined based on the scaling factor, and then determine the point on the graftal in the coordinate to drawing area, to draw out the graftal, the present invention provides a kind of general method for drafting for the graftal with IFS code, and guarantee that the graftal drawn can completely be presented on drawing area and keep good ratio with drawing area.

Description

Adaptively divide shape drawing practice, equipment, system and storage medium
Technical field
The present invention relates to the technical field that graftal is drawn, more particularly to a kind of adaptive point shape drawing practice, equipment, it is System and storage medium.
Background technique
In the research for dividing shape field, in order to enhance perceptual knowledge, drawing graftal is often very important.Graftal It is very graceful, and can not often draw by hand.For the graftal with IFS code, function can be passed through by computer The mode of iteration is drawn.Therefore, the method with versatility is designed to have a very important significance to draw graftal.So And different graftals, size and shape are different.If the specific location to it in drawing area is not pacified suitably Row, then will appear following state:
(1) graftal drawn not in drawing area, that is, can't see the graftal of drafting completely;
(2) graftal drawn can only see parts of images, a part of image nothing due to the outside in drawing area Method is seen;
(3) although can see complete graftal sometimes, compared with drawing area, often too because of fractal graph It is small and seem uncoordinated, for example graftal appears in some corner of drawing area.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill Art.
Summary of the invention
Adaptively divide shape drawing practice, equipment, system and storage medium, purport the main purpose of the present invention is to provide a kind of The graftal drawn in the prior art is being solved not in the graftal and drawing area of the middle position of drawing area and drafting The uncoordinated technical problem of ratio.
To achieve the above object, the present invention provides a kind of adaptive point shape drawing practice, the described method comprises the following steps:
It determines in display interfaces to drawing area;
Obtain the IFS code of original image to be drawn;
Based on the IFS code by interative computation, the coordinate of each point in the graftal of the original image to be drawn is obtained;
According to the coordinate of each point in the graftal, determine the graftal the scaling to drawing area because Son;
Determine each point in the graftal in the horizontal offset of the graftal and perpendicular based on the scaling factor Straight offset;
It is determined on the graftal based on the horizontal offset of the graftal, offset of vertical amount and the scaling factor Point in the coordinate to drawing area, according to the point on the graftal in the coordinate to drawing area described wait draw Graph region draws the graftal of the original image to be drawn.
Preferably, the coordinate according to each point in the graftal determines the graftal described to drawing area The scaling factor, specifically include:
Compare the abscissa and ordinate of each point in the graftal;
According to abscissa maximum value and abscissa minimum value, determine the graftal in the abscissa to drawing area The scaling factor;
According to ordinate maximum value and ordinate minimum value, determine the graftal in the ordinate to drawing area The scaling factor;
The magnification of the graftal is determined according to the abscissa scaling factor and the ordinate scaling factor The example factor.
Preferably, described to divide shape according to the abscissa scaling factor and the determination of the ordinate scaling factor The scaling factor of figure, specifically includes:
Using smaller value in the abscissa scaling factor and the ordinate scaling factor as the graftal The scaling factor.
Preferably, described that institute is determined based on the horizontal offset of the graftal, offset of vertical amount and the scaling factor The point on graftal is stated in the coordinate to drawing area, is specifically included:
According to the scaling factor and horizontal offset of the graftal, determine that the point on the graftal is drawn described Abscissa in graph region;
According to the scaling factor and offset of vertical amount of the graftal, determine that the point on the graftal is drawn described Ordinate in graph region.
Preferably, it is calculated by the following formula the horizontal offset and offset of vertical amount of the graftal,
Wherein, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal, XYscaleTable Show the scaling factor of graftal, WDIndicate the width to drawing area, HDIndicate the height to drawing area, xmaxIndicate institute State maximum abscissa value, x in graftalminIndicate the smallest abscissa value, y in the graftalmaxIndicate the graftal In maximum ordinate value, yminIndicate the smallest ordinate value in the graftal.
Preferably, abscissa and vertical seat of the point on the graftal on the drawing area are calculated by the following formula Mark,
X '=[x*XYscale+Xoffset]
Y '=[y*XYscale+Yoffset]
Wherein, (x, y) indicates that the coordinate of some point on graftal, (x ', y ') indicate the point (x, y) on graftal wait draw Coordinate in graph region, XYscaleIndicate the scaling factor of graftal, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal.
Preferably, the IFS code based on the original image to be drawn obtains the original image to be drawn by interative computation The coordinate of each point, specifically includes in graftal:
A point is randomly selected in original image as starting point wait draw described, obtains the starting point in the graftal In coordinate;
Using preset the number of iterations and the iteration function determined by the IFS code, based on the starting point at described point Coordinate in shape figure determines the coordinate that remaining in the graftal is put.
In addition, to achieve the above object, the present invention also provides one kind adaptively to divide shape plotting equipment, it is described adaptively to divide shape Plotting equipment includes:It memory, processor and is stored on the memory and can run on the processor adaptive Divide shape mapping program, the adaptive point shape mapping program is arranged for carrying out adaptive point shape drawing practice as described above Step.
In addition, to achieve the above object, the present invention also provides one kind adaptively to divide shape drafting system, it is described adaptively to divide shape Drafting system includes:Drawing area determining module, IFS code obtain module, coordinate obtaining module, the scaling factor and determine mould Block, offset determination module and graftal drafting module;
The drawing area determining module determines in display interfaces to drawing area;
The IFS code obtains module, for obtaining the IFS code of original image to be drawn;
The coordinate obtaining module, for, by interative computation, obtaining point of the original image to be drawn based on the IFS code The coordinate of each point in shape figure;
The scaling factor determining module divides shape described in determination for the coordinate according to each point in the graftal Figure is in the scaling factor to drawing area;
The offset determination module, for determining that each point is described in the graftal based on the scaling factor The horizontal offset and offset of vertical amount of graftal;
The graftal drafting module, for horizontal offset, offset of vertical amount and magnification based on the graftal The example factor determine the point on the graftal in the coordinate to drawing area, according to the point on the graftal it is described to The coordinate of drawing area is in the graftal for drawing the original image to be drawn to drawing area.
In addition, to achieve the above object, the present invention also provides a kind of storage medium, being stored on the storage medium adaptive Shape mapping program should be divided, the adaptive point shape mapping program realizes adaptive point shape as described above when being executed by processor The step of drawing practice.
In the present invention, determine that the IFS code based on original image to be drawn passes through iteration to drawing area in display interfaces Operation, the coordinate for obtaining each point in the graftal of the original image to be drawn determine institute according to the coordinate of each point in the graftal Graftal is stated in the scaling factor to drawing area, is determined based on the scaling factor each in the graftal Horizontal offset and offset of vertical amount of the point in the graftal, horizontal offset, offset of vertical amount based on the graftal And the scaling factor determines the point on the graftal in the coordinate to drawing area, according to the point on the graftal In the coordinate to drawing area in the graftal for drawing the original image to be drawn to drawing area, the present invention be with The graftal of IFS code provides a kind of general method for drafting, and guarantees that the graftal drawn can be completely presented on and draw Graph region and good ratio is kept with drawing area.
Detailed description of the invention
Fig. 1 is the adaptive point shape plotting equipment structural representation for the hardware running environment that the embodiment of the present invention is related to Figure;
Fig. 2 is the flow diagram that the present invention adaptively divides shape drawing practice first embodiment;
Fig. 3 is the functional block diagram that the present invention adaptively divides shape drafting system first embodiment;
Fig. 4 is graftal made of the present invention is drawn as the IFS code of table 1.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the adaptive point shape plotting equipment for the hardware running environment that the embodiment of the present invention is related to Structural schematic diagram.
As shown in Figure 1, this adaptively a point shape plotting equipment may include:Processor 1001, such as CPU, communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 for realizing these components it Between connection communication.User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), Optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include Standard wireline interface and wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to steady Fixed memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of The storage device of aforementioned processor 1001.
It will be understood by those skilled in the art that structure shown in Fig. 1 is not constituted to adaptively point shape plotting equipment It limits, may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include operating system, network communication mould in a kind of memory 1005 of storage medium Block, Subscriber Interface Module SIM and adaptively divide shape mapping program.
Shown in FIG. 1 adaptively to divide in shape plotting equipment, network interface 1004 is mainly used for carrying out data with external network Communication;User interface 1003 is mainly used for receiving the input instruction of user;The adaptive point shape plotting equipment passes through processor The adaptive point shape mapping program stored in 1001 calling memories 1005, and execute following operation:
It determines in display interfaces to drawing area;
Obtain the IFS code of original image to be drawn;
Based on the IFS code by interative computation, the coordinate of each point in the graftal of the original image to be drawn is obtained;
According to the coordinate of each point in the graftal, determine the graftal the scaling to drawing area because Son;
Determine each point in the graftal in the horizontal offset of the graftal and perpendicular based on the scaling factor Straight offset;
It is determined on the graftal based on the horizontal offset of the graftal, offset of vertical amount and the scaling factor Point in the coordinate to drawing area, according to the point on the graftal in the coordinate to drawing area described wait draw Graph region draws the graftal of the original image to be drawn.
Further, processor 1001 can call the adaptive point shape mapping program stored in memory 1005, also hold The following operation of row:
Compare the abscissa and ordinate of each point in the graftal;
According to abscissa maximum value and abscissa minimum value, determine the graftal in the abscissa to drawing area The scaling factor;
According to ordinate maximum value and ordinate minimum value, determine the graftal in the ordinate to drawing area The scaling factor;
The magnification of the graftal is determined according to the abscissa scaling factor and the ordinate scaling factor The example factor.
Further, processor 1001 can call the adaptive point shape mapping program stored in memory 1005, also hold The following operation of row:
Using smaller value in the abscissa scaling factor and the ordinate scaling factor as the graftal The scaling factor.
Further, processor 1001 can call the adaptive point shape mapping program stored in memory 1005, also hold The following operation of row:
According to the scaling factor and horizontal offset of the graftal, determine that the point on the graftal is drawn described Abscissa in graph region;
According to the scaling factor and offset of vertical amount of the graftal, determine that the point on the graftal is drawn described Ordinate in graph region.
Further, processor 1001 can call the adaptive point shape mapping program stored in memory 1005, also hold The following operation of row:
A point is randomly selected in original image as starting point wait draw described, obtains the starting point in the graftal In coordinate;
Using preset the number of iterations and the iteration function determined by the IFS code, based on the starting point at described point Coordinate in shape figure determines the coordinate that remaining in the graftal is put.
The present embodiment through the above scheme, is determined in display interfaces to drawing area, the IFS based on original image to be drawn Code obtains the coordinate of each point in the graftal of the original image to be drawn, according to each point in the graftal by interative computation Coordinate determines that the graftal in the scaling factor to drawing area, determines institute based on the scaling factor State horizontal offset and offset of vertical amount of each point in the graftal, the horizontal-shift based on the graftal in graftal Amount, offset of vertical amount and the scaling factor determine the point on the graftal in the coordinate to drawing area, according to institute The point on graftal is stated in the coordinate to drawing area in minute shape for drawing the original image to be drawn to drawing area Figure, the present invention provide a kind of general method for drafting for the graftal with IFS code, and guarantee that the graftal drawn can It is completely presented on drawing area and keeps good ratio with drawing area.
Based on above-mentioned hardware configuration, propose that the present invention adaptively divides shape drawing practice embodiment.
Referring to Fig. 2, Fig. 2 is the flow diagram that the present invention adaptively divides shape drawing practice first embodiment.
In the present embodiment, the adaptive point shape drawing practice includes the following steps:
S10:It determines in display interfaces to drawing area.
It in the concrete realization, can be by the length and width of detection display interfaces, according to drawing area and display The width percentage and height percent at device interface can determine described to drawing area in the middle position of display interfaces.
It is understood that the middle position that the display interfaces are arranged in drawing area can be made will The graftal of drafting can preferably be shown.
S20:Obtain the IFS code of original image to be drawn.
The IFS code for obtaining original image to be drawn, can be expressed as (ai, bi, ci, di, ei, fi, i=1,2,3, ∧, n).
S30:Based on the IFS code by interative computation, the coordinate of each point in the graftal of the original image to be drawn is obtained.
In the concrete realization, a point can be randomly selected in original image as starting point, described in acquisition wait draw described Coordinate of the starting point in the graftal is based on using preset the number of iterations and the iteration function determined by the IFS code The starting point determines the coordinate that remaining in the graftal is put in the coordinate in the graftal.
Wherein, the number of iterations can be 500 or 600, and the present embodiment is without restriction.
It can be expressed as by the iteration function that the IFS code determines:
Wherein, (Xk, Yk) indicate coordinate of the starting point in graftal, (Xk+1, Yk+1) indicate next point in graftal Coordinate, curpIndicate the random number that computer currently generates, curp∈ [0,1], SiIndicate the iteration section of i-th of function.
It is appreciated that coordinate of the starting point based on selection in graftal, it can be successively according to the formula as shown in (1) Find out the coordinate of each point in graftal.
S40:According to the coordinate of each point in the graftal, determine the graftal in the magnification to drawing area The example factor.
In the concrete realization, the abscissa and ordinate that each point in the graftal can be obtained first, according to abscissa Maximum value and abscissa minimum value, determine the graftal in the abscissa scaling factor to drawing area, according to Ordinate maximum value and ordinate minimum value, determine the graftal the ordinate scaling to drawing area because Son determines the scaling to drawing area according to the abscissa scaling factor and the ordinate scaling factor The factor.
The graftal to drawing area the abscissa scaling factor and the ordinate scaling factor can lead to Following formula is crossed to be calculated:
Wherein, XscaleIndicate graftal in the abscissa scaling factor to drawing area, YscaleIndicate that graftal exists To the ordinate scaling factor of drawing area, WDIndicate the width to drawing area, HDIndicate the height to drawing area, xmaxIndicate abscissa maximum value in graftal, xminIndicate abscissa minimum value in graftal, ymaxIndicate ordinate in graftal Maximum value, yminIndicate ordinate minimum value in graftal.
In order to guarantee that graftal has identical aspect ratio, by formula (2) and (3) obtain respectively the graftal to It, can be flexible according to the abscissa of acquisition after the abscissa scaling factor and the ordinate scaling factor of drawing area Scale factor and the ordinate scaling factor determine the scaling factor of the graftal, can specifically assign horizontal seat respectively The scaling factor and the certain weight of the ordinate scaling factor are marked, to calculate the graftal to drawing area The scaling factor, can also be directly by smaller value in the abscissa scaling factor and the ordinate scaling factor Or the scaling factor of the larger value as the graftal.
S50:Determine that each point is in the horizontal-shift of the drawing area in the graftal based on the scaling factor Amount and offset of vertical amount.
Specifically, the horizontal offset of the graftal and offset of vertical amount can be calculate by the following formula:
Wherein, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal, XYscaleTable Show the scaling factor of graftal, WDIndicate the width to drawing area, HDIndicate the height to drawing area, xmaxIndicate institute State maximum abscissa value, x in graftalminIndicate the smallest abscissa value, y in the graftalmaxIndicate the graftal In maximum ordinate value, yminIndicate the smallest ordinate value in the graftal.
S60:It is determined on the graftal based on the horizontal offset of graftal, offset of vertical amount and the scaling factor Point in the coordinate to drawing area, according to the point on the graftal in the coordinate to drawing area described wait draw Graph region draws the graftal of the original image to be drawn.
Specifically, it can be determined on the graftal according to the scaling factor and horizontal offset of the graftal Abscissa of the point on the drawing area, can be according to the scaling factor and offset of vertical amount of the graftal, really Ordinate of the point in the vertical graph region on the fixed graftal, specific calculation formula are:
X '=[x*XYscale+Xoffset] (6)
Y '=[y*XYscale+Yoffset] (7)
Wherein, (x, y) indicates that the coordinate of some point on graftal, (x ', y ') indicate the point (x, y) on graftal wait draw Coordinate in graph region, XYscaleIndicate the scaling factor of graftal, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal.
In the present embodiment, according to the width percentage and height percent to drawing area and display interfaces, described The middle position of display interfaces is determining described to drawing area, and the IFS code based on original image to be drawn is obtained by interative computation The coordinate of each point determines the graftal according to the coordinate of each point in the graftal in the graftal of the original image to be drawn In the scaling factor to drawing area, determine that each point is described in the graftal based on the scaling factor The horizontal offset and offset of vertical amount of graftal, horizontal offset, offset of vertical amount and magnification based on the graftal The example factor determine the point on the graftal in the coordinate to drawing area, according to the point on the graftal it is described to The coordinate of drawing area is with IFS code in the graftal for drawing the original image to be drawn to drawing area, the present invention Graftal provides a kind of general method for drafting, and guarantee the graftal drawn can completely be presented on drawing area and Good ratio is kept with drawing area.
Referring to Fig. 3, Fig. 3 is the functional block diagram that the present invention adaptively divides shape drafting system first embodiment, based on adaptive Shape drawing practice should be divided, propose that the present invention adaptively divides the first embodiment of shape drafting system.
In the present embodiment, the adaptive point shape drafting system includes:Drawing area determining module 10, IFS code obtain Module 20, coordinate obtaining module 30, scaling factor determining module 40, offset determination module 50 and graftal drafting module 60;
The drawing area determining module 10, for determining in display interfaces to drawing area.
It in the concrete realization, can be by the length and width of detection display interfaces, according to drawing area and display The width percentage and height percent at device interface can determine described to drawing area in the middle position of display interfaces.
It is understood that the middle position that the display interfaces are arranged in drawing area can be made will The graftal of drafting can preferably be shown.
The IFS code obtains module 20, for obtaining the IFS code of original image to be drawn.
The IFS code for obtaining original image to be drawn, can be expressed as (ai, bi, ci, di, ei, fi, i=1,2,3, ∧, n).
The coordinate obtaining module 30, for, by interative computation, obtaining the original image to be drawn based on the IFS code The coordinate of each point in graftal.
In the concrete realization, a point can be randomly selected in original image as starting point, described in acquisition wait draw described Coordinate of the starting point in the graftal is based on using preset the number of iterations and the iteration function determined by the IFS code The starting point determines the coordinate that remaining in the graftal is put in the coordinate in the graftal.
Wherein, the number of iterations can be 500 or 600, and the present embodiment is without restriction.
It can be expressed as by the iteration function that the IFS code determines:
Wherein, (Xk, Yk) indicate coordinate of the starting point in graftal, (Xk+1, Yk+1) indicate next point in graftal Coordinate, curpIndicate the random number that computer currently generates, curp∈ [0,1], SiIndicate the iteration section of i-th of function.
It is appreciated that coordinate of the starting point based on selection in graftal, it can be successively according to the formula as shown in (1) Find out the coordinate of each point in graftal.
The scaling factor determining module 40 determines described point for the coordinate according to each point in the graftal Shape figure is in the scaling factor to drawing area.
In the concrete realization, the abscissa and ordinate that each point in the graftal can be obtained first, according to abscissa Maximum value and abscissa minimum value, determine the graftal in the abscissa scaling factor to drawing area, according to Ordinate maximum value and ordinate minimum value, determine the graftal the ordinate scaling to drawing area because Son determines the scaling to drawing area according to the abscissa scaling factor and the ordinate scaling factor The factor.
The graftal to drawing area the abscissa scaling factor and the ordinate scaling factor can lead to Following formula is crossed to be calculated:
Wherein, XscaleIndicate graftal in the abscissa scaling factor to drawing area, YscaleIndicate that graftal exists To the ordinate scaling factor of drawing area, WDIndicate the width to drawing area, HDIndicate the height to drawing area, xmaxIndicate abscissa maximum value in graftal, xminIndicate abscissa minimum value in graftal, ymaxIndicate ordinate in graftal Maximum value, yminIndicate ordinate minimum value in graftal.
In order to guarantee that graftal has identical aspect ratio, by formula (2) and (3) obtain respectively the graftal to It, can be flexible according to the abscissa of acquisition after the abscissa scaling factor and the ordinate scaling factor of drawing area Scale factor and the ordinate scaling factor determine the scaling factor of the graftal, can specifically assign horizontal seat respectively The scaling factor and the certain weight of the ordinate scaling factor are marked, to calculate the graftal to drawing area The scaling factor, can also be directly by smaller value in the abscissa scaling factor and the ordinate scaling factor Or the scaling factor of the larger value as the graftal.
The offset determination module 50, for determining that each point is in institute in the graftal based on the scaling factor State the horizontal offset and offset of vertical amount of graftal.
Specifically, the horizontal offset of the graftal and offset of vertical amount can be calculate by the following formula:
Wherein, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal, XYscaleTable Show the scaling factor of graftal, WDIndicate the width to drawing area, HDIndicate the height to drawing area, xmaxIndicate institute State maximum abscissa value, x in graftalminIndicate the smallest abscissa value, y in the graftalmaxIndicate the graftal In maximum ordinate value, yminIndicate the smallest ordinate value in the graftal.
The graftal drafting module 60, for the horizontal offset based on the graftal, offset of vertical amount and flexible Scale factor determines the point on the graftal in the coordinate to drawing area, according to the point on the graftal described Coordinate to drawing area is in the graftal for drawing the original image to be drawn to drawing area.
Specifically, it can be determined on the graftal according to the scaling factor and horizontal offset of the graftal Abscissa of the point on the drawing area, can be according to the scaling factor and offset of vertical amount of the graftal, really Ordinate of the point in the vertical graph region on the fixed graftal, specific calculation formula are:
X '=[x*XYscale+Xoffset] (6)
Y '=[y*XYscale+Yoffset] (7)
Wherein, (x, y) indicates that the coordinate of some point on graftal, (x ', y ') indicate the point (x, y) on graftal wait draw Coordinate in graph region, XYscaleIndicate the scaling factor of graftal, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal.
In the present embodiment, determining described to drawing area in display interfaces, the IFS code based on original image to be drawn passes through Interative computation obtains the coordinate of each point in the graftal of the original image to be drawn, according to the coordinate of each point in the graftal, really The fixed graftal determines the graftal based on the scaling factor in the scaling factor to drawing area Middle each point the graftal horizontal offset and offset of vertical amount, horizontal offset based on the graftal, it is vertical partially Shifting amount and the scaling factor determine the point on the graftal in the coordinate to drawing area, according on the graftal Point in the coordinate to drawing area in the graftal for drawing the original image to be drawn to drawing area, the present invention is Graftal with IFS code provides a kind of general method for drafting, and guarantees that the graftal drawn can be completely presented Good ratio is kept in drawing area and with drawing area.
In addition, the embodiment of the present invention also proposes a kind of storage medium, it is stored with an adaptive point shape on the storage medium and draws Figure program, the adaptive point shape mapping program realize following operation when being executed by processor:
It determines in display interfaces to drawing area;
Obtain the IFS code of original image to be drawn;
Based on the IFS code by interative computation, the coordinate of each point in the graftal of the original image to be drawn is obtained;
According to the coordinate of each point in the graftal, determine the graftal the scaling to drawing area because Son;
Determine each point in the graftal in the horizontal offset of the graftal and perpendicular based on the scaling factor Straight offset;
It is determined on the graftal based on the horizontal offset of the graftal, offset of vertical amount and the scaling factor Point in the coordinate to drawing area, according to the point on the graftal in the coordinate to drawing area described wait draw Graph region draws the graftal of the original image to be drawn.
Further, following operation is also realized when the adaptive point shape mapping program is executed by processor:
Compare the abscissa and ordinate of each point in the graftal;
According to abscissa maximum value and abscissa minimum value, determine the graftal in the abscissa to drawing area The scaling factor;
According to ordinate maximum value and ordinate minimum value, determine the graftal in the ordinate to drawing area The scaling factor;
The magnification of the graftal is determined according to the abscissa scaling factor and the ordinate scaling factor The example factor.
Further, following operation is also realized when the adaptive point shape mapping program is executed by processor:
Using smaller value in the abscissa scaling factor and the ordinate scaling factor as the graftal The scaling factor.
Further, following operation is also realized when the adaptive point shape mapping program is executed by processor:
According to the scaling factor and horizontal offset of the graftal, determine that the point on the graftal is drawn described Abscissa in graph region;
According to the scaling factor and offset of vertical amount of the graftal, determine that the point on the graftal is drawn described Ordinate in graph region.
Further, following operation is also realized when the adaptive point shape mapping program is executed by processor:
A point is randomly selected in original image as starting point wait draw described, obtains the starting point in the graftal In coordinate;
Using preset the number of iterations and the iteration function determined by the IFS code, based on the starting point at described point Coordinate in shape figure determines the coordinate that remaining in the graftal is put.
The present embodiment is through the above scheme, determining described to drawing area in display interfaces, based on original image to be drawn IFS code by interative computation, the coordinate of each point in the graftal of the original image to be drawn is obtained, according to each in the graftal The coordinate of point determines that in the scaling factor to drawing area, it is true to be based on the scaling factor for the graftal Each point is in the horizontal offset and offset of vertical amount of the graftal in the fixed graftal, and the level based on the graftal is partially Shifting amount, offset of vertical amount and the scaling factor determine the point on the graftal in the coordinate to drawing area, according to Point on the graftal is in the coordinate to drawing area in minute for drawing the original image to be drawn to drawing area Shape figure, the present invention provides a kind of general method for drafting for the graftal with IFS code, and guarantees the graftal energy drawn It is enough to be completely presented on drawing area and keep good ratio with drawing area.
In order to test effect of the method provided by the invention in graftal drafting, developed with VC++ corresponding with this method Adaptively divide shape drafting system, by the system, as long as importing the information of IFS code, so that it may draw its corresponding point of table figure.
It is as follows to test environment:
(1) software development environment:Indows 7, Microsoft Visual Studio 2008;(2) software runs ring Border:Windows 7;(3) hardware development environment:Dell vostro 220PC.Dual-Core CPU 2.70GHz, 2GB DDR3SDRAM memory, 320GB SATA (7200RPM) hard disk;(4) hardware running environment:Dell vostro 220PC;(5) programming language mentions version number:Microsoft Visual C++2008.
When importing IFS code information as described in Table 1, then graftal shown in Fig. 4 is obtained.
The iterated function system that table 1 is made of four functions
i ai bi ci di ei fi pi
1 0.03 0 0 0.45 0 0 0.05
2 -0.03 0 0 -0.45 0 0.4 0.15
3 0.56 -0.56 0.56 0.56 0 0.4 0.4
4 0.56 0.56 -0.56 0.56 0 0.4 0.4
From fig. 4, it can be seen that being shown in drawing area completely by the graftal that inventive method obtains, it is also at Drawing zone The middle position in domain, figure bandwagon effect are preferable.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of adaptively divide shape drawing practice, which is characterized in that the described method comprises the following steps:
It determines in display interfaces to drawing area;
Obtain the IFS code of original image to be drawn;
Based on the IFS code by interative computation, the coordinate of each point in the graftal of the original image to be drawn is obtained;
According to the coordinate of each point in the graftal, determine the graftal in the scaling factor to drawing area;
Based on the scaling factor determine each point in the graftal the horizontal offset of the graftal and it is vertical partially Shifting amount;
Determine that the point on the graftal exists based on the horizontal offset of the graftal, offset of vertical amount and the scaling factor The coordinate to drawing area, according to the point on the graftal in the coordinate to drawing area described to Drawing zone Draw the graftal of the original image to be drawn in domain.
2. the method as described in claim 1, which is characterized in that the coordinate according to each point in the graftal determines institute Graftal is stated in the scaling factor to drawing area, is specifically included:
Compare the abscissa and ordinate of each point in the graftal;
According to abscissa maximum value and abscissa minimum value, determine that the graftal is flexible in the abscissa to drawing area Scale factor;
According to ordinate maximum value and ordinate minimum value, determine that the graftal is flexible in the ordinate to drawing area Scale factor;
According to the abscissa scaling factor and the ordinate scaling factor determine the scaling of the graftal because Son.
3. method according to claim 2, which is characterized in that described according to the abscissa scaling factor and ordinate The scaling factor determines the scaling factor of the graftal, specifically includes:
Using smaller value in the abscissa scaling factor and the ordinate scaling factor as the flexible of the graftal Scale factor.
4. the method as described in claim 1, which is characterized in that the horizontal offset based on the graftal, it is vertical partially Shifting amount and the scaling factor determine that the point on the graftal in the coordinate to drawing area, specifically includes:
According to the scaling factor and horizontal offset of the graftal, determine the point on the graftal in the Drawing zone Abscissa on domain;
According to the scaling factor and offset of vertical amount of the graftal, determine the point on the graftal in the Drawing zone Ordinate on domain.
5. method as claimed in claim 4, which is characterized in that be calculated by the following formula the horizontal offset of the graftal And offset of vertical amount,
Wherein, XoffsetIndicate the horizontal offset of graftal, YoffsetIndicate the offset of vertical amount of graftal, XYscaleIt indicates to divide The scaling factor of shape figure, WDIndicate the width to drawing area, HDIndicate the height to drawing area, xmaxIndicate described point Maximum abscissa value, x in shape figureminIndicate the smallest abscissa value, y in the graftalmaxIt indicates in the graftal most Big ordinate value, yminIndicate the smallest ordinate value in the graftal.
6. method as claimed in claim 5, which is characterized in that be calculated by the following formula the point on the graftal described Abscissa and ordinate on drawing area,
X '=[x*XYscale+Xoffset]
Y '=[y*XYscale+Yoffset]
Wherein, (x, y) indicates that the coordinate of some point on graftal, (x ', y ') indicate the point (x, y) on graftal to Drawing zone Coordinate in domain, XYscaleIndicate the scaling factor of graftal, XoffsetIndicate the horizontal offset of graftal, YoffsetTable Show the offset of vertical amount of graftal.
7. such as method of any of claims 1-6, which is characterized in that the IFS based on the original image to be drawn Code is obtained the coordinate of each point in the graftal of the original image to be drawn, is specifically included by interative computation:
A point is randomly selected in original image as starting point wait draw described, obtains the starting point in the graftal Coordinate;
Using preset the number of iterations and the iteration function determined by the IFS code, based on the starting point in the graftal In coordinate determine in the graftal remaining coordinate put.
8. a kind of adaptively divide shape plotting equipment, which is characterized in that the adaptive point shape plotting equipment includes:Memory, place Reason device and the adaptive point shape mapping program that is stored on the memory and can run on the processor, it is described adaptive Point shape mapping program is arranged for carrying out the step of adaptive point of shape drawing practice as described in any one of claims 1 to 7.
9. a kind of adaptively divide shape drafting system, which is characterized in that the adaptive point shape drafting system includes:Drawing area is true Cover half block, IFS code obtain module, coordinate obtaining module, scaling factor determining module, offset determination module and graftal Drafting module;
The drawing area determining module, for determining in display interfaces to drawing area;
The IFS code obtains module, for obtaining the IFS code of original image to be drawn;
The coordinate obtaining module, for, by interative computation, obtaining the graftal of the original image to be drawn based on the IFS code The coordinate of middle each point;
The scaling factor determining module determines that the graftal exists for the coordinate according to each point in the graftal The scaling factor to drawing area;
The offset determination module, for determining that each point is in described point of shape in the graftal based on the scaling factor The horizontal offset and offset of vertical amount of figure;
The graftal drafting module, for horizontal offset, offset of vertical amount and scaling based on the graftal because Son determines the point on the graftal in the coordinate to drawing area, according to the point on the graftal described wait draw The coordinate in region is in the graftal for drawing the original image to be drawn to drawing area.
10. a kind of storage medium, which is characterized in that be stored with adaptive point shape mapping program on the storage medium, it is described from It adapts to realize that the adaptive point shape as described in any one of claims 1 to 7 is drawn when point shape mapping program is executed by processor The step of method.
CN201810748254.XA 2018-07-09 2018-07-09 Adaptive fractal drawing method, device, system and storage medium Active CN108921917B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810748254.XA CN108921917B (en) 2018-07-09 2018-07-09 Adaptive fractal drawing method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810748254.XA CN108921917B (en) 2018-07-09 2018-07-09 Adaptive fractal drawing method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN108921917A true CN108921917A (en) 2018-11-30
CN108921917B CN108921917B (en) 2022-05-03

Family

ID=64411360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810748254.XA Active CN108921917B (en) 2018-07-09 2018-07-09 Adaptive fractal drawing method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN108921917B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4941193A (en) * 1987-10-02 1990-07-10 Iterated Systems, Inc. Methods and apparatus for image compression by iterated function system
US20070040848A1 (en) * 2003-03-14 2007-02-22 The Australian National University Fractal image data and image generator
CN103679773A (en) * 2013-12-31 2014-03-26 中国林业科学研究院资源信息研究所 Tree form simulation method based on self-adaptive fractal algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4941193A (en) * 1987-10-02 1990-07-10 Iterated Systems, Inc. Methods and apparatus for image compression by iterated function system
US20070040848A1 (en) * 2003-03-14 2007-02-22 The Australian National University Fractal image data and image generator
CN103679773A (en) * 2013-12-31 2014-03-26 中国林业科学研究院资源信息研究所 Tree form simulation method based on self-adaptive fractal algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
于红志: "迭代函数系统图像的绘制研究", 《现代计算机(专业版)》 *

Also Published As

Publication number Publication date
CN108921917B (en) 2022-05-03

Similar Documents

Publication Publication Date Title
WO2021068331A1 (en) Web page adaptive layout method, server and computer-readable storage medium
JP6495378B2 (en) Selective rasterization
JP4824687B2 (en) Efficient rasterization of graphic data cache
KR101952983B1 (en) System and method for layering using tile-based renderers
US20150070379A1 (en) Techniques to manage color representations for a digital map
US9286858B2 (en) Hit testing method and apparatus
CN106651996B (en) Element hierarchy management method and device in manuscript editing tool
CN114626134B (en) BIM-based pipeline comprehensive optimization method and device, electronic equipment and storage medium
CN110928739A (en) Process monitoring method and device and computing equipment
CN110832456A (en) Creating default layout constraints for a graphical interface
US9489771B2 (en) Techniques for spatially sorting graphics information
US10825214B2 (en) Priority based automatic placement of labels on charts
CN107391148B (en) View element saving method and device, electronic equipment and computer storage medium
CN108921917A (en) Adaptively divide shape drawing practice, equipment, system and storage medium
CN111460342B (en) Page rendering display method and device, electronic equipment and computer storage medium
CN111932198A (en) File auditing method and related product
CN111462269A (en) Image processing method and device, storage medium and electronic equipment
CN108846883A (en) Graftal fast drawing method, system, user equipment and storage medium
CN104281562A (en) Electronic document processing method and device
CN115033226A (en) Page display method and device, terminal equipment and computer readable storage medium
CN113268307A (en) Page component display method, device, equipment and storage medium
CN108182656B (en) Image processing method and terminal
CN113032071A (en) Page element positioning method, page testing method, device, equipment and medium
CN111368492A (en) Method and system for setting identification information in integrated circuit layout
CN114281456A (en) Application window display method, computing device and storage medium

Legal Events

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