The entire disclosure of Japanese Patent Application No. 2008-023825, filed Feb. 4, 2008 is expressly incorporated by reference herein.
1. Technical Field
The present invention relates to an image processing method, a program thereof, and an image processing apparatus.
2. Related Art
As general image processing methods for drawing a diagram by approximating an object such as a curve by using a plurality of segments, methods in which a curve is divided finely for areas near contact points that are brought into contact with other lines forming a tangent line of the curve and is divided roughly for the other areas, and a drawing process is performed by approximating the divided curves by using straight lines have been proposed (for example, see JP-A-8-297747). According to the image processing method disclosed in JP-A-8-297747, an approximated curve and a tangent line thereof can be formed smoothly without incurring a decrease in the processing speed.
However, in drawing an object, the transmittance for transmitting the background may be set. As described above, in a case where the transmittance is set for an object, when the image processing method disclosed JP-A-8-297747 is performed, the transmittance is set for each straight line that is divided and approximated. Thus, for a part in which the straight lines are overlapped with each other, the transmittance is overlapped with each other, as well. Accordingly, the object to be drawn in one color may have different colors in a part in which the divided straight lines are overlapped with each other and a part in which the divided straight lines are not overlapped with each other. In order to avoid this, for example, a method in which an object, for which the transmittance is set for an area, is expanded in a non-transmission state, then, the object is transmitted, and the transmitted object is incorporated into an image may be considered. However, for a case where the process for drawing is complicated or there is a plurality of objects, there are disadvantages that the drawing speed is decreased and the like.
An advantage of some aspects of the invention is that it provides an image processing method, a program thereof, and an image processing apparatus capable of suppressing a decrease in the drawing speed and drawing with appropriate transmission in drawing an object by using a plurality of parts.
According to a first aspect of the invention, there is provided an image processing method for generating a bit map image of an object from a vector image by superimposing a plurality of parts by using a computer software program. The image processing method includes: (a) assigning unique identification information to a drawing command in a case where designation for transmission is included in the drawing command that is a command for drawing the object by using the plurality of parts; (b) determining whether identification information that is assigned to a drawing position in which a drawing process is performed and the identification information that is assigned to the drawing command coincide with each other in a case where the drawing process is performed based on the drawing command to which the unique identification information is assigned; and (c) assigning the identification information that is assigned to the drawing command to the drawing position and performing a drawing process for the drawing position based on the drawing command, for a case where the identification information does not coincide with each other and not performing the drawing process for the drawing position base on the drawing command for a case where the identification information coincide with each other.
According to the above-described image processing method, unique identification information is assigned to a drawing command in a case where designation for transmission is included in the drawing command that is a command for drawing the object by using the plurality of parts, and whether identification information that is assigned to a drawing position in which a drawing process is performed and the identification information that is assigned to the drawing command coincide with each other is determined in a case where the drawing process is performed based on the drawing command to which the unique identification information is assigned. Then, the identification information that is assigned to the drawing command is assigned to the drawing position and a drawing process for the drawing position is performed based on the drawing command, for a case where the identification information does not coincide with each other. On the other hand, the drawing process for the drawing position on the basis of the drawing command is not performed for a case where the identification information coincides with each other. As described above, when the object is drawn by superimposing a plurality of parts, unique identification information is assigned to a drawing part for a case where transmission is designated, and thereby transmitted parts are not drawn repeatedly for the parts having same identification information. Accordingly, for example, a decrease in the drawing speed can be suppressed, compared to a case where the object that is designated for transmission for an area thereof is expanded in a non-transmission state, then, this object is transmitted, and the transmitted object is incorporated into the image. In addition, a drawing process can be performed with appropriate transmission. Here, “the identification information coincides with each other” includes a complete coincidence. In addition, for example, for a case where a plurality of identification information is assigned to a drawing position or the like, partial coincidence of the plurality of identification information is included therein. At this moment, in a case where a drawing process is performed with the identification information, which is assigned to the drawing command, assigned to the drawing position in determining whether the identification information coincides with each other, the identification information may be assigned to the drawing area drawn by the drawing command.
In the above-described image processing method, the identification information may be assigned to brush information that is included in the drawing command in the assigning of the unique identification information to the drawing command. The brush information is the same within a same object, and thus, in such a case, a drawing process for an object that is transmitted more assuredly can be performed.
In addition, in the above-described image processing method, in a case where the drawing process for the drawing position is performed by assigning the identification information that is assigned to the drawing command to the drawing position, color information may be set to the drawing position, and simultaneously the identification information may be assigned to a layer different from that of the color information that is set in the drawing position, in determining whether the identification information coincides with each other. In such a case, the images can be uniformly handled as images for which transmission is not designated and images for which transmission is designated, and accordingly, the processing efficiency is improved.
In addition, in the above-described image processing method, in a case where the drawing process for the drawing position is performed based on the drawing command, the color information for the drawing position may be set based on the color information that is set currently in the drawing position and the color information that is set by the drawing command, and simultaneously transmittance of the drawing position may be set based on a transmittance value currently set in the drawing position and a transmittance value that is included in the designation for transmission of the drawing command, in determining whether the identification information coincides with each other. In addition, the image processing method may further include: (d) generating the bit map image based on the set color information and the set transmittance after all the drawing processes are completed. In such a case, the drawing process is repeated in a state in which the color of the next object is superimposed with that of the currently drawing object. Accordingly, the objects are not needed to be managed in a plurality of areas so as to reflect the transmittance for generating a bit map image. In addition, in such a case, for example, compared to a case where a bit map image is generated by expanding a plurality of objects for which the transmittance is set in a plurality of areas and superimposing the plurality of objects with the transmittance reflected, the storage area can be reduced, and the decrease in the drawing speed can be suppressed.
According to a second aspect of the invention, there is provided a program for allowing one or more computers to execute steps of the above-described image processing method. This program may be recorded in a computer-readable recording medium (for example, a hard disk, a ROM, an FD, a CD, a DVD, or the like) or may be transferred from a computer to another computer through a transmission medium (a communication network such as the Internet or a LAN). Furthermore, the program may be transferred in any other form. When this program is executed in one computer or is executed in a plurality of computers with the steps divided therein, the steps of the above-described image processing method are performed, and accordingly, the same advantages as those of this image processing method can be acquired.
According to a third aspect of the invention, there is provided an image processing apparatus that generates a bit map image of an object from a vector image by superimposing a plurality of parts. The image processing apparatus includes: an identification information assigning unit that assigns unique identification information to a drawing command in a case where designation for transmission is included in the drawing command that is a command for drawing the object by using the plurality of parts; a determination unit that determines whether identification information that is assigned to a drawing position in which a drawing process is performed and the identification information that is assigned to the drawing command coincide with each other in a case where the drawing process is performed based on the drawing command to which the unique identification information is assigned; and a drawing unit that assigns the identification information that is assigned to the drawing command to the drawing position and performs the drawing process for the drawing position based on the drawing command, for a case where the identification information does not coincide with each other and does not perform the drawing process for the drawing position based on the drawing command for a case where the identification information coincide with each other.
According to the above-described image processing apparatus, unique identification information is assigned to a drawing command in a case where designation for transmission is included in the drawing command that is a command for drawing the object by using the plurality of parts, and whether identification information that is assigned to a drawing position in which a drawing process is performed and the identification information that is assigned to the drawing command coincide with each other is determined in a case where the drawing process is performed based on the drawing command to which the unique identification information is assigned. Then, the identification information that is assigned to the drawing command is assigned to the drawing position and a drawing process for the drawing position is performed based on the drawing command, for a case where the identification information does not coincide with each other. On the other hand, the drawing process for the drawing position on the basis of the drawing command is not performed for a case where the identification information coincides with each other. As described above, when the object is drawn by superimposing a plurality of parts, unique identification information is assigned to a drawing part for a case where transmission is designated, and thereby transmitted parts are not drawn repeatedly for parts having same identification information. Accordingly, for example, a decrease in the drawing speed can be suppressed, compared to a case where the object that is designated for transmission for an area thereof is expanded in a non-transmission state, then, this object is transmitted, and the transmitted object is incorporated into the image. In addition, a drawing process can be performed with appropriate transmission. In addition, in the above-described image processing apparatus, various steps of the above-described image processing methods may be performed.
In the above-described image processing apparatus, in a case where the drawing process for the drawing position is performed based on the drawing command, the drawing unit may set the color information for the drawing position based on the color information that is set currently in the drawing position and the color information that is set by the drawing command, simultaneously set transmittance of the drawing position based on a transmittance value currently set in the drawing position and a transmittance value that is included in the designation for transmission of the drawing command, and generate the bit map image based on the set color information and the set transmittance after all the drawing processes are completed. In such a case, the drawing process is repeated in a state in which the color of the next object is superimposed with that of the currently drawing object. Accordingly, the objects are not needed to be managed in a plurality of areas so as to reflect the transmittance for generating a bit map image. In addition, in such a case, the storage area can be reduced, and the decrease in the drawing speed can be suppressed.
The invention will be described with reference to the accompanying drawings, wherein like numbers reference like elements.
Next, a preferred embodiment of the invention will be described with reference to the accompanying drawings.
Next, the operations of the printer 20 according to this embodiment that is configured as above will be described, and first, the operation for forming a state in which the drawing command of the XPS can be executed will be described.
When the drawing list 50 is generated, the CPU 22 determines whether the transmittance value included in the drawing information is “1” (Step S110). When the transmittance value is not “1”, that is, when this part is to be drawn to be transmitted, a brush ID that is unique to each object is assigned to the drawing information (Step S120). At this moment, the brush information of a plurality of parts constituting an object is common to the object. Thus, the brush ID that is an identifier unique to the brush information of each drawing information is configured to be assigned to the brush information of each drawing information, so that drawing of a different object can be determined for a case where the brush ID is changed.
After Step S120 or when the transmittance value is “1” in Step S110, it is determined whether there is other drawing information that has not been processed (Step S130). When there is other drawing information, the CPU 22 repeats the processes of Step S110 and thereafter. On the other hand, when there is no other drawing information that has not been processed in Step S130, this routine is stopped. As described above, relating to a drawing command for transmitted drawing, a unique brush ID is assigned to the drawing command that represents an object.
Subsequently, the process for generating a bit map image from a vector image by executing a drawing command will be described.
Next, the CPU 22 reads out a brush ID that is assigned to the set drawing pixel and a brush ID that is assigned to drawing information to be drawn (Step S230), and it is determined whether the brush IDs match each other (Step S240). Here, the brush ID set to the brush information of the drawing information is assigned to the range for drawing an object to be transmitted, which will be described later in detail. When the brush ID is not assigned to the drawing pixel, it is configured that negative determination is made in Step S240. A plurality of brush IDs may be assigned to a pixel, as in a case where the plurality of objects designated for transmission is superimposed or the like. However, here, it is configured to be positively determined in Step S240 when any one of the plurality of brush IDs of the drawing pixel side matches the brush ID of the drawing information side.
When the brush IDs are determined not to match each other in Step S240, a part already drawn is regarded to be different from the object to be drawn, and a drawing process for the drawing pixel is performed by setting the color data and transmittance based on the drawing information (Step S250). Here, the drawing process is performed by setting the color data of the drawing pixel based on the color data currently set in the drawing pixel and the color data included in the drawing information and setting the transmittance of the drawing pixel based on the transmittance value currently set in the drawing pixel and the transmittance value included in the drawing information. This setting of the color data is performed by using a numeric equation that is determined in advance for forming an appropriate color by superimposing the objects. In addition, the setting of the transmittance is performed by multiplying the currently set transmittance value and the transmittance value included in the drawing information. As described above, by painting the drawing range in a superimposing manner, for example, individual generation and management of a sheet of each object are omitted.
Next, the CPU 22 assigns the brush ID, which is unique to an object, that is assigned to the drawing information to the drawn pixel (Step S260).
On the other, when the brush IDs are determined to match each other in Step S240, this drawing pixel is regarded as a part of a series of parts that constitute the object to be drawn. Thus, the drawing process is not performed for this drawing pixel, and processes of Step S270 and thereafter are performed. Accordingly, in drawing an object to be transmitted, performing a process of transmitting the parts in a superimposing manner in an area, in which the parts are overlapped each other, can be prevented.
After Step S260 or the brush IDs are determined to match each other in Step S240, the CPU 22 determines whether all the drawing processes for the drawing range are completed (Step S270). When the drawing processes are not completed, the processes of Step S220 and thereafter are repeated. On the other hand, when the drawing processes are completed, the CPU 22 determines whether the drawing processes for all the drawing information are completed (Step S280). When all the drawing processes for all the drawing information are not completed, the processes of Step S200 and thereafter are performed. On the other hand, when all the drawing processes for the all drawing information are completed, a bit map image is generated by reflecting the transmittance in the color information of each pixel (Step S290), and then, this routine is completed.
Here, the process for drawing an object to be transmitted will be described in detail with reference to
The bit map image that is acquired by performing the above-described drawing process is used for a printing process performed by the printing mechanism 25 or is resized for being used for a display process in the display unit 28a or the like. In addition, although the drawing process for the object to be transmitted is described here, in order to draw an object not to be transmitted, it is preferable that the above-described processes are performed with Steps S230, S240, and S260 of the above-described routine for performing transmitted image drawing omitted.
Here, relationship between constituent elements of this embodiment and constituent elements of the invention will be described clearly. Step S120 of the routine for managing drawing that is performed by the printer 20 according to this embodiment corresponds to Step (a) of the invention, and Step S240 of the routine for performing transmitted image drawing corresponds to Step (b), Steps S240 and S250 correspond to Step (c), and Step S290 corresponds to Step (d). In addition, the controller 21 according to this embodiment corresponds to the identification information assigning unit, the determination unit, and the drawing unit, and the brush ID corresponds to unique identification information.
In the printer 20 according to this embodiment that has been described in detail as above, when designation for transmission is included in a drawing command that is a command for drawing an object by using a plurality of parts, a unique brush ID is assigned to this drawing command. When a drawing process is performed based on the drawing command to which this brush ID is assigned, it is determined whether the brush ID assigned to the drawing pixel for which the drawing process is performed and the brush ID assigned to this drawing command coincide with each other. When the brush IDs do not coincide with each other, the brush ID of the drawing command side is assigned to the drawing pixel, and the drawing process is performed. On the other hand, when the brush IDS coincide with each other, the drawing process for the drawing pixel on the basis of this drawing command is not performed. As described above, in a case where the object is drawn by superimposing a plurality of parts, when transmission is designated, a brush ID is assigned to a drawing part, and for parts having a same brush ID, the transmitted part is not drawn in a superimposing manner. Accordingly, a decrease in the drawing speed can be suppressed, and the drawing process can be performed with appropriate transmission, compared to a case where the object designated for transmission is expanded in a non-transmission state in an area, then, the object is transmitted, and incorporating the transmitted object into an image. In addition, since the brush ID is assigned to the brush information that is changed by the object, a drawing process for an object that is transmitted more assuredly can be performed. Moreover, in the drawing process, the brush ID is assigned to a separate layer (sheet) different from that of the color data. Accordingly, in an image, objects designated for transmission and objects designated for non-transmission can be handled uniformly, and thereby the processing efficiency is high. Furthermore, in the drawing process, a process for superimposing the color data and the transmittance of the drawing pixel is performed. Accordingly, by omitting managing the object in a plurality of sheets, a decrease of the storage area such as the RAM 24 can be achieved, and a decrease in the drawing speed can be suppressed, compared to a case where the bit map image is generated by expanding, for example, a plurality of objects for which the transmittance is set in a plurality of sheets and joining the plurality of objects in a superimposing manner with the transmittance reflected.
The invention is not limited to the above-described embodiment at all. In addition, it is apparent that the invention may be performed in various forms as long as it belongs to the technical scope of the invention.
For example, in the above-described embodiment, the brush ID is assigned to the brush information. However, the invention is not limited thereto, and it is preferable that the brush ID is assigned to the drawing information. In addition, in the above-described embodiment, the brush ID is assigned to the drawing pixel. However, the invention is not limited thereto. Thus, the brush ID may be assigned to the drawing range. In addition, in this point, assignment of the brush ID to the drawing pixel does not mean that a case where the brush IDs are assigned to the entire drawing range is excluded.
In the above-described embodiment, the brush ID is configured to be stored in a sheet that is different from the sheet of the color data. However, the invention is not limited thereto. Thus, it may be configured that the brush ID is stored in a same sheet as that of the color data.
In the above-described embodiment, the printer 20 has been described as an image processing apparatus according to an embodiment of the invention. However, the invention is not limited thereto as long as the image processing apparatus generates a bit map image of an object to be transmitted from a vector image by superimposing a plurality of parts. For example, the invention may be applied to a multiple function printer including a scanner, a printing apparatus such as a facsimile machine, or the user PC 40. In addition, the invention may be applied to an electronic apparatuses such as a cellular phone or a game device. In addition, the form of the printer 20 has been described as an image processing apparatus and an image processing method. However, a form of a program for performing the method may be implemented.
Number | Date | Country | Kind |
---|---|---|---|
JP 2008-023825 | Feb 2008 | JP | national |