summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Melichev <igor.melichev@artifex.com>2007-05-02 19:12:52 +0000
committerIgor Melichev <igor.melichev@artifex.com>2007-05-02 19:12:52 +0000
commit2472b41472a3295526a7cbc50e9d89f2cefafa7e (patch)
tree899f5590c557cc39235f98b318122fd924012a5a
parent75ae1c5b00d6a1458c7650c5aba4ba5e1882f1b3 (diff)
downloadghostpdl-2472b41472a3295526a7cbc50e9d89f2cefafa7e.tar.gz
Fix (shadings) : The color space linearity check didn't account the color precision.
DETAILS : This partially improves performance for the test case of the bug 689189 "PDF fails with /unregistered in --shfill--". Since the color space represents color with precision 1/255, the shadings code must not try to obtain a better precision. This patch accounts the color quantum in is_dc_nearly_linear. EXPECTED DIFFERENCES : A minor difference in shading color : "comparefiles\464-01-fixed.ps" "comparefiles\478-01.ps" "comparefiles\Clarke Tate Manns Chinese.ai" "comparefiles\Openhuis_pdf_zw.pdf" "comparefiles\STEUER-RollingMesh 1(linear).ai" "comparefiles\STEUER-RollingMesh 2(radial).ai" "comparefiles\STEUER-RollingMesh 3(Final).ai" "CET\09-47H.PS" "CET\12-14L.PS" "CET\12-14R.PS" "CET\12-14S.PS" git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7894 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/src/gscspace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gs/src/gscspace.c b/gs/src/gscspace.c
index 94e530b92..303fb6db6 100644
--- a/gs/src/gscspace.c
+++ b/gs/src/gscspace.c
@@ -470,6 +470,7 @@ is_dc_nearly_linear(const gx_device *dev, const gx_device_color *c,
const gx_device_color *c0, const gx_device_color *c1,
double t, int n, float smoothness)
{
+
if (c0->type == &gx_dc_type_data_pure) {
int i;
gx_color_index pure0 = c0->colors.pure;
@@ -481,11 +482,12 @@ is_dc_nearly_linear(const gx_device *dev, const gx_device_color *c,
int mask = (1 << dev->color_info.comp_bits[i]) - 1;
int max_color = (i == dev->color_info.gray_index ? dev->color_info.max_gray
: dev->color_info.max_color);
+ float max_diff = max(1, max_color * smoothness);
int b0 = (pure0 >> shift) & mask, b1 = (pure1 >> shift) & mask;
int b = (pure >> shift) & mask;
double bb = b0 * t + b1 * (1 - t);
- if (any_abs(b - bb) > max_color * smoothness)
+ if (any_abs(b - bb) > max_diff)
return false;
}
return true;