40 |
# define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
# define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
41 |
#endif /* MIN */ |
#endif /* MIN */ |
42 |
|
|
|
/* We have two types of colorspaces; simple and complex. Simple colorspaces |
|
|
just converts the color specified in (colorspace, gstate) to a RGB value |
|
|
that is used when rendering. Complex colorspaces have hooks for |
|
|
rendering. */ |
|
|
enum |
|
|
{ |
|
|
kGFColorSpaceTypeSimple, |
|
|
kGFColorSpaceTypeComplex |
|
|
}; |
|
|
|
|
|
struct GFColorSpace |
|
|
{ |
|
|
/* Object instance. Only used for complex colorspaces. */ |
|
|
CFRuntimeBase _runtime_base; |
|
|
|
|
|
/* Type of colorspace; simple or complex. */ |
|
|
int colorspace_type; |
|
|
|
|
|
/* Number of components in the colorspace (not including alpha). */ |
|
|
int n_components; |
|
|
|
|
|
/* ??? comment. */ |
|
|
void (*render_fn) (GFColorSpaceRef colorspace, double value[], |
|
|
ArtRender *render); |
|
|
}; |
|
|
|
|
|
/* Class identifier for GFColorSpace class. */ |
|
|
extern CFTypeID _GFColorSpaceTypeID; |
|
|
|
|
43 |
/* Library private functions. */ |
/* Library private functions. */ |
44 |
extern GFColorSpaceRef _GFColorSpaceClone (GFColorSpaceRef template); |
extern GFColorSpaceRef _GFColorSpaceClone (GFColorSpaceRef template); |
45 |
|
|
46 |
|
/* Invoke paint server COLORSPACE on RENDER. VALUE is the current color space |
47 |
|
value (fill or stroke). */ |
48 |
|
extern void paintserver_invoke (GFContextRef context, |
49 |
|
GFColorSpaceRef colorspace, |
50 |
|
ArtRender *render); |
51 |
|
|
52 |
|
/* Called when paint server is no longer needed. */ |
53 |
|
extern void paintserver_free (GFContextRef context, |
54 |
|
GFColorSpaceRef colorspace); |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
/* Maximum number of components in a color for fill or stroke. */ |
/* Maximum number of components in a color for fill or stroke. */ |
59 |
#define MAX_COMPONENTS 8 |
#define MAX_COMPONENTS 8 |