The present invention relates to a technique to perform rendering and printing of a transparent object.
As a processing flow to print a document in a printer via a printer driver from an application that runs in the Windows operating system of Microsoft Corporation, there are two processing flows below. That is, a GDI (Graphics Device Interface) print path and an XPS (XML Paper Specification) print path. Further, applications that run in the Windows operating system include an application that outputs drawing data in the GDI format and an application that outputs drawing data in the XPS format, as a drawing command of a printing-target document in the case where instructions to print a document are given. In the present specification, the application that outputs drawing data in the GDI format is called a GDI application and the application that outputs drawing data in the XPS format is called an XPS application, in the case where instructions to print a document are given.
In the GDI print path, by a GDI printer driver (also called V3 printer driver), from drawing data in the GDI format, PDL data (print job) that a printer can process is created. On the other hand, in the XPS print path, by a Version 4 printer driver (hereinafter, called “V4 printer driver”) that is supported from Windows 8, from drawing data in the XPS format, PDL data (print job) for a printer is created. In the case where a print job of a document created by the GDI application is created by using this V4 printer driver, it is necessary to convert the drawing data in the GDI format into drawing data in the XPS format by an MXDC. The MXDC is the abbreviation of Microsoft XPS Document Converter.
In the case where there is a transparent object having a transparency as color information in a printing-target document, the MXDC converts a ROP drawing command to perform drawing by combining a 3-channel RGB image and a mask image into a drawing command of a 4-channel RGBA image having an alpha channel as color information. Then, the V4 printer driver creates a print job by rendering the 4-channel RGBA image having an alpha channel as color information.
In the case where a print job including a transparent object is printed by a printer, combination (alpha blending) that takes into consideration the color of another object located on the background of the transparent object is performed in the printer. This alpha blending has such a problem that a large amount of memory is used and much time is taken. As a technique to solve this problem, Japanese Patent Laid-Open No. 2006-244248 has disclosed a technique to perform alpha blending processing efficiently by using a table that describes the alpha channel.
However, in the case where the number of transparent objects included in a print job is large and the like, there is such a problem that the method of Japanese Patent Laid-Open No. 2006-244248 also takes much time for processing. Consequently, an object of the present invention is to provide an information processing apparatus that reduces the amount of used memory necessary for alpha blending processing in a printer and which enables high-speed printing processing.
The present invention is an information processing apparatus including: an overlap determination unit configured to determine, in a case where a drawing object making up page data of a print job to be output to an image forming apparatus is a transparent object having an alpha channel as color information, whether the transparent object overlaps another drawing object; and a conversion unit configured to convert, in a case where the overlap determination unit determines that the transparent object does not overlap the other drawing object, drawing data of the transparent object into drawing data of a drawing object not having an alpha channel as color information.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
In the following, with reference to the drawings, preferred embodiments of the present invention are explained as examples. However, the relative arrangement of components, the shapes of apparatuses or devices, and so on, described below are merely exemplary and are not intended to limit the scope of the present invention to only those. It should be understood that those obtained by appropriately changing and improving the embodiments described below based on the common knowledge of a person in the art in the scope not deviating from its gist also fall within the scope of the present invention.
A GDI application 11 is software for a user to create a document and give printing instructions. In the case where printing instructions are given by a user, the GDI application 11 outputs drawing data in the GDI format to an MXDC 12 as a drawing command of a printing-target document by using an API of GDI. The MXDC 12 converts the drawing data in the GDI format received from the GDI application 11 into drawing data in the XPS format. Then, the MXDC 12 outputs the converted drawing data in the XPS format to a V4 printer driver 13.
The V4 printer driver sequentially processes the drawing data to create a print job in accordance with a programming model called an XPS print filter pipeline service. Specifically, the V4 printer driver 13 has a filter pipeline 14 including a plurality of linked filters and the processing by each linked filter is performed in order. That is, a mechanism is such that by each filter sequentially processing an output of a certain filter as an input of the next linked filter, a print job (PDL data) to be output to the printer 20 is created.
In the present embodiment, the filter pipeline 14 includes two filters: a layout filter 15 that performs layout processing and a rendering filter 16 that performs rendering processing. The layout filter 15 performs layout processing, such as Nup to put together a plurality of pages of input drawing data in the XPS format into one page, and outputs drawing data in the XPS format for which layout has already been performed obtained by performing the layout processing to the rendering filter 16. The rendering filter 16 converts the input drawing data in the XPS format for which layout has already been performed into PDL data and outputs the PDL data to a port monitor 17. The processing of a transparent object in the present embodiment, to be described later, is performed by the rendering filter 16.
The XPS data analysis unit 161 analyzes the drawing data in the XPS format for which layout has already been performed, which is input from the layout filer 15, and sequentially outputs drawing data to draw one or a plurality of drawing objects. Here, the drawing object is internally aggregated data to be used to perform rendering of a drawing target. The drawing target in the present embodiment includes an image (photo and the like), a graphics, and a character. Further, the drawing object may be a transparent object having an alpha channel as color information. Hereinafter, the drawing object to draw an image is called an “image object” and the drawing object to draw a graphics is called a “graphics object”.
The image processing unit 162 performs image processing, such as enlargement, reduction, and rotation, for the drawing data of a drawing object input from the XPS data analysis unit 161 and outputs the drawing data for which the image processing has been performed. The processing of a transparent object in the present embodiment, to be described later, is performed by the image processing unit 162.
The PDL data creation unit 163 creates PDL data based on the drawing data of one or a plurality of drawing objects input from the image processing unit 162. All of the drawing data in the XPS format for which layout has already been performed, the drawing data of one or a plurality of drawing objects, and the PDL data, which are handled by these components making up the rendering filter 16, are a set of information on drawing targets and indicate the order in which the drawing targets are output. For example, in the case where there are two drawing targets that are output in the different order and these drawing targets are arranged at the same position, rendering is performed by arranging the drawing target that is later in the order (i.e., that is output later) on the drawing target that is earlier in the order (i.e., that is output earlier). In this case, the drawing targets overlap each other and part or all of the drawing target that is output earlier is covered by the drawing target that is output later.
Each of symbols 601, 603, 604, 605, 606, and 608 in
Each of symbols 602 and 607 in
On the other hand, the transparent image objects 601, 603, 604, 605, and 606 do not overlap another drawing object, but each has the alpha channel. In the case where the drawing data is converted into PDL data and transmitted to the printer 20 in the state where these transparent image objects have the alpha channel, it is necessary for the printer 20 to perform the alpha blending processing for a large number of transparent image objects. Consequently, printing takes time. Because of this, in the present embodiment, by the image processing unit 162 of the PC 10 performing white blending processing (see
First, at step S701, the image processing unit 162 determines whether there is an unprocessed drawing object among the drawing objects corresponding to the drawing data input from an XPS data analysis unit 151. In the case where the results of the determination at step S701 are affirmative, the processing advances to step S702 and on the other hand, in the case where the results of the determination are negative, the series of processing ends.
At step S702, the image processing unit 162 focuses attention on one drawing object from unprocessed drawing objects and acquires information (the number of channels of color information, the coordinates of the circumscribed rectangle, and so on) on the drawing object on which attention is focused. Hereinafter, a drawing object on which attention is focused is called a “drawing object of interest”.
At step S703, the image processing unit 162 determines whether the drawing object of interest is a transparent object. In the case where the results of the determination at step S703 are affirmative, the processing advances to step S704 and on the other hand, in the case where the results of the determination are negative, the processing advances to step S706. The determination of whether the drawing object of interest is a transparent object is performed based on the number of channels of color information input as the attribute of the drawing object of interest. That is, in the case where the number of channels of color information on the drawing object of interest is four, the drawing object of interest has RGBA color information, and therefore, it is determined that the drawing object of interest is a transparent object. On the other hand, in the case where the number of channels of color information on the drawing object of interest is three, the drawing object of interest has RGB color information, and therefore, it is determined that the drawing object of interest is not a transparent object.
At step S704, the image processing unit 162 searches the drawing object management list and determines whether there is a drawing object within the drawing object management list, which overlaps the drawing object of interest. Here, the drawing object management list is a list that is created for each page in order to manage the drawing objects making up page data of a print page, temporarily stored in the RAM 102, and then disposed of. In the drawing object management list, information, such as the identifier of a drawing object and the coordinates of a circumscribed rectangle, is held. Hereinafter, the drawing object management list is abbreviated to the “management list”. The determination of whether there is a drawing object that overlaps the drawing object of interest is performed based on the coordinates of the circumscribed rectangle of the drawing object of interest and the coordinates of the circumscribed rectangle of the drawing object registered in the management list. That is, in the case where the circumscribed rectangle of the drawing object of interest and the circumscribed rectangle of the drawing object registered in the management list overlap, it is determined that the drawing object of interest and the registered drawing object also overlap. Depending on the shape of the drawing object, even in the case where the circumscribed rectangles of the drawing objects overlap each other, this does not necessarily mean that the drawing objects overlap each other, but it is reasonable to make use of the coordinates of the circumscribed rectangle for the overlap determination from the viewpoint of the calculation cost. In the case where the results of the determination at step S704 are affirmative, the processing advances to step S706 and on the other hand, in the case where the results of the determination are negative, the processing advances to step S705.
In the case where it is determined that there is no drawing object within the management list, which overlaps the drawing object of interest (in the case of NO at step 704), another drawing object does not exist on the background side of the drawing object of interest, which is a transparent object. In this case, at step S705, the image processing unit 162 performs alpha blending processing of the drawing object of interest and the white background, i.e., processing to combine each pixel of the drawing object of interest and the white pixel of the background. Hereinafter, the alpha blending processing of the transparent object and the white background is called “white blending processing”. By the white blending processing at this step, the drawing object of interest is converted into a drawing object not having the alpha channel as color information, and therefore, the number of channels of color information that the drawing object has decreases from four to three. Here, the pixel value of RGB in the combined image having 3-channel color information obtained by the alpha blending processing is represented by expression (1) below.
pixel value (R, G, B) of combined image=pixel value (R, G, B) of foreground image×(100 [%]−transparency [%] of foreground image)+pixel value (R, G, B) of background×transparency [%] of foreground image expression (1)
As an example, the case is discussed where the white blending processing is performed for the transparent image object 601 in the present embodiment. As described above, the transparent image object 601 that becomes a foreground consists of only the completely opaque (transparency 0%) black pixels and the completely transparent (transparency 100%) white pixels. Here, the pixel value (R, G, B, A) of the black pixel of the transparent image object 601 is represented as (0, 0, 0, 0), the pixel value (R, G, B, A) of the white pixel is represented as (255, 255, 255, 100), and the pixel value (R, G, B) of the background is represented as (255, 255, 255). In this case, by expression (1), the pixel value (R, G, B) of the black pixel of the combined image becomes (0, 0, 0) and the pixel value (R, G, B) of the white pixel of the combined image becomes (255, 255, 255). In this manner, the pixel value (4-channel) of the black pixel having a transparency of 0% in the transparent image object and the pixel value (4-channel) of the white pixel having a transparency of 100% are converted into the 3-channel pixel values, respectively.
On the other hand, in the case where it is determined that there is a drawing object within the management list, which overlaps the drawing object of interest (in the case of YES at step 704), another drawing object exists on the background side of the drawing object of interest, which is a transparent object. In this case, the white blending processing is not performed. For example, in the case where the drawing object of interest is the transparent image object 608, the graphics object 607 exists on the background side of the transparent image object 608, and therefore, this corresponds to this case.
At step S706, the image processing unit 162 adds the drawing object of interest to the management list. Specifically, the identifier of the drawing object of interest and the coordinates of the circumscribed rectangle are newly described in the management list. Due to this, the drawing object of interest is managed from now on.
At step S707, the image processing unit 162 outputs the drawing data of the drawing object of interest to the PDL data creation unit 163. Next, the processing returns to step S701.
The above is the image processing accompanied by the white blending processing in the present embodiment. The processing in
By the processing of the image processing unit 162 in the present embodiment, the transparent object that does not overlap another drawing object is converted into a drawing object with no alpha channel, and therefore, the total number of transparent objects to be delivered to the PDL data creation unit 163 decreases. Consequently, the total number of transparent objects also decreases in PDL data created by the PDL data creation unit 163, and therefore, it is possible to reduce the processing load of the printer 20 and the amount of used memory in the case where the PDL data is processed in the printer 20.
As above, the processing to convert the drawing data of the transparent object into drawing data of a drawing object with no alpha channel in the case where there is no another drawing object on the background side of (behind) the transparent object is explained.
In the above-described explanation, the transparent object that becomes the foreground is supposed to be a transparent image object that draws a transparent image. However, it is also possible to apply the present embodiment to another transparent object having the alpha channel as color information and for example, it is also possible to apply the present embodiment to the transparent object of a graphics or a character whose shape is described by vector data.
Further, in the above-described explanation, the case where PDL data is created based on drawing data in the XPS format by using the V4 printer driver is explained, but it is also possible to apply the present embodiment to the V3 printer driver other than the V4 printer driver. Specifically, the case is considered where the GDI application outputs a drawing command of a 4-channel (RGBA) object to the V3 printer driver, and in this case, it is possible to apply the present embodiment.
In the first embodiment, as shown in
Symbols 801 and 802 in
At step S1001, the image processing unit 162 determines whether there is an unprocessed drawing object among the drawing objects corresponding to the drawing data input from the XPS data analysis unit 151. In the case where the results of the determination at step S1001 are affirmative, the processing advances to step S1002 and on the other hand, in the case where the results of the determination are negative, the series of processing ends.
At step S1002, the image processing unit 162 acquires information on the drawing object of interest.
At step S1003, the image processing unit 162 determines whether the drawing object of interest is a transparent object. In the case where the results of the determination at step S1003 are affirmative, the processing advances to step S1004 and on the other hand, in the case where the results of the determination are negative, the processing advances to step S1016.
At step S1004, the image processing unit 162 searches the management list and determines whether there is a drawing object within the management list, which overlaps the drawing object of interest. In the case where the results of the determination at step S1004 are affirmative, the processing advances to step S1006 and on the other hand, in the case where the results of the determination are negative, the processing advances to step S1005.
At step S1005, the image processing unit 162 performs combination processing (white blending processing) of the drawing object of interest and the white background. As described above, the processing at step S1001 to step S1005 is the same as the processing at step S701 to step S705 shown in
At step S1006, the image processing unit 162 performs the division-into-blocks processing to divide the drawing object of interest into small areas. The example of the division-into-blocks processing is as shown in
At step S1007, the image processing unit 162 determines whether there is an unprocessed block. In the case where the results of the determination at step S1007 are affirmative, the processing advances to step S1008 and on the other hand, in the case where the results of the determination are negative, the processing returns to step S1001.
At step S1008, the image processing unit 162 acquires one of unprocessed blocks (hereinafter, called “block of interest”) and performs alpha trimming processing for the block of interest. The alpha trimming processing is processing to cut off an area consisting of only pixels whose transparency is 100% from the block of interest and to cut out a rectangular area including pixels whose transparency is not 100%.
At step S1009, the image processing unit 162 determines whether the area of the trimmed block is larger than zero. In the case where the results of the determination at step S1009 are affirmative, the processing advances to step S1010 and on the other hand, in the case where the results of the determination are negative, the processing returns to step S1007 to process the next block.
At step S1010, the image processing unit 162 searches the management list and determines whether there is a drawing object within the management list, which overlaps the trimmed block. In the case where the results of the determination at step S1010 are negative, the processing advances to step S1011 and on the other hand, in the case where the results of the determination are affirmative, the processing advances to step S1012.
At step S1011, the image processing unit 162 performs the white blending processing for the trimmed block. Hereinafter, the white blending processing for the trimmed block is called “block blending processing”.
At step S1012, the image processing unit 162 determines whether the pixels making up the trimmed block do not include a pixel except for the completely transparent (transparency 100%) pixels and the completely opaque (transparency 0%) pixels. In the case where the results of the determination at step S1012 are affirmative, the processing advances to step S1013 and on the other hand, in the case where the results of the determination are negative, the processing advances to step S1014.
At step S1013, the image processing unit 162 performs the block raster operation performing processing for the trimmed block. Here, the block raster operation performing processing is explained by using
At step S1014, the image processing unit 162 adds the trimmed block to the management list (the identifier of the trimmed block and the coordinates of the circumscribed rectangle are described in the management list).
At step S1015, the image processing unit 162 outputs the drawing data of the trimmed block to the PDL data creation unit 163. Following this, the processing returns to step S1007 and the processing at step S1007 to step S1015 is repeated until there is no unprocessed block.
At step S1016, the image processing unit 162 adds the drawing object of interest to the management list. At step S1017, the image processing unit 162 outputs the drawing data of the drawing object of interest to the PDL data creation unit 163. Following this, the processing returns to step S1001. The processing at steps S1016 and S1017 is the same as the processing at step S706 and step 707 shown in
The above is the image processing accompanied by the block blending processing and the block raster operation performing processing in the present embodiment. By the present embodiment, in the case where rendering processing is performed for page data having a transparent object whose area is large and which overlaps another drawing object, it is made possible to reduce the amount of memory used in the alpha blending processing and to implement high-speed printing processing.
In the second embodiment, in the case where the trimmed block consists of only the completely opaque black pixels, the block raster operation performing processing for the trimmed block is performed (YES at step S1012 step→S1013). By this block raster operation performing processing, the drawing command of the 4-channel RGBA trimmed block is converted into the ROP drawing command to perform drawing by combining the 3-channel RGB image and the mask image. However, for the drawing command of the trimmed block consisting of only the completely opaque black pixels, higher efficiency is obtained at the time of performing the RIP processing in the printer 20 by converting the drawing command into the drawing command of the 3-channel RGB image rather than converting the drawing command into the ROP drawing command.
In the case where the second embodiment is applied to the page data shown in
As shown in
At step S1302, the image processing unit 162 converts the trimmed block, which is part of a 4-channel transparent image object, into a 3-channel image object by deleting the alpha channel from the color information on the trimmed block. This conversion processing is the above-described conversion-into-RGB block processing. Next, the processing advances to step S1014.
The above is the image processing accompanied by the conversion-into-RGB block processing in the present embodiment.
In the first embodiment, the case is explained where whether or not the white blending processing is performed is determined for all the drawing objects existing within page data of a print page and the white blending processing is performed in accordance with the results of the determination. As described above, at the time of performing the white blending processing for a certain drawing object of interest, the processing to determine whether the drawing object overlaps the drawing object of interest is performed for all the drawing objects registered in the management list (step S704). Consequently, in the case where a large number of drawing objects exist within page data, the number of drawing objects registered in the management list becomes large, and therefore, there is a possibility that much time is taken for the overlap determination processing. In the present embodiment, control is performed so that the white blending processing is not performed in accordance with the number of objects (specifically, in the case where the number of objects registered in the management list is larger than or equal to a predetermined threshold value).
First, the case where O=o1 (
Next, the case where O=o2 (
As described above, depending on the number of drawing objects for which the overlap determination is performed, there is a case where the printing time that is the sum of the processing time of the V4 printer driver and the processing time of the printer is shorter on the occasion that the white blending processing is not performed than that on the occasion that the white blending processing is performed.
In the following, the series of processing including processing to determine whether or not to perform the white blending processing in accordance with the number of drawing objects registered in the management list is explained by using
In the present embodiment, in the case where it is determined that there is an unprocessed drawing object at step S701 (in the case of YES at step S701), the processing advances to step S1401.
At step S1401, the image processing unit 162 functions as a drawing object number determination unit and determines whether the length of the drawing object management list, i.e., the number of drawing objects already registered in the management list is less than a threshold value. In the case where the results of the determination at step S1401 are affirmative, the processing advances to step S702 as in the first embodiment and the same processing as that of the first embodiment is performed at the subsequent steps S702 to S707. On the other hand, in the case where the results of the determination at step S1401 are negative, it is determined that the printing time is lengthened in the case where the overlap determination is performed further, and the processing advances to step S1402. Then, at step S1402, the image processing unit 162 transmits the drawing data of the drawing object of interest to the PDL data creation unit 163 as it is. Further, for the unprocessed drawing object except for the drawing object of interest, the image processing unit 162 similarly transmits the drawing data of the drawing object to the PDL data creation unit 163 as it is.
As described above, it is possible to shorten the printing time by not performing the overlap determination in accordance with the number of objects within page data.
As the threshold value that is used at step S1401, it is necessary to derive the number of drawing objects that reverses the relationship in magnitude between the printing time in the case where the white blending processing is performed and the printing time in the case where the white blending processing is not performed, such as the above-described threshold value o_th. In derivation of such a threshold value, it is sufficient to calculate an optimum value based on the relationship between the specifications of the printer, the PC, and so on, which is used, and the number of drawing objects. Here, the case where the present embodiment is applied to the first embodiment is explained, but it is also possible to apply the present embodiment to the second embodiment and the third embodiment.
In the first to fourth embodiments, the configuration is designed so that the processing load in the printer 20 is reduced by the PC 10 converting part of drawing data of a transparent object into drawing data of a drawing object with no alpha channel. However, it may also be possible to design a configuration in which the processing to convert part of drawing data of a transparent object into drawing data of a drawing object with no alpha channel is performed not by the PC 10 but by the printer 20 as preprocessing before RIP processing is performed. By designing a configuration as described above, it is possible to reduce the load in the printer 20 at the time of RIP processing.
Embodiment(s) of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiment (s) and/or that includes one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more processors (e.g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
By the present invention, the amount of used memory necessary for the alpha blending processing in a printer is reduced and high-speed printing processing is enabled.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Applications No. 2016-149593 filed Jul. 29, 2016, and No. 2017-023210 filed Feb. 10, 2017, which are hereby incorporated by reference wherein in their entirety.
Number | Date | Country | Kind |
---|---|---|---|
2016-149593 | Jul 2016 | JP | national |
2017-023210 | Feb 2017 | JP | national |