INFORMATION PROCESSING APPARATUS AND INFORMATION PROCESSING METHOD
20170228902 · 2017-08-10
Inventors
Cpc classification
G06T11/40
PHYSICS
International classification
Abstract
Provided is an information processing apparatus including: a PDL analysis unit that acquires an output resolution of input PDL data when a tile drawing instruction is included in the PDL data, and calculates a drawing size of a tile drawing based on the tile drawing instruction and the output resolution; an average color calculation unit that calculates an average color of the tile drawing based on the tile drawing instruction when the calculated drawing size is smaller than a predetermined value; and a rendering unit that renders the tile drawing instruction based on the calculated average color. The average color calculation unit calculates the average color based on a transparency level of a unit tile included in the tile drawing instruction.
Claims
1. An information processing apparatus, comprising: a PDL analysis unit configured to acquire an output resolution of input PDL data when a tile drawing instruction is included in the PDL data, and to calculate a drawing size of a tile drawing based on the tile drawing instruction and the output resolution; an average color calculation unit configured to calculate an average color of the tile drawing based on the tile drawing instruction when the calculated drawing size is smaller than a predetermined value; and a rendering unit configured to render the tile drawing instruction based on the calculated average color, wherein the average color calculation unit is configured to calculate the average color based on a transparency level of a unit tile included in the tile drawing instruction.
2. The apparatus according to claim 1, wherein the average color calculation unit is configured to switch a calculation method for the average color based on a value of the transparency level.
3. The apparatus according to claim 1, wherein the average color calculation unit is configured to switch a calculation method for the average color based on whether or not the transparency level is uniform.
4. The apparatus according to claim 1, wherein the average color calculation unit is configured to calculate, when the transparency level is uniform, the average color based on an average value of colors included in the tile drawing instruction, an average value of the transparency level, and a background color.
5. The apparatus according to claim 1, wherein the average color calculation unit is configured to correct, when the transparency level is not uniform, an average value of colors included in the tile drawing instruction through use of an average value of the transparency level, and to calculate the average color based on the corrected average value of the colors, the average value of the transparency level, and a background color.
6. The apparatus according to claim 1, wherein the PDL data comprises data based on an XML paper specification (XPS).
7. The apparatus according to claim 1, wherein the PDL data comprises data based on a portable document format (PDF).
8. An information processing method, comprising: acquiring an output resolution of input PDL data when a tile drawing instruction is included in the PDL data, and calculating a drawing size of a tile drawing based on the tile drawing instruction and the output resolution; calculating an average color of the tile drawing based on the tile drawing instruction when the calculated drawing size is smaller than a predetermined value; and rendering the tile drawing instruction based on the calculated average color, wherein the calculating of the average color comprises calculating the average color based on a transparency level of a unit tile included in the tile drawing instruction.
9. A non-transitory computer-readable recording medium having recorded thereon a program for causing a computer to execute an information processing method, the information processing method comprising: acquiring an output resolution of input PDL data when a tile drawing instruction is included in the PDL data, and calculating a drawing size of a tile drawing based on the tile drawing instruction and the output resolution; calculating an average color of the tile drawing based on the tile drawing instruction when the calculated drawing size is smaller than a predetermined value; and rendering the tile drawing instruction based on the calculated average color, wherein the calculating of the average color comprises calculating the average color based on a transparency level of a unit tile included in the tile drawing instruction.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
DESCRIPTION OF THE EMBODIMENTS
[0024] Now, an embodiment of the present invention is described in detail with reference to the attached drawings. In this embodiment, an XML paper specification (XPS), a portable document format (PDF), or the like is assumed as PDL data. In the following description, an “alpha value” represents a value indicating a transparency level of a color, and is assumed in this embodiment to be expressed by numerical values of from 0.0 (totally transparent) to 1.0 (totally opaque).
[0025]
[0026]
[0027]
[0028]
[0029]
[0030] In the example of
[0031]
[0032] In the example of
[0033]
[0034]
[0035] <Rendering Processing for Tile Instruction>
[0036] The rendering processing conducted for the drawing instruction described in the PDL data 201 by the information processing apparatus 101 is described.
[0037] In Step S901, the PDL analysis unit 202 acquires an output resolution. In Step S902, the PDL analysis unit 202 analyzes a drawing instruction described in the PDL data 201. In Step S903, the PDL analysis unit 202 examines whether or not the drawing instruction analyzed in Step S902 is a tile instruction. When the drawing instruction is the tile instruction, the processing advances to Step S904, and otherwise advances to Step S907.
[0038] In Step S904, the PDL analysis unit 202 uses information on the output resolution acquired in Step S901 and the drawing instruction acquired in Step S902 to calculate the drawing size of the tile instruction in the device coordinate system. In Step S905, the PDL analysis unit 202 determines whether or not the drawing size calculated in Step S904 is smaller than one pixel. When the drawing size is smaller than one pixel, the processing advances to Step S906, and otherwise advances to Step S907.
[0039] In Step S906, the tile average color calculation unit 203 calculates a tile average color, and replaces the tile instruction by a fill instruction using the calculated average color. This processing is described in detail with reference to
[0040] <Details of Tile Average Color Determining Processing>
[0041]
[0042] In Step S1001, the tile average color calculation unit 203 acquires a number N of drawing instructions included in the tile drawing. Subsequently, in Step S1002, the tile average color calculation unit 203 initializes a counter i for counting the number of examined drawing instructions within the tile drawing to zero, and in Step S1003, initializes a variable Mode representing a mode of the tile average color calculation method to zero.
[0043] In Step S1004, the tile average color calculation unit 203 acquires an alpha value Alpha[0] held by the zeroth drawing instruction included in the tile drawing. In Step S1005, the tile average color calculation unit 203 compares the values between the counter i and N. When the counter i is smaller than N, Step S1006 is conducted, and otherwise Step S1010 is conducted.
[0044] In Step S1006, the tile average color calculation unit 203 acquires an alpha value Alpha[i] held by the i-th drawing instruction included in the tile drawing. In Step S1007, the tile average color calculation unit 203 compares the values between Alpha[0] acquired in Step S1004 and Alpha[i] acquired in Step S1006. When the values are equal to each other, Step S1008 is conducted, and otherwise Step S1009 is conducted. In Step S1008, the tile average color calculation unit 203 adds one to the value of the counter i, and returns to Step S1005.
[0045] In Step S1009, the tile average color calculation unit 203 sets the variable Mode representing the mode of the tile average color calculation method to one. When the processing from Step S1004 to Step S1009 is conducted for the unit tile of
[0046] In Step S1010, the tile average color calculation unit 203 examines whether or not the value of the variable Mode representing the mode of the tile average color calculation method is zero. When the variable Mode is zero, Step S1011 is conducted, and otherwise Step S1012 is conducted. In Step S1011, the tile average color calculation unit 203 uses a calculation method I to determine the tile average color, and in Step S1012, uses a calculation method II to determine the tile average color.
[0047] <Tile Average Color Determining Processing Using Calculation Method I>
[0048]
[0049] In Step S1101, the tile average color calculation unit 203 acquires the number N of drawing instructions included in the tile drawing. In Step S1102, the tile average color calculation unit 203 calculates an average value color_avg of the colors of the drawing instructions included in the tile drawing. A calculation expression for the average value color_avg is as follows:
where color[i] represents the color value of the i-th drawing instruction included in the tile drawing.
[0050] In Step S1103, the tile average color calculation unit 203 calculates an average value alpha_avg of the alpha values of the drawing instructions included in the tile drawing. A calculation expression for the average value alpha_avg is as follows:
where alpha[i] represents the alpha value of the i-th drawing instruction included in the tile drawing.
[0051] In Step S1104, the tile average color calculation unit 203 conducts compositing processing for a background color color_bg, the average value color_avg calculated in Step S1102, and the average value alpha_avg calculated in Step S1103, and sets a result composite_result of the compositing as the tile average color. A calculation expression for the compositing processing is as follows.
composite_result=color_avg*alpha_avg+color_bg*(1−alpha_avg)
[0052] <Tile Average Color Determining Processing Using Calculation Method II>
[0053]
[0054] In Step S1204, the tile average color calculation unit 203 uses the average value alpha_avg calculated in Step S1203 to calculate an average value color_avg′ after correction. A calculation expression for the average value color_avg′ is as follows.
[0055] In Step S1205, the tile average color calculation unit 203 conducts compositing processing for the background color color_bg and the average value color_avg′ calculated in Step S1204, and sets a result composite result of the compositing as the tile average color. A calculation expression for the compositing processing is as follows.
composite_result=color_avg′*alpha_avg+color_bg*(1−alpha_avg)
[0056] 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.
[0057] 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.
[0058] This application claims the benefit of Japanese Patent Application No. 2016-023639, filed Feb. 10, 2016, which is hereby incorporated by reference herein in its entirety.