Embodiment
Fig. 1 is image rasterization process flow figure provided in an embodiment of the present invention, and Fig. 2 is the present invention
The image rasterization process flow figure that embodiment is provided.The embodiment of the present invention is directed to when original image
Pixel is larger, causes memory source seriously to be consumed, in addition, also resulting in image rasterization processor
Processing speed is reduced there is provided image rasterization processing method, and specific method and step is as follows:
Step S101, acquisition raw image data and image manipulation instruction;
The executive agent of the embodiment of the present invention is image rasterization processing unit, image rasterization processing dress
Put and be arranged in grating-based processor, image rasterization processing unit includes picture syntax explanation module and figure
As processor, picture syntax instruction of the picture syntax explanation module to pdf document carries out parsing and obtains original
Image essential information and image manipulation instruction, as shown in Fig. 2 the input of picture syntax explanation module 22 is
Syntax instructions in pdf document 21, the parsing pdf document 21 of picture syntax explanation module 22 obtain original
Image essential information and image manipulation instruction, original image essential information include width, the height of original image
The essential informations such as degree, locating depth, the colour space, image manipulation instruction includes rotation instruction, translation instruction, contracting
Put instruction, cut instruction etc..The input of image processor 24 has raw image data 23 and picture syntax
The analysis result of explanation module 22 is original image essential information and image manipulation instruction, image processor
24 according to image manipulations instruction raw image data 23 is handled, and by raw image data 23,
In original image essential information and image manipulation instruction deposit disk 25, so that subsequent treatment is used.
Step S102, foundation described image operational order are carried out to the raw image data at processing acquisition
View data after reason;
As shown in Fig. 2 image processor 24 is carried out according to image manipulation instruction to raw image data 23
View data after being handled.
View data is believed relative to the position of the raw image data after step S103, the calculating processing
Breath;
For example, image manipulation instruction is specially rotation instruction, image processor 24 is carried out to original image
Rotation image is obtained after rotation, it is determined that mapping point of each pixel of rotation image in original image,
And calculate position of the mapping point relative to first pixel of original image.
Step S104, read from the raw image data and believe with the position according to the positional information
Cease corresponding destination image data.
Read from raw image data position according to the mapping point relative to first pixel of original image
The mapping point on the position is taken, because raw image data is stored in disk, image processor 24
Mapping point of each pixel of rotation image in original image need to be read from disk, is not required to from disk
Middle initial row and termination row of each pixel relative to original image for reading rotation image.
View data is believed relative to the position of raw image data after the embodiment of the present invention is handled by calculating
Breath, destination image data corresponding with positional information is read according to positional information from raw image data,
Be not required to from disk read rotation image each row of data relative to original image initial row and termination row simultaneously
Internal memory is put into, the occupancy of internal memory is greatly reduced, meanwhile, image rasterization processor only need to be from disk
Mapping point of the middle each pixel for reading rotation image in original image, is improved at image rasterization
Manage the processing speed of device.
The image rasterization process flow figure that Fig. 3 provides for another embodiment of the present invention;Fig. 4 is this
Invent the schematic diagram for the original image that another embodiment is provided;Fig. 5 provides for another embodiment of the present invention
The schematic diagram of rotated image.View data is relative to institute after detailed description calculating of the embodiment of the present invention processing
The specific method of the positional information of raw image data is stated, this method step is as follows:
Step S301, using each row data of view data after the processing as target data, determine the mesh
Mark first mapping data of first data of data in the raw image data original relative to described
First deviant of first data of view data;
Original image (rectangle part) is illustrated in figure 4, the image is carried out after 45 degree of rotations counterclockwise
Rotated image as shown in Figure 5 is obtained, each row data is target datas using in Fig. 5, it is assumed that where AB
Some rows of behavior rotated image, the embodiment of the present invention is illustrated with behavior example, every to other
The processing method of a line and the row are that AB processing method is consistent, and specific processing method is:During according to rotation
The transposed matrix M set in PDF determines that AB is expert at first data i.e. point A in Fig. 4 original images
The first mapping point A ', due to A=A ' * M, then A '=A*M ' (M ' is the inverse matrix of Metzler matrix).By
Fig. 4 understands first pixel that point 0 is original image, then can determine that A ' phases according to the A ' calculated
For the first deviant of point 0, it is assumed that the first mapping point A ' coordinate is (x, y), original image
Width be W, then first deviant offset=(W+7) * (y-1)/8 byte.
Step S302, determine any data in the target data in addition to first data in institute
State second deviant of the second mapping data relative to the described first mapping data in raw image data;
Assuming that B points be expert at by AB in any one data in addition to first data i.e. point A, similarly
Second mapping of the B points in raw image data is can determine that according to the mapping relations between point A and point A '
Point B ', and determine point B ' relative to point A ' according to the position relationship between Fig. 4 midpoints A ' and point B '
The second deviant, and second deviant rowOffset=(x+7)/8 byte.
Step S303, according to first deviant and second deviant determine it is described second mapping number
According to the 3rd deviant of first data relative to the raw image data, the 3rd deviant is
Any data in the target data in addition to first data is relative to the raw image data
Positional information.
According to second deviants of the point B ' relative to point A ' and point A ' relative to the first deviant for putting 0
Threeth deviants of the point B ' relative to point 0 can be calculated, the 3rd deviant is equal to the first deviant offset
Plus the second deviant rowOffset, where the 3rd deviant is AB for some rows of rotated image
Positional information of any data relative to raw image data in row in addition to first data.
The embodiment of the present invention calculates target data using each row data of view data after handling as target data
In each mapping point of the data in raw image data, and calculate the mapping point relative to original image number
Obtained in the deviant of first data in, the raw image data stored according to the deviant from disk
Take the corresponding data of mapping point, it is to avoid image rasterization processor reads often going for rotation image from disk
Data relative to original image initial row and termination row and be put into internal memory, greatly reduce the occupancy of internal memory
Rate, meanwhile, image rasterization processor need to only read each pixel of rotation image in original from disk
Mapping point in beginning image, improves the processing speed of image rasterization processor.
The image rasterization processing method that Fig. 6 provides for another embodiment of the present invention;Fig. 7 is another for the present invention
What one embodiment was provided does not cut image schematic diagram;After the cutting that Fig. 8 provides for another embodiment of the present invention
Image schematic diagram.On the basis of the corresponding embodiments of Fig. 3, the embodiment of the present invention is comprised the following steps that:
Step S601, acquisition raw image data and image manipulation instruction, described image operational order include
Rotation instruction and cutting instruction;
On the basis of above-described embodiment, described image operational order specifically includes rotation instruction and cutting refers to
Order, cuts instruction and specifically includes clipping region.
Step S602, according to it is described cut instruction to the raw image data carry out cut obtain effectively figure
As data;
As shown in fig. 7, original image is 62, clipping region is 61, original image 62 and clipping region
61 lap is the effective image after cutting, as shown in figure 8, effective image is represented with 63,
In addition, the corresponding data of original image are raw image data, the corresponding data of effective image are effectively figure
As data.
Step S603, rotation is carried out to the effective image data according to the rotation instruction obtain the place
View data after reason;
Effective image 63 in the embodiment of the present invention is specifically as follows the image in Fig. 4, to effective image number
Rotated according to image of the process of view data after the rotation acquisition processing similarly in Fig. 4 is carried out
Process, here is omitted.
View data is believed relative to the position of the raw image data after step S604, the calculating processing
Breath;
Step S605, read from the raw image data and believe with the position according to the positional information
Cease corresponding destination image data.
Step S604 and step S605 methods corresponding with above-described embodiment are consistent, and here is omitted.
The embodiment of the present invention carries out rotating and can dropping by cutting original image to the image after cutting
The data processing amount of low image rasterization processor.
The image rasterization process flow figure that Fig. 9 provides for another embodiment of the present invention;Figure 10 is this
That invents another embodiment offer does not rotate image segmentation schematic diagram;Figure 11 carries for another embodiment of the present invention
The rotated image stepwise schematic views of confession.On the basis of the corresponding embodiments of Fig. 6, the embodiment of the present invention
Comprise the following steps that:
Step S901, acquisition raw image data and image manipulation instruction, described image operational order include
Rotation instruction and cutting instruction;
Step S902, according to it is described cut instruction to the raw image data carry out cut obtain effectively figure
As data;
Step S903, the size for calculating the effective image data committed memory;
On the basis of above-described embodiment, the size of the data committed memory of effective image 63 is calculated, specifically
Computational methods be the size that the effective image data committed memory is calculated according to formula s=w*h*b/8
S, wherein, w represents the width of the effective image data, and h represents the height of the effective image data,
B represents the locating depth of the raw image data.
In step S904, size and raster image processor according to the effective image data committed memory
The size of image buffer calculates division number;
According to image buffer in the size s and raster image processor of effective image data committed memory
The formula that size bufferSize calculates the division number is n=(s+bufferSize-1)/bufferSize, wherein,
N represents the division number.
Step S905, according to the division number to the effective image data carry out segment processing;
Reasonable assumption, the division number that above-mentioned steps are calculated is 3, as shown in Figure 10, by effective image
63 points are 3 sections.
Step S906, the effective image data after segment processing are carried out with rotation obtain image after the processing
Data, view data includes multiple segmentations after the processing;
Rotation is carried out to the effective image data after segment processing and obtains postrotational image 64, is drawn after rotation
The segmentation divided is constant as shown in figure 11,.
Step S907, each row of data is calculated after the processing in each segmentation of view data relative to described
The positional information of raw image data;
Each row of data is calculated in each segmentation of postrotational image 64 relative to the raw image data
Positional information, computational methods are similarly in the method described in the corresponding embodiments of Fig. 3.
Step S908, read from the raw image data and believe with the position according to the positional information
Cease corresponding destination image data.
The embodiment of the present invention by effective image data carry out segment processing, reduce image rotation during
Shared memory source, is reduced caused by low memory system carries out frequently data disk caching
Time overhead.
Figure 12 is the structure chart of image rasterization processing unit provided in an embodiment of the present invention.The present invention is implemented
The image rasterization processing unit that example is provided can perform the place of image rasterization processing method embodiment offer
Flow is managed, as shown in figure 12, image rasterization processing unit 120 includes acquisition module 121, at image
Module 122, computing module 123 and read module 124 are managed, wherein, acquisition module 121 is used to obtain original
Beginning view data and image manipulation instruction;Image processing module 122 is used for according to described image operational order
View data after being handled is carried out to the raw image data;Computing module 123 is used to calculate
Positional information of the view data relative to the raw image data after the processing;Read module 124 is used
In reading target corresponding with the positional information from the raw image data according to the positional information
View data.
View data is believed relative to the position of raw image data after the embodiment of the present invention is handled by calculating
Breath, destination image data corresponding with positional information is read according to positional information from raw image data,
Be not required to from disk read rotation image each row of data relative to original image initial row and termination row simultaneously
Internal memory is put into, the occupancy of internal memory is greatly reduced, meanwhile, image rasterization processor only need to be from disk
Mapping point of the middle each pixel for reading rotation image in original image, is improved at image rasterization
Manage the processing speed of device.
On the basis of above-described embodiment, computing module 123 is specifically for view data after the processing
Each row data be target data, determine first data of the target data in the original image number
First deviant of the first mapping data relative to first data of the raw image data in;
Determine any data in the target data in addition to first data in the raw image data
In second mapping data relative to described first mapping data the second deviant;It is inclined according to described first
Shifting value and second deviant determine the second mapping data relative to the of the raw image data
3rd deviant of one data, the 3rd deviant be the target data in remove first number
Positional information of any data relative to the raw image data outside.
Described image operational order includes rotation instruction and cuts instruction;Image processing module 122 is specifically used
Instructed according to described cut to raw image data progress cutting acquisition effective image data;Foundation
The rotation instruction carries out rotation to the effective image data and obtains view data after the processing.
Image processing module 122 is additionally operable to calculate the size of the effective image data committed memory;Foundation
The big subtotal of image buffer in the size and raster image processor of the effective image data committed memory
Calculate division number;Segment processing is carried out to the effective image data according to the division number;To segmentation
Effective image data after processing carry out rotation and obtain view data, image after the processing after the processing
Data include multiple segmentations;Computing module 123 is specifically for calculating each of view data after the processing
Positional information of each row of data relative to the raw image data in segmentation.
Computing module 123 according to formula (1) specifically for calculating the effective image data committed memory
Size:
S=w*h*b/8 (1)
Wherein, s represents the size of the effective image data committed memory, and w represents the effective image number
According to width, h represents the height of the effective image data, and b represents the locating depth of the raw image data;
The division number is calculated according to formula (2):
N=(s+bufferSize-1)/bufferSize (2)
Wherein, n represents the division number, and bufferSize represents that image delays in the raster image processor
Rush the size in area.
Image rasterization processing unit provided in an embodiment of the present invention can be specifically for performing above-mentioned Fig. 1 institutes
The embodiment of the method for offer, here is omitted for concrete function.
The embodiment of the present invention calculates target data using each row data of view data after handling as target data
In each mapping point of the data in raw image data, and calculate the mapping point relative to original image number
Obtained in the deviant of first data in, the raw image data stored according to the deviant from disk
Take the corresponding data of mapping point, it is to avoid image rasterization processor reads often going for rotation image from disk
Data relative to original image initial row and termination row and be put into internal memory, greatly reduce the occupancy of internal memory
Rate, meanwhile, image rasterization processor need to only read each pixel of rotation image in original from disk
Mapping point in beginning image, improves the processing speed of image rasterization processor;By to original image
Cut, the data processing amount of image rasterization processor can be reduced by carrying out rotation to the image after cutting;
By carrying out segment processing to effective image data, shared memory source during image rotation is reduced,
Reduce the time overhead caused by low memory system carries out frequently data disk caching.
In summary, view data is relative to raw image data after the embodiment of the present invention is handled by calculating
Positional information, target figure corresponding with positional information is read from raw image data according to positional information
As data, be not required to read from disk each row of data of rotation image relative to the initial row of original image and
Termination row is simultaneously put into internal memory, greatly reduces the occupancy of internal memory, meanwhile, image rasterization processor is only
Mapping point of each pixel of rotation image in original image need to be read from disk, image is improved
The processing speed of grating-based processor;Each row data of view data are calculated as target data using after processing
Each mapping point of the data in raw image data in target data, and the mapping point is calculated relative to original
The deviant of first data in beginning view data, the original image stored according to the deviant from disk
The corresponding data of mapping point are obtained in data, it is to avoid image rasterization processor reads rotation figure from disk
The each row of data of picture relative to original image initial row and termination row and be put into internal memory, greatly reduce in
The occupancy deposited, meanwhile, image rasterization processor need to only read each picture of rotation image from disk
Mapping point of the vegetarian refreshments in original image, improves the processing speed of image rasterization processor;By right
Original image is cut, and the number of image rasterization processor can be reduced by carrying out rotation to the image after cutting
According to treating capacity;By carrying out segment processing to effective image data, reduce shared by during image rotation
Memory source, reduce because low memory system carry out frequently data disk caching caused by time open
Pin.
In several embodiments provided by the present invention, it should be understood that disclosed apparatus and method,
It can realize by another way.For example, device embodiment described above is only schematical,
For example, the division of the unit, only a kind of division of logic function, can have in addition when actually realizing
Dividing mode, such as multiple units or component can combine or be desirably integrated into another system, or
Some features can be ignored, or not perform.It is another, shown or discussed coupling each other or
Direct-coupling or communication connection can be the INDIRECT COUPLING or communication link of device or unit by some interfaces
Connect, can be electrical, machinery or other forms.
The unit illustrated as separating component can be or may not be it is physically separate, make
It can be for the part that unit is shown or may not be physical location, you can with positioned at a place,
Or can also be distributed on multiple NEs.Can select according to the actual needs part therein or
Person's whole units realize the purpose of this embodiment scheme.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit,
Can also be that unit is individually physically present, can also two or more units be integrated in a list
In member.Above-mentioned integrated unit can both be realized in the form of hardware, it would however also be possible to employ hardware adds software
The form of functional unit is realized.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in a computer
In read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, including some fingers
Order is to cause a computer equipment (can be personal computer, server, or network equipment etc.)
Or processor (processor) performs the part steps of each embodiment methods described of the invention.And it is foregoing
Storage medium include:USB flash disk, mobile hard disk, read-only storage (Read-Only Memory, ROM),
Random access memory (Random Access Memory, RAM), magnetic disc or CD etc. are various can be with
The medium of store program codes.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each
The division progress of functional module is for example, in practical application, as needed can divide above-mentioned functions
With by different functional module completions, i.e., the internal structure of device is divided into different functional modules, with
Complete all or part of function described above.The specific work process of the device of foregoing description, can be with
With reference to the corresponding process in preceding method embodiment, it will not be repeated here.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than right
It is limited;Although the present invention is described in detail with reference to foregoing embodiments, this area it is common
Technical staff should be understood:It can still modify to the technical scheme described in foregoing embodiments,
Or equivalent substitution is carried out to which part or all technical characteristic;And these modifications or replacement, and
The essence of appropriate technical solution is not set to depart from the scope of various embodiments of the present invention technical scheme.