2 |
- |
1 |
/* Copyright (C) 1994, 1995, 1999 Aladdin Enterprises. All rights reserved.
|
|
|
2 |
|
|
|
3 |
This software is provided AS-IS with no warranty, either express or
|
|
|
4 |
implied.
|
|
|
5 |
|
|
|
6 |
This software is distributed under license and may not be copied,
|
|
|
7 |
modified or distributed except as expressly authorized under the terms
|
|
|
8 |
of the license contained in the file LICENSE in this distribution.
|
|
|
9 |
|
|
|
10 |
For more information about licensing, please refer to
|
|
|
11 |
http://www.ghostscript.com/licensing/. For information on
|
|
|
12 |
commercial licensing, go to http://www.artifex.com/licensing/ or
|
|
|
13 |
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
|
|
|
14 |
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
/* $Id: spdiffx.h,v 1.5 2004/03/13 22:31:19 ray Exp $ */
|
|
|
18 |
/* Definitions for PixelDifference filters */
|
|
|
19 |
/* Requires strimpl.h */
|
|
|
20 |
|
|
|
21 |
#ifndef spdiffx_INCLUDED
|
|
|
22 |
# define spdiffx_INCLUDED
|
|
|
23 |
|
|
|
24 |
/*
|
|
|
25 |
* Define the maximum value for Colors. This must be at least 4, but can
|
|
|
26 |
* be arbitrarily large: the only cost is a larger stream state structure.
|
|
|
27 |
*/
|
|
|
28 |
#define s_PDiff_max_Colors 16
|
|
|
29 |
|
|
|
30 |
/* PixelDifferenceDecode / PixelDifferenceEncode */
|
|
|
31 |
typedef struct stream_PDiff_state_s {
|
|
|
32 |
stream_state_common;
|
|
|
33 |
/* The client sets the following before initialization. */
|
|
|
34 |
int Colors; /* # of colors, 1..s_PDiff_max_Colors */
|
|
|
35 |
int BitsPerComponent; /* 1, 2, 4, 8 */
|
|
|
36 |
int Columns;
|
|
|
37 |
/* The init procedure computes the following. */
|
|
|
38 |
uint row_count; /* # of bytes per row */
|
|
|
39 |
byte end_mask; /* mask for left-over bits in last byte */
|
|
|
40 |
int case_index; /* switch index for case dispatch */
|
|
|
41 |
/* The following are updated dynamically. */
|
|
|
42 |
uint row_left; /* # of bytes left in row */
|
|
|
43 |
uint prev[s_PDiff_max_Colors]; /* previous sample */
|
|
|
44 |
} stream_PDiff_state;
|
|
|
45 |
|
|
|
46 |
#define private_st_PDiff_state() /* in spdiff.c */\
|
|
|
47 |
gs_private_st_simple(st_PDiff_state, stream_PDiff_state,\
|
|
|
48 |
"PixelDifferenceEncode/Decode state")
|
|
|
49 |
#define s_PDiff_set_defaults_inline(ss)\
|
|
|
50 |
((ss)->Colors = 1, (ss)->BitsPerComponent = 8, (ss)->Columns = 1)
|
|
|
51 |
extern const stream_template s_PDiffD_template;
|
|
|
52 |
extern const stream_template s_PDiffE_template;
|
|
|
53 |
|
|
|
54 |
#endif /* spdiffx_INCLUDED */
|