CN110097147B - Method and system for setting primitive drawing attribute, computer equipment and storage medium - Google Patents
Method and system for setting primitive drawing attribute, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110097147B CN110097147B CN201810081730.7A CN201810081730A CN110097147B CN 110097147 B CN110097147 B CN 110097147B CN 201810081730 A CN201810081730 A CN 201810081730A CN 110097147 B CN110097147 B CN 110097147B
- Authority
- CN
- China
- Prior art keywords
- page
- primitive
- drawn
- graphic element
- resource statistics
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000003111 delayed effect Effects 0.000 claims abstract description 39
- 238000004364 calculation method Methods 0.000 claims abstract description 10
- 238000004590 computer program Methods 0.000 claims description 16
- 230000000694 effects Effects 0.000 abstract description 20
- 239000011159 matrix material Substances 0.000 description 12
- 230000008569 process Effects 0.000 description 10
- 238000003384 imaging method Methods 0.000 description 8
- 238000009877 rendering Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 238000011946 reduction process Methods 0.000 description 3
- 230000000903 blocking effect Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K15/00—Arrangements for producing a permanent visual presentation of the output data, e.g. computer output printers
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
Description
技术领域technical field
本发明涉及图像光栅化技术领域,具体而言,涉及一种图元绘制属性的设置方法、系统、计算机设备及计算机可读存储介质。The present invention relates to the technical field of image rasterization, and in particular, to a method, a system, a computer device and a computer-readable storage medium for setting a drawing attribute of a primitive.
背景技术Background technique
栅格图像处理器(Raster Image Processor),简称为RIP,是一种解释器,用于将页面描述语言所描述的版面信息解释转换成可供输出设备输出的数据信息。RIP是整个印前行业的核心软件,一个桌面系统的输出质量、输出速度和开放性在很大程度上取决于RIP的性能的优劣。A Raster Image Processor (RIP for short) is an interpreter that interprets and converts layout information described in a page description language into data information that can be output by an output device. RIP is the core software of the whole prepress industry. The output quality, output speed and openness of a desktop system depend to a large extent on the performance of RIP.
页面描述语言在描述版面内容时,一般采取两种成像模型:替代成像模型,透明成像模型。替代成像模式是PS(Adobe Photoshop,图像处理软件)以及PDF(PortableDocument Format,便携式文档格式)1.3之前版本所使用的成像模型,其基本原理是:每个新绘制到页面中某个位置上的图元会完全替代该位置上的背景内容,页面上该位置上的某点的最终颜色由新绘制到该位置上的图元决定。透明成像模型的基本原理是:新绘制到页面中某个位置上的透明图元需与之前该位置上的背景内容进行混合运算,页面上该位置上的某点的最终颜色由绘制到该位置上的所有图元以及背景的透明属性共同决定。When the page description language describes the layout content, two imaging models are generally adopted: an alternative imaging model and a transparent imaging model. The alternative imaging mode is the imaging model used by PS (Adobe Photoshop, image processing software) and PDF (Portable Document Format, Portable Document Format) version 1.3. The basic principle is: each new image drawn to a certain position on the page The element completely replaces the background content at that location, and the final color of a point on the page at that location is determined by the element newly drawn at that location. The basic principle of the transparent imaging model is: the transparent graphics element newly drawn to a certain position on the page needs to be mixed with the background content at the previous position, and the final color of a point at this position on the page is drawn to this position. All primitives on it and the transparency property of the background are determined together.
图元叠印属性中的非零叠印只针对印刷色有效。当前图元cmyk色版中某个色版如果为空,则将背景内容该色版的图元透上来,其中cmyk色版是彩色印刷时采用的一种套色模式。在有叠印属性的情况下,版面内容在进行色空管理时,一般采用两种模式:替代成像模型下,先对图元进行校色,然后再将该图元完全替代该位置上的背景内容;透明成像模型,页面上该位置上的某点的最终颜色由绘制到该位置上的所有图元以及背景的透明属性共同决定。A non-zero overprint in the entity overprint properties is only valid for process colors. If a certain color version in the cmyk color version of the current image element is empty, the background content of the color version of the color version will be displayed, and the cmyk color version is a color registration mode used in color printing. In the case of overprinting attributes, two modes are generally used for color space management of layout content: under the replacement imaging model, the color correction of the primitive is performed first, and then the primitive is completely replaced with the background content at the position. ;Transparent imaging model, the final color of a point on the page is determined by all the primitives drawn to this position and the transparency property of the background.
在印刷过程中,用户需要对页面进行色彩管理,如果图元本身有叠印效果,且图元满足非零叠印,则进行色彩管理后,图元的颜色通道数会发生改变,例如有些版面实空白页,通过色彩管理后该页面会有内容,这样和其他图元重叠时,就不会有叠印效果了。During the printing process, the user needs to perform color management on the page. If the graphic element itself has an overprint effect and the graphic element satisfies non-zero overprinting, the number of color channels of the graphic element will change after color management, for example, some layouts are blank. Page, the page will have content after color management, so that when it overlaps with other primitives, there will be no overprinting effect.
发明内容SUMMARY OF THE INVENTION
本发明旨在至少解决现有技术或相关技术中存在的技术问题之一。The present invention aims to solve at least one of the technical problems existing in the prior art or related technologies.
为此,本发明的一个方面在于提出了一种图元绘制属性的设置方法。To this end, one aspect of the present invention is to provide a method for setting drawing attributes of a primitive.
本发明的另一个方面在于提出了一种图元绘制属性的设置系统。Another aspect of the present invention is to provide a system for setting drawing attributes of primitives.
本发明的再一个方面在于提出了一种计算机设备。Yet another aspect of the present invention is to provide a computer device.
本发明的又一个方面在于提出了一种计算机可读存储介质。Yet another aspect of the present invention is to provide a computer-readable storage medium.
有鉴于此,根据本发明的一个方面,提出了一种图元绘制属性的设置方法,包括:扫描页面,判断页面是否具有叠印属性;当页面具有叠印属性时,获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠;当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色;当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域;对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。In view of this, according to one aspect of the present invention, a method for setting drawing attributes of graphics elements is proposed, including: scanning a page to determine whether the page has an overprint attribute; Whether the drawing element overlaps with the background of the page; when the element to be drawn overlaps with the background of the page, judge whether the page needs to be delayed color correction according to the attributes of the element; when the page needs to be delayed color correction, set the The primitive drawing area on the page is set as a transparent area; the primitive lattice is obtained by overprinting the primitives to be drawn in the transparent area, and the color proofing of the primitive lattice is performed, and finally the primitive lattice is output.
本发明提供的图元绘制属性的设置方法,首先确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。The method for setting graphics element drawing attributes provided by the present invention firstly determines whether the page has the overprinting attribute, ends the subsequent process when it does not have the overprinting attribute, saves system resources, and judges whether the graphics element to be drawn overlaps with the page background when it has the overprinting attribute, If it overlaps, it means that the color correction processing may need to be delayed. After determining that the color correction processing needs to be delayed, divide the graphics element drawing area of the page into a non-transparent area and a transparent area. When the page is interpreted, the color management timing of the primitives is used. When de-transparency is forced to be transparent, the primitives in the transparent area are first calculated by overprinting, and the dot matrix obtained during assembly is the final rendering color of the primitives, and then color management is performed. The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
根据本发明的上述图元绘制属性的设置方法,还可以具有以下技术特征:According to the method for setting the above-mentioned primitive drawing attributes of the present invention, it can also have the following technical features:
在上述技术方案中,优选地,当页面具有叠印属性时,还包括:建立资源统计区域表;对资源统计区域表进行降倍处理。In the above technical solution, preferably, when the page has an overprint attribute, the method further includes: establishing a resource statistics area table; and performing a reduction process on the resource statistics area table.
在该技术方案中,在判断页面具有叠印属性后,建立资源统计区域表用于为判断待绘制图元是否与页面背景重叠提供依据。该区域表的大小,跟输出分辨率成正比,当输出分辨率较大时,该区域表就必然很大,因此如果在输出分辨率较高或子页面数目非常多时进行资源统计的话,会占用较大的内存,所以对该资源统计区域表进行降倍处理。In this technical solution, after judging that the page has the overprint attribute, a resource statistics area table is established to provide a basis for judging whether the graphic element to be drawn overlaps with the page background. The size of the area table is proportional to the output resolution. When the output resolution is large, the area table must be very large. Therefore, if the resource statistics are performed when the output resolution is high or the number of sub-pages is very large, it will take up Larger memory, so the resource statistics area table is doubled.
在上述任一技术方案中,优选地,建立资源统计区域表的步骤,具体包括:按照第一预设高度和第一预设宽度将页面分块,得到第一数量的页面绘制区域;按照第二预设高度和第二预设宽度将页面分块,得到第二数量的页面块;将页面绘制区域和页面块进行记录,得到资源统计区域表;其中,第一数量小于第二数量。In any of the above technical solutions, preferably, the step of establishing the resource statistics area table specifically includes: dividing the page into blocks according to the first preset height and the first preset width to obtain a first number of page drawing areas; The second preset height and the second preset width divide the page into blocks to obtain a second number of page blocks; record the page drawing area and the page blocks to obtain a resource statistics area table; wherein the first number is less than the second number.
在该技术方案中,首先按照第一预设高度和宽度将页面分块,例如按照宽度×高度为32×16将页面划分为多个页面绘制区域;然后按照比第二预设高度和宽度将页面再次进行分块,例如按照宽度×高度为8×8将页面划分为多个页面块,将划分出的页面绘制区域和页面块记录在表中,形成资源统计区域表。这样绘制表中的1比特就代表32×16的一个页面绘制区域,0表示该区域没有被图元覆盖,1表示该区域上有图元覆盖。In this technical solution, the page is first divided into blocks according to the first preset height and width, for example, the page is divided into multiple page drawing areas according to the width×height of 32×16; The page is divided into blocks again, for example, the page is divided into multiple page blocks according to the width × height of 8 × 8, and the divided page drawing areas and page blocks are recorded in a table to form a resource statistics area table. In this way, 1 bit in the drawing table represents a page drawing area of 32×16, 0 means that the area is not covered by the primitive, and 1 means that the area is covered by the primitive.
在上述任一技术方案中,优选地,获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠的步骤,具体包括:获取待绘制图元,确定待绘制图元的绘制范围,并确定绘制范围在资源统计区域表中对应的页面绘制区域;统计绘制范围在资源统计区域表中覆盖的页面块的数量;若绘制范围覆盖的页面块的数量大于预设数量,则确定待绘制图元与页面的背景发生重叠;若绘制范围覆盖的页面块的数量小于等于预设数量,则确定待绘制图元与页面的背景不发生重叠。In any of the above technical solutions, preferably, the steps of acquiring the graphic element to be drawn and judging whether the graphic element to be drawn and the background of the page overlap, specifically include: acquiring the graphic element to be drawn, and determining the drawing range of the graphic element to be drawn, And determine the page drawing area corresponding to the drawing range in the resource statistical area table; count the number of page blocks covered by the drawing range in the resource statistical area table; if the number of page blocks covered by the drawing range is greater than the preset number, determine the to-be-drawn The graphic element overlaps with the background of the page; if the number of page blocks covered by the drawing range is less than or equal to the preset number, it is determined that the graphic element to be drawn does not overlap with the background of the page.
在该技术方案中,通过在资源统计区域表中查找待绘制图元是否会覆盖住某一个或者某些页面绘制区域中多余预设数量的页面块,若是则确定待绘制图元与页面的背景会发生重叠,实现准确地对是否发生重叠进行判断。还可以对是否发生覆盖的判断次数进行设置,即可以进行多于一次的判断以保证判断结果的准确性。In this technical solution, it is searched in the resource statistics area table whether the graphic element to be drawn will cover an excess preset number of page blocks in one or some page drawing areas, and if so, the background of the graphic element to be drawn and the page is determined. Overlap occurs, and it is possible to accurately judge whether overlap occurs. It is also possible to set the number of times for judging whether coverage occurs, that is, more than one judgment can be performed to ensure the accuracy of the judgment result.
在上述任一技术方案中,优选地,对资源统计区域表进行降倍处理的步骤,具体包括:根据预设倍率,按照第一公式设置资源统计区域表的高度,以及按照第二公式设置资源统计区域表的宽度;第一公式为Y=(H+H’×D)/H’×D,其中,Y表示资源统计区域表的高度,H表示页面的高度,H’表示第一预设高度,D表示预设倍率;第二公式为X=(W+W’×D)/W’×D/W”,其中,X表示资源统计区域表的宽度,W表示页面的宽度,W’表示第一预设宽度,W”表示第二预设宽度。In any of the above-mentioned technical solutions, preferably, the step of performing down-multiplication processing on the resource statistics area table specifically includes: setting the height of the resource statistics area table according to the first formula according to the preset multiplication ratio, and setting the resource according to the second formula. The width of the statistical area table; the first formula is Y=(H+H'×D)/H'×D, where Y represents the height of the resource statistical area table, H represents the height of the page, and H' represents the first preset height, D represents the preset magnification; the second formula is X=(W+W'×D)/W'×D/W", where X represents the width of the resource statistics area table, W represents the width of the page, and W' represents the first preset width, and W" represents the second preset width.
在该技术方案中,倍率是个经验值,可以由公式D=(MaxResolution+600.0)/600.0得到,MaxResolution为页面最大分辨率。根据上述公式计算得到资源统计区域表的高度和宽度,即对资源统计区域表进行降倍处理,降低内存资源的消耗。In this technical solution, the magnification is an empirical value, which can be obtained by the formula D=(MaxResolution+600.0)/600.0, where MaxResolution is the maximum resolution of the page. The height and width of the resource statistics area table are calculated according to the above formula, that is, the resource statistics area table is down-multiplied to reduce the consumption of memory resources.
根据本发明的另一个方面,提出了一种图元绘制属性的设置系统,包括:扫描单元,用于扫描页面,判断页面是否具有叠印属性;图元获取单元,用于当页面具有叠印属性时,获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠;判断单元,用于当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色;设置单元,用于当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域;处理单元,用于对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。According to another aspect of the present invention, a system for setting graphics element drawing attributes is proposed, including: a scanning unit, used for scanning a page, and judging whether the page has an overprint attribute; a graphics element acquisition unit, used when the page has an overprint attribute , obtains the graphic element to be drawn and judges whether the graphic element to be drawn overlaps with the background of the page; the judgment unit is used to judge whether the page needs to be delayed according to the attribute of the graphic element when the graphic element to be drawn overlaps with the background of the page Color correction; setting unit, used to set the graphics element drawing area on the page as a transparent area when the page needs to be delayed color correction; processing unit, used to overprint the graphics elements to be drawn in the transparent area to obtain a graph Element lattice, and color proofing the primitive lattice, and finally output the primitive lattice.
本发明提供的图元绘制属性的设置系统,首先确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。The system for setting graphics element drawing attributes provided by the present invention firstly determines whether the page has the overprinting attribute, ends the subsequent process when it does not have the overprinting attribute, saves system resources, and judges whether the graphics element to be drawn overlaps with the page background when it has the overprinting attribute, If it overlaps, it means that the color correction processing may need to be delayed. After determining that the color correction processing needs to be delayed, divide the graphics element drawing area of the page into a non-transparent area and a transparent area. When the page is interpreted, the color management timing of the primitives is used. When de-transparency is forced to be transparent, the primitives in the transparent area are first calculated by overprinting, and the dot matrix obtained during assembly is the final rendering color of the primitives, and then color management is performed. The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
根据本发明的上述图元绘制属性的设置系统,还可以具有以下技术特征:According to the setting system of the above-mentioned primitive drawing attributes of the present invention, it can also have the following technical features:
在上述技术方案中,优选地,还包括:建立单元,用于当页面具有叠印属性时,建立资源统计区域表;以及对资源统计区域表进行降倍处理。In the above technical solution, preferably, it further includes: an establishment unit, configured to establish a resource statistics area table when the page has an overprint attribute; and perform down-multiplication processing on the resource statistics area table.
在该技术方案中,在判断页面具有叠印属性后,建立资源统计区域表用于为判断待绘制图元是否与页面背景重叠提供依据。该区域表的大小,跟输出分辨率成正比,当输出分辨率较大时,该区域表就必然很大,因此如果在输出分辨率较高或子页面数目非常多时进行资源统计的话,会占用较大的内存,所以对该资源统计区域表进行降倍处理。In this technical solution, after judging that the page has the overprint attribute, a resource statistics area table is established to provide a basis for judging whether the graphic element to be drawn overlaps with the page background. The size of the area table is proportional to the output resolution. When the output resolution is large, the area table must be very large. Therefore, if the resource statistics are performed when the output resolution is high or the number of sub-pages is very large, it will take up Larger memory, so the resource statistics area table is doubled.
在上述任一技术方案中,优选地,建立单元,包括:分块单元,用于按照第一预设高度和第一预设宽度将页面分块,得到第一数量的页面绘制区域;以及按照第二预设高度和第二预设宽度将页面分块,得到第二数量的页面块;建立单元,具体用于将页面绘制区域和页面块进行记录,得到资源统计区域表;其中,第一数量小于第二数量。In any of the above technical solutions, preferably, the establishment unit includes: a block unit for dividing a page into blocks according to a first preset height and a first preset width to obtain a first number of page drawing areas; and The second preset height and the second preset width divide the page into blocks to obtain a second number of page blocks; the establishment unit is specifically used to record the page drawing area and the page blocks to obtain the resource statistics area table; wherein, the first The quantity is less than the second quantity.
在该技术方案中,首先按照第一预设高度和宽度将页面分块,例如按照宽度×高度为32×16将页面划分为多个页面绘制区域;然后按照比第二预设高度和宽度将页面再次进行分块,例如按照宽度×高度为8×8将页面划分为多个页面块,将划分出的页面绘制区域和页面块记录在表中,形成资源统计区域表。这样绘制表中的1比特就代表32×16的一个页面绘制区域,0表示该区域没有被图元覆盖,1表示该区域上有图元覆盖。In this technical solution, the page is first divided into blocks according to the first preset height and width, for example, the page is divided into multiple page drawing areas according to the width×height of 32×16; The page is divided into blocks again, for example, the page is divided into multiple page blocks according to the width × height of 8 × 8, and the divided page drawing areas and page blocks are recorded in a table to form a resource statistics area table. In this way, 1 bit in the drawing table represents a page drawing area of 32×16, 0 means that the area is not covered by the primitive, and 1 means that the area is covered by the primitive.
在上述任一技术方案中,优选地,图元获取单元,具体用于获取待绘制图元,确定待绘制图元的绘制范围,并确定绘制范围在资源统计区域表中对应的页面绘制区域;图元获取单元,包括:统计单元,用于统计绘制范围在资源统计区域表中覆盖的页面块的数量;确定单元,用于若绘制范围覆盖的页面块的数量大于预设数量,则确定待绘制图元与页面的背景发生重叠;以及若绘制范围覆盖的页面块的数量小于等于预设数量,则确定待绘制图元与页面的背景不发生重叠。In any of the above-mentioned technical solutions, preferably, the graphic element acquisition unit is specifically configured to acquire the graphic element to be drawn, determine the drawing range of the graphic element to be drawn, and determine the page drawing area corresponding to the drawing range in the resource statistics area table; The graphic element acquisition unit includes: a statistical unit for counting the number of page blocks covered by the drawing range in the resource statistics area table; and a determining unit for determining if the number of page blocks covered by the drawing range is greater than the preset number, to determine The drawing graphic element overlaps with the background of the page; and if the number of page blocks covered by the drawing range is less than or equal to the preset number, it is determined that the graphic element to be drawn and the background of the page do not overlap.
在该技术方案中,通过在资源统计区域表中查找待绘制图元是否会覆盖住某一个或者某些页面绘制区域中多余预设数量的页面块,若是则确定待绘制图元与页面的背景会发生重叠,实现准确地对是否发生重叠进行判断。还可以对是否发生覆盖的判断次数进行设置,即可以进行多于一次的判断以保证判断结果的准确性。In this technical solution, it is searched in the resource statistics area table whether the graphic element to be drawn will cover an excess preset number of page blocks in one or some page drawing areas, and if so, the background of the graphic element to be drawn and the page is determined. Overlap occurs, and it is possible to accurately judge whether overlap occurs. It is also possible to set the number of times for judging whether coverage occurs, that is, more than one judgment can be performed to ensure the accuracy of the judgment result.
在上述任一技术方案中,优选地,建立单元,具体用于根据预设倍率,按照第一公式设置资源统计区域表的高度,以及按照第二公式设置资源统计区域表的宽度;第一公式为Y=(H+H’×D)/H’×D,其中,Y表示资源统计区域表的高度,H表示页面的高度,H’表示第一预设高度,D表示预设倍率;第二公式为X=(W+W’×D)/W’×D/W”,其中,X表示资源统计区域表的宽度,W表示页面的宽度,W’表示第一预设宽度,W”表示第二预设宽度。In any of the above technical solutions, preferably, the establishment unit is specifically configured to set the height of the resource statistics area table according to the first formula according to the preset magnification, and set the width of the resource statistics area table according to the second formula; the first formula is Y=(H+H'×D)/H'×D, where Y represents the height of the resource statistics area table, H represents the height of the page, H' represents the first preset height, and D represents the preset magnification; The second formula is X=(W+W'×D)/W'×D/W", where X represents the width of the resource statistics area table, W represents the width of the page, W' represents the first preset width, and W" Indicates the second preset width.
在该技术方案中,倍率是个经验值,可以由公式D=(MaxResolution+600.0)/600.0得到,MaxResolution为页面最大分辨率。根据上述公式计算得到资源统计区域表的高度和宽度,即对资源统计区域表进行降倍处理,降低内存资源的消耗。In this technical solution, the magnification is an empirical value, which can be obtained by the formula D=(MaxResolution+600.0)/600.0, where MaxResolution is the maximum resolution of the page. The height and width of the resource statistics area table are calculated according to the above formula, that is, the resource statistics area table is down-multiplied to reduce the consumption of memory resources.
根据本发明的再一个方面,提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上述任一项的图元绘制属性的设置方法的步骤。According to yet another aspect of the present invention, a computer device is proposed, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements any of the above diagrams when executing the computer program Steps in the set method of the meta draw property.
本发明提供的计算机设备,处理器执行计算机程序时实现确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。In the computer device provided by the present invention, when the processor executes the computer program, the processor determines whether the page has the overprint attribute, ends the subsequent process when the overprint attribute does not exist, saves system resources, and judges whether the graphic element to be drawn overlaps with the page background when the overprint attribute has the overprint attribute. , if it overlaps, it means that the color correction processing may be delayed. After determining that the color correction processing needs to be delayed, the drawing area of the primitives on the page is divided into non-transparent areas and transparent areas. Avoid the opportunity of color management of primitives during page interpretation. When de-transparent, primitives in transparent areas are forced to perform overprinting calculation first. The lattice obtained during assembly is the final rendering color of primitives, and then color management is performed. The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
根据本发明的又一个方面,提出了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如上述任一项的图元绘制属性的设置方法的步骤。According to yet another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the method for setting drawing attributes of a primitive as described above.
本发明提供的计算机可读存储介质,计算机程序被处理器执行时实现确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。In the computer-readable storage medium provided by the present invention, when the computer program is executed by the processor, it can determine whether the page has the overprint attribute, end the subsequent process when it does not have the overprint attribute, save system resources, and judge whether the graphic element to be drawn has the overprint attribute when it has the overprint attribute. It overlaps with the page background. If it overlaps, it means that the color correction processing may need to be delayed. After determining that the color correction processing needs to be delayed, divide the drawing area of the primitives on the page into a non-transparent area and a transparent area. It is a transparent area, avoiding the opportunity of color management of primitives during page interpretation. When de-transparent, the primitives in the transparent area are forced to be overprinted first. The lattice obtained during assembly is the final rendering color of the primitives, and then color management is performed. . The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
本发明的附加方面和优点将在下面的描述部分中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will become apparent in the description section that follows, or will be learned by practice of the present invention.
附图说明Description of drawings
本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of embodiments taken in conjunction with the accompanying drawings, wherein:
图1示出了本发明的一个实施例的图元绘制属性的设置方法的流程示意图;FIG. 1 shows a schematic flowchart of a method for setting a drawing attribute of a primitive according to an embodiment of the present invention;
图2示出了本发明的另一个实施例的图元绘制属性的设置方法的流程示意图;2 shows a schematic flowchart of a method for setting a drawing attribute of a primitive according to another embodiment of the present invention;
图3示出了本发明的再一个实施例的图元绘制属性的设置方法的流程示意图;FIG. 3 shows a schematic flowchart of a method for setting a drawing attribute of a graphic element according to still another embodiment of the present invention;
图4示出了本发明的一个实施例的图元绘制属性的设置系统的示意框图;FIG. 4 shows a schematic block diagram of a system for setting drawing attributes of primitives according to an embodiment of the present invention;
图5示出了本发明的另一个实施例的图元绘制属性的设置系统的示意框图;FIG. 5 shows a schematic block diagram of a system for setting graphics element drawing properties according to another embodiment of the present invention;
图6示出了本发明的一个实施例的计算机设备的示意框图。FIG. 6 shows a schematic block diagram of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施方式对本发明进行进一步的详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to understand the above objects, features and advantages of the present invention more clearly, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments may be combined with each other in the case of no conflict.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是,本发明还可以采用其他不同于在此描述的其他方式来实施,因此,本发明的保护范围并不限于下面公开的具体实施例的限制。Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific details disclosed below. Example limitations.
本发明第一方面的实施例,提出一种图元绘制属性的设置方法,图1示出了本发明的一个实施例的图元绘制属性的设置方法的流程示意图。其中,该方法包括:An embodiment of the first aspect of the present invention proposes a method for setting a drawing property of a graphic element. FIG. 1 shows a schematic flowchart of a method for setting a drawing property of a graphic element according to an embodiment of the present invention. Among them, the method includes:
步骤102,扫描页面,判断页面是否具有叠印属性;
步骤104,当页面具有叠印属性时,获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠;
步骤106,当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色;
步骤108,当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域;
步骤110,对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。Step 110: Perform overprint calculation on the primitives to be drawn in the transparent area to obtain a primitive lattice, perform color correction on the primitive lattice, and finally output the primitive lattice.
本发明提供的图元绘制属性的设置方法,首先确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。The method for setting graphics element drawing attributes provided by the present invention firstly determines whether the page has the overprinting attribute, ends the subsequent process when it does not have the overprinting attribute, saves system resources, and judges whether the graphics element to be drawn overlaps with the page background when it has the overprinting attribute, If it overlaps, it means that the color correction processing may need to be delayed. After determining that the color correction processing needs to be delayed, divide the graphics element drawing area of the page into a non-transparent area and a transparent area. When the page is interpreted, the color management timing of the primitives is used. When de-transparency is forced to be transparent, the primitives in the transparent area are first calculated by overprinting, and the dot matrix obtained during assembly is the final rendering color of the primitives, and then color management is performed. The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
图2示出了本发明的另一个实施例的图元绘制属性的设置方法的流程示意图。其中,该方法包括:FIG. 2 shows a schematic flowchart of a method for setting a drawing attribute of a primitive according to another embodiment of the present invention. Among them, the method includes:
步骤202,扫描页面,判断页面是否具有叠印属性。
步骤204,当页面具有叠印属性时,建立资源统计区域表;对资源统计区域表进行降倍处理。Step 204 , when the page has the overprinting attribute, establish a resource statistics area table; perform a reduction process on the resource statistics area table.
在该实施例的步骤204中,在判断页面具有叠印属性时,建立资源统计区域表用于为判断待绘制图元是否与页面背景重叠提供依据。该区域表的大小,跟输出分辨率成正比,当输出分辨率较大时,该区域表就必然很大,因此如果在输出分辨率较高或子页面数目非常多时进行资源统计的话,会占用较大的内存,所以对该资源统计区域表进行降倍处理。In step 204 of this embodiment, when judging that the page has the overprint attribute, a resource statistics area table is established to provide a basis for judging whether the graphic element to be drawn overlaps with the page background. The size of the area table is proportional to the output resolution. When the output resolution is large, the area table must be very large. Therefore, if the resource statistics are performed when the output resolution is high or the number of sub-pages is very large, it will take up Larger memory, so the resource statistics area table is doubled.
步骤206,获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠。Step 206: Acquire the graphic element to be drawn and determine whether the graphic element to be drawn overlaps with the background of the page.
步骤208,当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色。
其中,对根据图元的属性判断是否需要对页面进行延迟校色为根据图元的类型、颜色空间、叠印属性等判断是否需要进行延迟校色,即是否需要强制为透明区域。该判断根据PDF手册中所述的规则进行判断。Among them, judging whether delayed color correction needs to be performed on the page according to the attributes of the graphic elements is to judge whether delayed color correction needs to be performed according to the type, color space, and overprinting properties of the graphic elements, that is, whether it needs to be forced to be a transparent area. The judgment is made according to the rules described in the PDF manual.
步骤210,当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域。
步骤212,对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。
图3示出了本发明的再一个实施例的图元绘制属性的设置方法的流程示意图。其中,该方法包括:FIG. 3 shows a schematic flowchart of a method for setting a drawing attribute of a primitive according to still another embodiment of the present invention. Among them, the method includes:
步骤302,扫描页面,判断页面是否具有叠印属性。
步骤304,当页面具有叠印属性时,按照第一预设高度和第一预设宽度将页面分块,得到第一数量的页面绘制区域;按照第二预设高度和第二预设宽度将页面分块,得到第二数量的页面块;将页面绘制区域和页面块进行记录,得到资源统计区域表;其中,第一数量小于第二数量。
在该实施例的步骤304中,在判断页面具有叠印属性时,建立资源统计区域表用于为判断待绘制图元是否与页面背景重叠提供依据。具体为,首先按照第一预设高度和宽度将页面分块,例如按照宽度×高度为32×16将页面划分为多个页面绘制区域;然后按照比第二预设高度和宽度将页面再次进行分块,例如按照宽度×高度为8×8将页面划分为多个页面块,将划分出的页面绘制区域和页面块记录在表中,形成资源统计区域表。这样绘制表中的1比特就代表32×16的一个页面绘制区域,0表示该区域没有被图元覆盖,1表示该区域上有图元覆盖。In
步骤306,根据预设倍率,按照第一公式设置资源统计区域表的高度,以及按照第二公式设置资源统计区域表的宽度。
其中,第一公式为Y=(H+H’×D)/H’×D,其中,Y表示资源统计区域表的高度,H表示页面的高度,H’表示第一预设高度,D表示预设倍率;第二公式为X=(W+W’×D)/W’×D/W”,其中,X表示资源统计区域表的宽度,W表示页面的宽度,W’表示第一预设宽度,W”表示第二预设宽度。The first formula is Y=(H+H'×D)/H'×D, where Y represents the height of the resource statistics area table, H represents the height of the page, H' represents the first preset height, and D represents the height of the page. Preset magnification; the second formula is X=(W+W'×D)/W'×D/W", where X represents the width of the resource statistics area table, W represents the width of the page, and W' represents the first preset magnification. Set the width, W" represents the second preset width.
在该实施例的步骤306中,该区域表的大小,跟输出分辨率成正比,当输出分辨率较大时,该区域表就必然很大,因此如果在输出分辨率较高或子页面数目非常多时进行资源统计的话,会占用较大的内存,所以对该资源统计区域表进行降倍处理。倍率是个经验值,可以由公式D=(MaxResolution+600.0)/600.0得到,MaxResolution为页面最大分辨率。根据上述公式计算得到资源统计区域表的高度和宽度,即对资源统计区域表进行降倍处理,降低内存资源的消耗。In
步骤308,获取待绘制图元,确定待绘制图元的绘制范围,并确定绘制范围在资源统计区域表中对应的页面绘制区域。Step 308: Acquire the graphic element to be drawn, determine the drawing range of the graphic element to be drawn, and determine the page drawing area corresponding to the drawing range in the resource statistics area table.
步骤310,统计绘制范围在资源统计区域表中覆盖的页面块的数量;若绘制范围覆盖的页面块的数量大于预设数量,则确定待绘制图元与页面的背景发生重叠;若绘制范围覆盖的页面块的数量小于等于预设数量,则确定待绘制图元与页面的背景不发生重叠。Step 310: Count the number of page blocks covered by the drawing range in the resource statistics area table; if the number of page blocks covered by the drawing range is greater than a preset number, it is determined that the graphic element to be drawn overlaps with the background of the page; if the drawing range covers If the number of page blocks is less than or equal to the preset number, it is determined that the graphic element to be drawn does not overlap with the background of the page.
在该实施例的步骤308和步骤310中,通过在资源统计区域表中查找待绘制图元是否会覆盖住某一个或者某些页面绘制区域中多余预设数量的页面块,若是则确定待绘制图元与页面的背景会发生重叠,实现准确地对是否发生重叠进行判断。还可以对是否发生覆盖的判断次数进行设置,即可以进行多于一次的判断以保证判断结果的准确性。In
步骤312,当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色。
其中,对根据图元的属性判断是否需要对页面进行延迟校色为根据图元的类型、颜色空间、叠印属性等判断是否需要进行延迟校色,即是否需要强制为透明区域。该判断根据PDF手册中所述的规则进行判断。Among them, judging whether delayed color correction needs to be performed on the page according to the attributes of the graphic elements is to judge whether delayed color correction needs to be performed according to the type, color space, and overprinting properties of the graphic elements, that is, whether it needs to be forced to be a transparent area. The judgment is made according to the rules described in the PDF manual.
步骤314,当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域;对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。
本发明第二方面的实施例,提出一种图元绘制属性的设置系统,图4示出了本发明的一个实施例的图元绘制属性的设置系统400的示意框图。其中,该系统400包括:The embodiment of the second aspect of the present invention proposes a system for setting the drawing properties of a graphic element. FIG. 4 shows a schematic block diagram of a system 400 for setting the drawing properties of a graphic element according to an embodiment of the present invention. Wherein, the system 400 includes:
扫描单元402,用于扫描页面,判断页面是否具有叠印属性;图元获取单元404,用于当页面具有叠印属性时,获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠;判断单元406,用于当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色;设置单元408,用于当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域;处理单元410,用于对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。The scanning unit 402 is used to scan the page and determine whether the page has an overprint property; the graphic element acquisition unit 404 is used to obtain the graphic element to be drawn when the page has the overprint property and determine whether the graphic element to be drawn overlaps with the background of the page; The judging unit 406 is used for judging whether the page needs to be delayed color correction according to the attributes of the graphic element when the graphic element to be drawn overlaps with the background of the page; the setting unit 408 is used for delaying color correction on the page when the Set the primitive drawing area on the page as a transparent area; the processing unit 410 is used to perform overprinting calculation on the primitives to be drawn in the transparent area to obtain a primitive lattice, and perform color proofing on the primitive lattice, and finally output the image. Element lattice.
本发明提供的图元绘制属性的设置系统400,首先确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。The system 400 for setting graphics element drawing attributes provided by the present invention firstly determines whether the page has the overprinting attribute, ends the subsequent process when it does not have the overprinting attribute, saves system resources, and determines whether the to-be-drawn graphics element overlaps with the page background when it has the overprinting attribute , if it overlaps, it means that the color correction processing may be delayed. After determining that the color correction processing needs to be delayed, the drawing area of the primitives on the page is divided into non-transparent areas and transparent areas. Avoid the opportunity of color management of primitives during page interpretation. When de-transparent, primitives in transparent areas are forced to perform overprinting calculation first. The lattice obtained during assembly is the final rendering color of primitives, and then color management is performed. The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
图5示出了本发明的另一个实施例的图元绘制属性的设置系统500的示意框图。其中,该系统500包括:FIG. 5 shows a schematic block diagram of a system 500 for setting drawing properties of primitives according to another embodiment of the present invention. Wherein, the system 500 includes:
扫描单元502,用于扫描页面,判断页面是否具有叠印属性;a scanning unit 502, configured to scan a page and determine whether the page has an overprint attribute;
建立单元504,用于当页面具有叠印属性时,建立资源统计区域表;以及对资源统计区域表进行降倍处理;The establishment unit 504 is used to establish a resource statistics area table when the page has an overprint attribute; and perform a reduction process on the resource statistics area table;
建立单元504,具体包括:分块单元542,用于按照第一预设高度和第一预设宽度将页面分块,得到第一数量的页面绘制区域;以及按照第二预设高度和第二预设宽度将页面分块,得到第二数量的页面块;建立单元504,具体用于将页面绘制区域和页面块进行记录,得到资源统计区域表;其中,第一数量小于第二数量;The establishment unit 504 specifically includes: a block unit 542 for dividing the page into blocks according to the first preset height and the first preset width to obtain a first number of page drawing areas; and according to the second preset height and the second The preset width divides the page into blocks to obtain a second number of page blocks; the establishment unit 504 is specifically configured to record the page drawing area and the page blocks to obtain a resource statistics area table; wherein, the first number is less than the second number;
建立单元504,还用于根据预设倍率,按照第一公式设置资源统计区域表的高度,以及按照第二公式设置资源统计区域表的宽度;第一公式为Y=(H+H’×D)/H’×D,其中,Y表示资源统计区域表的高度,H表示页面的高度,H’表示第一预设高度,D表示预设倍率;第二公式为X=(W+W’×D)/W’×D/W”,其中,X表示资源统计区域表的宽度,W表示页面的宽度,W’表示第一预设宽度,W”表示第二预设宽度;The establishing unit 504 is further configured to set the height of the resource statistics area table according to the first formula according to the preset magnification, and set the width of the resource statistics area table according to the second formula; the first formula is Y=(H+H'×D )/H'×D, where Y represents the height of the resource statistics area table, H represents the height of the page, H' represents the first preset height, and D represents the preset magnification; the second formula is X=(W+W' ×D)/W'×D/W", where X represents the width of the resource statistics area table, W represents the width of the page, W' represents the first preset width, and W" represents the second preset width;
图元获取单元506,用于获取待绘制图元并判断待绘制图元与页面的背景是否发生重叠;具体用于获取待绘制图元,确定待绘制图元的绘制范围,并确定绘制范围在资源统计区域表中对应的页面绘制区域;The graphic element acquiring unit 506 is used to acquire the graphic element to be drawn and determine whether the graphic element to be drawn overlaps with the background of the page; specifically, it is used to acquire the graphic element to be drawn, determine the drawing range of the graphic element to be drawn, and determine that the drawing range is within The corresponding page drawing area in the resource statistics area table;
图元获取单元506,包括:统计单元562,用于统计绘制范围在资源统计区域表中覆盖的页面块的数量;确定单元564,用于若绘制范围覆盖的页面块的数量大于预设数量,则确定待绘制图元与页面的背景发生重叠;以及若绘制范围覆盖的页面块的数量小于等于预设数量,则确定待绘制图元与页面的背景不发生重叠;The graphic element acquiring unit 506 includes: a counting unit 562, configured to count the number of page blocks covered by the drawing range in the resource statistics area table; and a determining unit 564, used for if the number of page blocks covered by the drawing range is greater than the preset Then it is determined that the graphic element to be drawn overlaps with the background of the page; and if the number of page blocks covered by the drawing range is less than or equal to the preset number, it is determined that the graphic element to be drawn and the background of the page do not overlap;
判断单元508,用于当待绘制图元与页面的背景发生重叠时,根据图元的属性判断是否需要对页面进行延迟校色;The judgment unit 508 is used to judge whether the page needs to be delayed color correction according to the attributes of the graphic element when the graphic element to be drawn overlaps with the background of the page;
设置单元510,用于当需要对页面进行延迟校色时,将页面上的图元绘制区域设置为透明区域;The setting unit 510 is used to set the graphics element drawing area on the page as a transparent area when the delayed color correction needs to be performed on the page;
处理单元512,用于对透明区域内的待绘制图元进行叠印计算得到图元点阵,并对图元点阵进行色彩校对,最后输出图元点阵。The processing unit 512 is configured to perform overprint calculation on the primitives to be drawn in the transparent area to obtain a primitive lattice, perform color correction on the primitive lattice, and finally output the primitive lattice.
在该实施例中,在判断页面具有叠印属性后,建立资源统计区域表用于为判断待绘制图元是否与页面背景重叠提供依据。具体为,首先按照第一预设高度和宽度将页面分块,例如按照宽度×高度为32×16将页面划分为多个页面绘制区域;然后按照比第二预设高度和宽度将页面再次进行分块,例如按照宽度×高度为8×8将页面划分为多个页面块,将划分出的页面绘制区域和页面块记录在表中,形成资源统计区域表。这样绘制表中的1比特就代表32×16的一个页面绘制区域,0表示该区域没有被图元覆盖,1表示该区域上有图元覆盖。In this embodiment, after judging that the page has the overprint attribute, a resource statistics area table is established to provide a basis for judging whether the graphic element to be drawn overlaps with the page background. Specifically, first divide the page into blocks according to the first preset height and width, for example, divide the page into multiple page drawing areas according to the width×height of 32×16; then divide the page according to the second preset height and width. Blocking, for example, dividing a page into multiple page blocks according to the width×height of 8×8, and recording the divided page drawing areas and page blocks in a table to form a resource statistics area table. In this way, 1 bit in the drawing table represents a page drawing area of 32×16, 0 means that the area is not covered by the primitive, and 1 means that the area is covered by the primitive.
该区域表的大小,跟输出分辨率成正比,当输出分辨率较大时,该区域表就必然很大,因此如果在输出分辨率较高或子页面数目非常多时进行资源统计的话,会占用较大的内存,所以对该资源统计区域表进行降倍处理。倍率是个经验值,可以由公式D=(MaxResolution+600.0)/600.0得到,MaxResolution为页面最大分辨率。根据上述公式计算得到资源统计区域表的高度和宽度,即对资源统计区域表进行降倍处理,降低内存资源的消耗。The size of the area table is proportional to the output resolution. When the output resolution is large, the area table must be very large. Therefore, if the resource statistics are performed when the output resolution is high or the number of sub-pages is very large, it will take up Larger memory, so the resource statistics area table is doubled. The magnification is an empirical value, which can be obtained by the formula D=(MaxResolution+600.0)/600.0, where MaxResolution is the maximum resolution of the page. The height and width of the resource statistics area table are calculated according to the above formula, that is, the resource statistics area table is down-multiplied to reduce the consumption of memory resources.
通过在资源统计区域表中查找待绘制图元是否会覆盖住某一个或者某些页面绘制区域中多余预设数量的页面块,若是则确定待绘制图元与页面的背景会发生重叠,实现准确地对是否发生重叠进行判断。还可以对是否发生覆盖的判断次数进行设置,即可以进行多于一次的判断以保证判断结果的准确性。By finding out in the resource statistics area table whether the graphic element to be drawn will cover a certain or some page drawing area with an excess of preset number of page blocks, if so, it is determined that the graphic element to be drawn and the background of the page will overlap, so as to achieve accurate to determine whether there is overlap. It is also possible to set the number of times for judging whether coverage occurs, that is, more than one judgment can be performed to ensure the accuracy of the judgment result.
本发明第三方面的实施例,提出一种计算机设备,图6示出了本发明的一个实施例的计算机设备600的示意框图。其中,该计算机设备600包括:An embodiment of the third aspect of the present invention provides a computer device, and FIG. 6 shows a schematic block diagram of a computer device 600 according to an embodiment of the present invention. Wherein, the computer equipment 600 includes:
存储器602、处理器604及存储在存储器602上并可在处理器604上运行的计算机程序,处理器604执行计算机程序时实现如上述任一项的图元绘制属性的设置方法的步骤。A memory 602, a processor 604, and a computer program stored in the memory 602 and running on the processor 604, when the processor 604 executes the computer program, implements the steps of the method for setting the drawing attributes of a primitive as described above.
本发明提供的计算机设备600,处理器604执行计算机程序时实现确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。In the computer device 600 provided by the present invention, when the processor 604 executes the computer program, it can determine whether the page has the overprinting attribute, end the subsequent process when it does not have the overprinting attribute, save system resources, and judge whether the to-be-drawn graphics element matches the page when the overprinting attribute has the overprinting attribute. If the background overlaps, it means that the color correction processing may need to be delayed. After determining that the color correction processing needs to be delayed, divide the graphics element drawing area of the page into a non-transparent area and a transparent area, that is, the graphic element drawing area that meets the overprint effect is forced to be transparent. To avoid the color management timing of primitives during page interpretation, when de-transparent, the primitives in the transparent area are forced to be overprinted first, and the dot matrix obtained during assembly is the final rendering color of the primitives, and then color management is performed. The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
本发明第四方面的实施例,提出了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如上述任一项的图元绘制属性的设置方法的步骤。An embodiment of the fourth aspect of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the above-mentioned methods for setting drawing attributes of a primitive.
本发明提供的计算机可读存储介质,计算机程序被处理器执行时实现确定页面是否具有叠印属性,在不具有叠印属性时结束后续流程,节约系统资源,在具有叠印属性时判断待绘制图元是否与页面背景重叠,若重叠则表示可能需要延迟校色处理,在确定需要延迟校色处理后将页面的图元绘制区域划分为非透明区域和透明区域,即将满足叠印效果的图元绘制区域强制为透明区域,避开页面解释时图元色彩管理时机,在去透明时强制为透明区域的图元先做叠印计算,组装时得到的点阵是图元最终的呈现颜色,然后才进行色彩管理。先得到图元最终的输出效果,进而进行点阵级的校色,因此防止在叠印前改变图元的颜色通道数,降低对最终的叠印效果的影响。In the computer-readable storage medium provided by the present invention, when the computer program is executed by the processor, it can determine whether the page has the overprint attribute, end the subsequent process when it does not have the overprint attribute, save system resources, and judge whether the graphic element to be drawn has the overprint attribute when it has the overprint attribute. It overlaps with the page background. If it overlaps, it means that the color correction processing may need to be delayed. After determining that the color correction processing needs to be delayed, divide the drawing area of the primitives on the page into a non-transparent area and a transparent area. It is a transparent area, avoiding the opportunity of color management of primitives during page interpretation. When de-transparent, the primitives in the transparent area are forced to be overprinted first. The lattice obtained during assembly is the final rendering color of the primitives, and then color management is performed. . The final output effect of the primitive is obtained first, and then the dot-matrix-level color correction is performed, so that the number of color channels of the primitive is prevented from being changed before overprinting, and the influence on the final overprinting effect is reduced.
在本说明书的描述中,术语“一个实施例”、“一些实施例”、“具体实施例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或实例。而且,描述的具体特征、结构、材料或特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiment", etc. means that a particular feature, structure, material or characteristic described in connection with the embodiment or example is included in the present invention at least one embodiment or example of . In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or instance. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810081730.7A CN110097147B (en) | 2018-01-29 | 2018-01-29 | Method and system for setting primitive drawing attribute, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810081730.7A CN110097147B (en) | 2018-01-29 | 2018-01-29 | Method and system for setting primitive drawing attribute, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110097147A CN110097147A (en) | 2019-08-06 |
CN110097147B true CN110097147B (en) | 2020-07-14 |
Family
ID=67442632
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810081730.7A Active CN110097147B (en) | 2018-01-29 | 2018-01-29 | Method and system for setting primitive drawing attribute, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110097147B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111610915A (en) * | 2020-05-13 | 2020-09-01 | 杭州优稳自动化系统有限公司 | A method, device, equipment and storage medium for high-frequency drawing of picture trajectory |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408989A (en) * | 2008-10-17 | 2009-04-15 | 北大方正集团有限公司 | Method and apparatus for filling primitive base on graphics set split joint |
CN101499172A (en) * | 2009-03-06 | 2009-08-05 | 深圳华为通信技术有限公司 | ActiveX drafting method and device |
CN103186512A (en) * | 2011-12-31 | 2013-07-03 | 北大方正集团有限公司 | Rasterization processing method and device for transparent page |
CN103186909A (en) * | 2011-12-31 | 2013-07-03 | 北大方正集团有限公司 | Method and device for improving rasterization speed of transparent image |
CN103186648A (en) * | 2011-12-31 | 2013-07-03 | 北大方正集团有限公司 | Page graphic primitive overprint processing method and device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7599098B2 (en) * | 2004-05-05 | 2009-10-06 | Kodak Graphic Communications Canada Company | System and methods for color matching overprinted documents |
CN1307484C (en) * | 2005-01-07 | 2007-03-28 | 北京北大方正电子有限公司 | A method for grayscale rasterization of color separation page description |
GB2526598B (en) * | 2014-05-29 | 2018-11-28 | Imagination Tech Ltd | Allocation of primitives to primitive blocks |
CN106326842B (en) * | 2016-08-15 | 2019-05-24 | 深圳市茁壮网络股份有限公司 | A kind of document text area recognizing method and device |
-
2018
- 2018-01-29 CN CN201810081730.7A patent/CN110097147B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408989A (en) * | 2008-10-17 | 2009-04-15 | 北大方正集团有限公司 | Method and apparatus for filling primitive base on graphics set split joint |
CN101499172A (en) * | 2009-03-06 | 2009-08-05 | 深圳华为通信技术有限公司 | ActiveX drafting method and device |
CN103186512A (en) * | 2011-12-31 | 2013-07-03 | 北大方正集团有限公司 | Rasterization processing method and device for transparent page |
CN103186909A (en) * | 2011-12-31 | 2013-07-03 | 北大方正集团有限公司 | Method and device for improving rasterization speed of transparent image |
CN103186648A (en) * | 2011-12-31 | 2013-07-03 | 北大方正集团有限公司 | Page graphic primitive overprint processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110097147A (en) | 2019-08-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5643574B2 (en) | Image processing apparatus and image processing method | |
US7894098B1 (en) | Color separation of pattern color spaces and form XObjects | |
CN100545831C (en) | Method and device for rasterization processing of transparent pages | |
EP1720094A2 (en) | Image processing apparatus and its control method, and program | |
US20150262046A1 (en) | Print data processing apparatus and non-transitory computer readable medium | |
CN101515986A (en) | Method of generating ink amount data, device for generating ink amount data, and program thereof | |
JP5639492B2 (en) | System and method for processing color information in a spreadsheet | |
JP6379516B2 (en) | Mechanism for topcoat processing | |
US8605348B2 (en) | Systems and methods for rendering resizable image including resizable mask | |
CN110097147B (en) | Method and system for setting primitive drawing attribute, computer equipment and storage medium | |
JP5023036B2 (en) | Profile generation apparatus, profile generation program, profile generation method, image processing apparatus, image processing program, and image processing method | |
KR101945581B1 (en) | Image processing apparatus, image processing method, and storage medium | |
JP3981779B2 (en) | Image processing apparatus, image processing method, and medium on which image processing program is recorded | |
US10552717B2 (en) | Image processing apparatus, control method thereof, and storage medium | |
US8537425B2 (en) | Method for optimizing the search for trapping regions | |
JP2017170884A (en) | Image processing device, control method thereof, and program | |
CN103839217A (en) | Watermark image realization method | |
WO2020166596A1 (en) | Image processing system and program | |
JP5012871B2 (en) | Image processing apparatus, image forming apparatus, and image processing program | |
CN101365043A (en) | Dot-matrix-level pixel point color correction method and device | |
US8941881B2 (en) | Method and apparatus for rasterizing transparent page | |
JP2008160476A (en) | Image processor and its processing method | |
JP3968989B2 (en) | Image processing apparatus, image processing method, and storage medium storing image processing program | |
CN102855645B (en) | Rasterization processing method and rasterization processing device for page | |
CN102457654B (en) | Trap printing method and apparatus thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220616 Address after: 3007, Hengqin international financial center building, No. 58, Huajin street, Hengqin new area, Zhuhai, Guangdong 519031 Patentee after: New founder holdings development Co.,Ltd. Patentee after: BEIJING FOUNDER ELECTRONICS Co.,Ltd. Address before: 100871, Beijing, Haidian District Cheng Fu Road 298, founder building, 9 floor Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd. Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd. |
|
TR01 | Transfer of patent right |
Effective date of registration: 20240522 Address after: 3007, Hengqin International Financial Center Building, No. 58 Huajin Street, Hengqin New District, Zhuhai City, Guangdong Province, 519030 Patentee after: New founder holdings development Co.,Ltd. Country or region after: China Patentee after: BEIJING FOUNDER EASIPRINT CO.,LTD. Address before: 3007, Hengqin international financial center building, No. 58, Huajin street, Hengqin new area, Zhuhai, Guangdong 519031 Patentee before: New founder holdings development Co.,Ltd. Country or region before: China Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd. |