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: sisparam.h 8529 2008-02-17 23:25:47Z leonardo $ */
15
/* Generic image scaling stream definitions */
16
/* Requires strimpl.h */
18
#ifndef sisparam_INCLUDED
19
# define sisparam_INCLUDED
22
* Image scaling streams all use a common set of parameters to define the
23
* input and output data. That is what we define here.
27
/*typedef byte PixelIn; */ /* per BitsPerComponentIn */
28
/*#define MaxValueIn 255 */ /* per MaxValueIn */
31
/*typedef byte PixelOut; */ /* per BitsPerComponentOut */
32
/*#define MaxValueOut 255 */ /* per MaxValueOut */
35
* The 'support' S of a digital filter is the value such that the filter is
36
* guaranteed to be zero for all arguments outside the range [-S..S]. We
37
* limit the support so that we can put an upper bound on the time required
38
* to compute an output value and on the amount of storage required for
39
* X-filtered input data; this also allows us to use pre-scaled fixed-point
40
* values for the weights if we wish.
42
* 8x8 pixels should be enough for any reasonable application....
44
#define LOG2_MAX_ISCALE_SUPPORT 3
45
#define MAX_ISCALE_SUPPORT (1 << LOG2_MAX_ISCALE_SUPPORT)
47
/* Define image scaling stream parameters. */
48
typedef struct stream_image_scale_params_s {
49
int Colors; /* >= 1 */
50
int BitsPerComponentIn; /* bits per input value, 8 or 16 */
51
uint MaxValueIn; /* max value of input component, */
52
/* 0 < MaxValueIn < 1 << BitsPerComponentIn */
53
int WidthIn, HeightIn; /* > 0 */
54
int BitsPerComponentOut; /* bits per output value, 8 or 16 */
55
uint MaxValueOut; /* max value of output component, */
56
/* 0 < MaxValueOut < 1 << BitsPerComponentOut*/
57
int WidthOut, HeightOut; /* > 0 */
58
bool ColorPolarityAdditive; /* needed by SpecialDownScale filter */
59
int src_y_offset; /* Offset of the subimage in the source image. */
60
int EntireWidthIn; /* Height of entire input image. */
61
int EntireHeightIn; /* Height of entire input image. */
62
int EntireWidthOut; /* Height of entire output image. */
63
int EntireHeightOut; /* Height of entire output image. */
64
} stream_image_scale_params_t;
66
/* Define a generic image scaling stream state. */
68
#define stream_image_scale_state_common\
70
stream_image_scale_params_t params
72
typedef struct stream_image_scale_state_s {
73
stream_image_scale_state_common;
74
} stream_image_scale_state;
76
#endif /* sisparam_INCLUDED */