Bug 687414

Summary: An analythic implementation for gs_direct_color_space::is_linear
Product: Ghostscript Reporter: Igor Melichev <igor.melichev>
Component: Graphics LibraryAssignee: Ralph Giles <ralph.giles>
Status: RESOLVED LATER    
Severity: enhancement CC: raph.levien
Priority: P2 Keywords: bountiable
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: initial_patch.txt

Description Igor Melichev 2004-04-08 03:00:07 UTC
Rather we have got a default in gx_cspace_is_linear_default, the default 
implementation isn't well based on math and therefore it has a risk of glitches 
and performance leak. We would like to replase it with a better one.
Comment 1 Igor Melichev 2004-04-08 03:01:46 UTC
Created attachment 614 [details]
initial_patch.txt

Attaching a patch, which defines the scope of the project.
See comments in there about details of the suggested implementation.
Comment 2 Igor Melichev 2004-05-17 05:46:44 UTC
An additional useful requirement : change function prototypes and 
implementations to return a maximal deviation from the linear approximation. 
is_quadrangle_color_linear in gxshade6.c needs this information for better 
choice of the patch subdivision.
Comment 3 leonardo 2007-05-07 02:50:05 UTC
Passing to Tim. Set P2 as Bug 689189 for Customer 190 depends on it. We need to 
speed up gx_cspace_is_linear_default dramatically. Creating an array of 
quazilinear intervals may help. Here is an example for 1-dimensional color 
function (such as CIEBasedA) :

Suppose the function is defined with a 256-elements array of values [0:255]. 

source array : 0 0 0 0 1 2 3 4 6 8 10 12 ....

Create another 256 elements array, which stores indices of quazilinear 
intervals like this :

intervals :    0 0 0 0 1 1 1 1 2 2 2  2  ....

To know whether the function is quazilinear in an interval [i0:i1] just check 
intervals[i0] != intervals[i1]. 

Well in the multi-dimensional space it is more complicated, and needs a lazy 
calculation of the intervals array. A sample code may be found in 
gsfunc0.c:make_interpolation_tensor .
Comment 4 Ralph Giles 2009-09-03 15:43:19 UTC
I think this bug is obsolete.