Coverage Report

Created: 2025-06-24 07:01

/src/ghostpdl/base/sddparam.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (C) 2001-2023 Artifex Software, Inc.
2
   All Rights Reserved.
3
4
   This software is provided AS-IS with no warranty, either express or
5
   implied.
6
7
   This software is distributed under license and may not be copied,
8
   modified or distributed except as expressly authorized under the terms
9
   of the license contained in the file LICENSE in this distribution.
10
11
   Refer to licensing information at http://www.artifex.com or contact
12
   Artifex Software, Inc.,  39 Mesa Street, Suite 108A, San Francisco,
13
   CA 94129, USA, for further information.
14
*/
15
16
17
/* DCTDecode filter parameter setting and reading */
18
#include "std.h"
19
#include "jpeglib_.h"
20
#include "gserrors.h"
21
#include "gstypes.h"
22
#include "gsmemory.h"
23
#include "gsparam.h"
24
#include "strimpl.h"    /* sdct.h requires this */
25
#include "sdct.h"
26
#include "sdcparam.h"
27
#include "sjpeg.h"
28
29
/* ================ Get parameters ================ */
30
31
stream_state_proc_get_params(s_DCTD_get_params, stream_DCT_state);  /* check */
32
33
int
34
s_DCTD_get_params(gs_param_list * plist, const stream_DCT_state * ss, bool all)
35
0
{
36
0
    stream_DCT_state dcts_defaults;
37
0
    const stream_DCT_state *defaults;
38
39
0
    if (all)
40
0
        defaults = 0;
41
0
    else {
42
0
        (*s_DCTE_template.set_defaults) ((stream_state *) & dcts_defaults);
43
0
        defaults = &dcts_defaults;
44
0
    }
45
/****** NYI ******/
46
0
    return s_DCT_get_params(plist, ss, defaults);
47
0
}
48
49
/* ================ Put parameters ================ */
50
51
stream_state_proc_put_params(s_DCTD_put_params, stream_DCT_state);  /* check */
52
53
int
54
s_DCTD_put_params(gs_param_list * plist, stream_DCT_state * pdct)
55
0
{
56
0
    int code;
57
58
0
    if ((code = s_DCT_put_params(plist, pdct)) < 0 ||
59
    /*
60
     * DCTDecode accepts quantization and huffman tables
61
     * in case these tables have been omitted from the datastream.
62
     */
63
0
        (code = s_DCT_put_huffman_tables(plist, pdct, false)) < 0 ||
64
0
        (code = s_DCT_put_quantization_tables(plist, pdct, false)) < 0
65
0
        )
66
0
        DO_NOTHING;
67
0
    return code;
68
0
}