1 /* Copyright (C) 1998, 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: sddparam.c,v 1.4 2002/02/21 22:24:53 giles Exp $ */
18 /* DCTDecode filter parameter setting and reading */
19 #include "std.h"
20 #include "jpeglib_.h"
21 #include "gserror.h"
22 #include "gserrors.h"
23 #include "gstypes.h"
24 #include "gsmemory.h"
25 #include "gsparam.h"
26 #include "strimpl.h" /* sdct.h requires this */
27 #include "sdct.h"
28 #include "sdcparam.h"
29 #include "sjpeg.h"
30
31 /* ================ Get parameters ================ */
32
33 stream_state_proc_get_params(s_DCTD_get_params, stream_DCT_state); /* check */
34
35 int
s_DCTD_get_params(gs_param_list * plist,const stream_DCT_state * ss,bool all)36 s_DCTD_get_params(gs_param_list * plist, const stream_DCT_state * ss, bool all)
37 {
38 stream_DCT_state dcts_defaults;
39 const stream_DCT_state *defaults;
40
41 if (all)
42 defaults = 0;
43 else {
44 (*s_DCTE_template.set_defaults) ((stream_state *) & dcts_defaults);
45 defaults = &dcts_defaults;
46 }
47 /****** NYI ******/
48 return s_DCT_get_params(plist, ss, defaults);
49 }
50
51 /* ================ Put parameters ================ */
52
53 stream_state_proc_put_params(s_DCTD_put_params, stream_DCT_state); /* check */
54
55 int
s_DCTD_put_params(gs_param_list * plist,stream_DCT_state * pdct)56 s_DCTD_put_params(gs_param_list * plist, stream_DCT_state * pdct)
57 {
58 int code;
59
60 if ((code = s_DCT_put_params(plist, pdct)) < 0 ||
61 /*
62 * DCTDecode accepts quantization and huffman tables
63 * in case these tables have been omitted from the datastream.
64 */
65 (code = s_DCT_put_huffman_tables(plist, pdct, false)) < 0 ||
66 (code = s_DCT_put_quantization_tables(plist, pdct, false)) < 0
67 )
68 DO_NOTHING;
69 return code;
70 }
71