Summary of the invention
Technical matters to be solved by this invention is to provide a kind of method of printing image, expends many memory headrooms to solve in the prior art, and wastes the problem of a lot of times aspect the transmission between printed driver and printer.
To achieve these goals, the invention provides a kind of method of printing image, be applied to a printed driver and a printer, include the following step: step 101, described printed driver is obtained the data of raw video and the data of image as a result, the data of wherein said raw video include an original initial point, one original length and an original width, the data of described image as a result include an initial point as a result, one length and one width as a result as a result, and described image as a result for the image processing of described raw video being done to amplify/dwindle by described printed driver after gained; Step 102, described printed driver calculates scaling according to the data of described raw video and the data of described image as a result; Step 103, described printed driver confirm that whether scaling is greater than 1; If scaling is greater than 1, then: step 104, described printed driver are transmitted the data of described raw video and described scaling to printer; Step 105, described printer receive the data and the described scaling of described raw video; Step 106, described printer are carried out processing and amplifying according to described scaling to described raw video and are become described image as a result; And step 107, the described image as a result of described printer prints, and end operation; If scaling is less than 1 or equal 1, then: step 108, described printed driver are dwindled described raw video according to described scaling and are processed into described image as a result; Step 109, described printed driver are transmitted described image as a result to described printer; Step 110, described printer receive described image as a result; And step 111, the described image as a result of described printer prints, and end operation.
For the better above-mentioned purpose that realizes, the present invention also provides the method for another kind of printing image, its characteristics are, include the following step: step 201, described printed driver is obtained the data of a raw video, one as a result image data and one the cutting block data, the data of wherein said raw video include an original initial point, one original length and an original width, the data of described image as a result include an initial point as a result, one length and one width as a result as a result, and described image as a result for the image processing of described raw video being done to amplify/dwindle by described printed driver after gained, and described cutting block is from the described image that image cut down as a result, and the data of cutting block are from described image data as a result; Step 202, described printed driver calculates a scaling according to the data of described raw video and the data of described image as a result; Step 203, described printed driver confirms that whether described scaling is greater than 1: if scaling is greater than 1, step 204 then, described printed driver calculates the common factor part of described image as a result and described cutting block, to obtain described cutting block; Step 205, described printed driver be according to the regional corresponding relation of the data of the data of described cutting block and described image as a result, and calculate the data that have a corresponding block of same area corresponding relation with the data of described raw video; Step 206, described printed driver calculates an error displacement according to the data of described cutting block and the data of described corresponding block; Step 207, described printed driver are transmitted the data of described corresponding block, described error displacement and described scaling to described printer; Step 208, described printer receive the data of described corresponding block, described error displacement and described scaling; Step 209, described printer are carried out the image processing and amplifying according to described scaling and described error displacement to described corresponding block and are become described cutting block; And step 210, the described cutting block of described printer prints, and end operation; If scaling is less than 1 or equal 1, step 211 then, described printed driver carries out image according to described scaling to described raw video to be dwindled and is processed into described image as a result; Step 212, described printed driver cuts described image as a result according to the data of described cutting block; Step 213, described printed driver are transmitted described cutting block to described printer; Step 214, described printer receive described cutting block; And step 215, the described cutting block of described printer prints, and end operation.
Effect of the present invention is, after by printed driver raw video being done image processing, can be transferred to printer, the image processing of being correlated with by printer, so, just can solve and expend many memory headrooms in the past, and aspect the transmission between printed driver and printer, spend many times, and problem that can't speed up processing.
Describe the present invention below in conjunction with the drawings and specific embodiments, but not as a limitation of the invention.
Embodiment
See also Fig. 1, be the raw video and the synoptic diagram of image as a result, the initial image of raw video 10 for carrying out image processing by printed driver, and the data of raw video 10 include original initial point (SrcX, SrcY), original length (SrcY), original width (SrcX), as a result image 20 for the image processing of raw video being amplified/dwindling by printed driver after resulting image, and as a result the data of image 20 include as a result initial point (DestX, DestY), length (DestY), width (DestX) as a result as a result.
Fig. 2 A, 2B are that the method includes the following step to the flow process that raw video dwindles or amplified images is handled for printing the process flow diagram of the method for image among the present invention, also please refer to Fig. 1 simultaneously.
Step 101, printed driver obtain the data of raw video and the data of image as a result, to carry out follow-up image processing step, certainly the data of these raw videos and as a result the data of image introduce in front.
Step 102, printed driver calculates scaling according to the data of raw video and the data of image as a result, just with raw video as benchmark, calculate raw video is dwindled or amplification multiple, just can obtain image as a result.
Step 103, printed driver confirms that whether scaling is greater than 1, if, the expression raw video must amplify, just can obtain image as a result, and proceed step 104, if not, the expression raw video must dwindle, just can obtain image as a result, so execution in step 108 is dwindled raw video according to scaling to be processed into image as a result, step 109 by printed driver, again by printed driver transmission as a result image to printer, step 110, and receive image as a result by printer, and step 111, printer prints is image as a result, therefore the image processing of raw video being dwindled at printed driver after becoming as a result image, just can make printer prints go out image as a result.
Step 104, the data of printed driver transmission raw video and scaling carry out follow-up flow process to printer for printer.
Then execution in step 105, printer receives the data and the scaling of raw video, and step 106 becomes image as a result so printer carries out processing and amplifying according to scaling to raw video, and final step 107 is by printer prints image as a result.
Therefore, after by printed driver raw video being done image processing, can be transferred to printer, afterwards, do relevant image processing, so by printer, just can solve and expend many memory headrooms in the past, and aspect the transmission between printed driver and printer, spend many times, and problem that can't speed up processing.
See also Fig. 3, be raw video, image as a result, the synoptic diagram of cutting block and corresponding block, the initial image of raw video 10 for carrying out image processing by printed driver, and the data of raw video 10 include original initial point (SrcX, SrcY), original length (SrcY), original width (SrcX), image 20 is for being amplified the image of gained after the image processing of dwindling to raw video by printed driver as a result, and the data of image 20 include initial point (DestX as a result as a result, DestY), length (DestY) as a result, width (DestX) as a result, the image of cutting block 50 for being cut down from image 20 as a result, the regional corresponding relation of corresponding block 30 and 10 of raw videos are then and cut block 50 and the regional corresponding relation of 20 of images is identical as a result.
As for Fig. 4 A, 4B, 4C is another process flow diagram of printing the method for image among the present invention, be that raw video is done to dwindle or amplify, and the flow process of the image processing of cutting, the method includes the following step, also see also simultaneously Fig. 3, be raw video, the synoptic diagram of image, cutting block and corresponding block as a result.
Step 201, printed driver obtain the data of raw video, as a result image data and the cutting block data, to carry out the step of follow-up image processing, certainly the data of these raw videos, as a result image data and the cutting block data did introduction in front.
Step 202, printed driver calculates scaling according to the data of raw video and the data of image as a result, just with raw video as benchmark, calculate raw video is dwindled or amplification multiple, just can obtain image as a result.
Step 203, printed driver confirms that whether scaling is greater than 1, if, the expression raw video must amplify, just can obtain image as a result, and proceed step 204, if not, the expression raw video must dwindle, just can obtain image as a result, so carry out step 211, according to scaling raw video is dwindled being processed into image as a result, step 212 by printed driver, image is as a result cut according to the data of cutting block by printed driver again, step 213, and printed driver transmission cutting block is to printer, step 214, and by printer reception cutting area piece, step 215, and printer prints cutting block, the therefore image processing of raw video being dwindled at printed driver, after becoming as a result image, just cut,, and make printer prints go out to cut block with one-tenth cutting block.
Step 204, printed driver calculate the common factor part of image as a result and cutting block, to obtain cutting block.
Step 205, printed driver is according to the data and the regional corresponding relation of the data of image as a result of cutting block, and calculate the data that have the corresponding block of same area corresponding relation with the data of raw video, image processing part of this time being done just, be by the regional corresponding relation of image as a result, obtain the regional corresponding relation of raw video and corresponding block with the cutting block.
Step 206, printed driver is according to the data of cutting block and the data of corresponding block, calculate the error displacement, as shown in the figure, when scaling is three (just amplifying three times), lines L1 in raw video, L2, L3 also will be exaggerated three times, so necessary error of calculation displacement, which bar line of lines is corresponding to which lines in the raw video after just obtaining amplifying, it is effective lines that the second line of L3 shown in the figure begins, be the error displacement (OffsetY) aspect length, certainly, also there is identical situation the width aspect.
Step 207, printed driver are transmitted data, error displacement and the scaling of corresponding block to printer, carry out follow-up flow process for printer.
Then, step 208, printer receives data, error displacement and the scaling of corresponding block, so carry out step 209, printer carries out the image processing and amplifying according to scaling and error displacement to corresponding block and becomes the cutting block, and is last, step 210 is by printer prints cutting block.
Certainly, the present invention also can have other various embodiments, and under the situation that does not deviate from spirit of the present invention and essence thereof, the structure of device can be improved through further, but these corresponding changes all should belong to the protection domain of the appended claim of invention.