1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
14
/* $Id: gxiclass.h 8022 2007-06-05 22:23:38Z giles $ */
15
/* Define image rendering algorithm classes */
17
#ifndef gxiclass_INCLUDED
18
# define gxiclass_INCLUDED
20
/* Define the abstract type for the image enumerator state. */
21
typedef struct gx_image_enum_s gx_image_enum;
23
#ifndef gx_device_DEFINED
24
# define gx_device_DEFINED
25
typedef struct gx_device_s gx_device;
29
* Define the interface for routines used to render a (source) scan line.
30
* If the buffer is the original client's input data, it may be unaligned;
31
* otherwise, it will always be aligned.
33
* The image_render procedures work on fully expanded, complete rows. These
34
* take a height argument, which is an integer >= 0; they return a negative
35
* code, or the number of rows actually processed (which may be less than
36
* the height). height = 0 is a special call to indicate that there is no
37
* more input data; this is necessary because the last scan lines of the
38
* source data may not produce any output.
40
* Note that the 'w' argument of the image_render procedure is the number
41
* of samples, i.e., the number of pixels * the number of samples per pixel.
42
* This is neither the width in pixels nor the width in bytes (in the case
43
* of 12-bit samples, which expand to 2 bytes apiece).
45
#define irender_proc(proc)\
46
int proc(gx_image_enum *penum, const byte *buffer, int data_x,\
47
uint w, int h, gx_device *dev)
48
typedef irender_proc((*irender_proc_t));
51
* Define procedures for selecting imaging methods according to the class of
52
* the image. Image class procedures are called in alphabetical order, so
53
* their names begin with a digit that indicates their priority
54
* (0_interpolate, etc.): each one may assume that all the previous ones
55
* failed. If a class procedure succeeds, it may update the enumerator
56
* structure as well as returning the rendering procedure.
58
#define iclass_proc(proc)\
59
irender_proc_t proc(gx_image_enum *penum)
60
typedef iclass_proc((*gx_image_class_t));
62
#endif /* gxiclass_INCLUDED */