1 /*
2 * jcapimin.c
3 *
4 * Copyright (C) 1994-1998, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains application interface code for the compression half
9 * of the JPEG library. These are the "minimum" API routines that may be
10 * needed in either the normal full-compression case or the transcoding-only
11 * case.
12 *
13 * Most of the routines intended to be called directly by an application
14 * are in this file or in jcapistd.c. But also see jcparam.c for
15 * parameter-setup helper routines, jcomapi.c for routines shared by
16 * compression and decompression, and jctrans.c for the transcoding case.
17 */
18
19 #define JPEG_INTERNALS
20 #include "jinclude.h"
21 #include "jpeglib.h"
22
23
24 /*
56
57 /* Initialize a memory manager instance for this object */
58 jinit_memory_mgr((j_common_ptr) cinfo);
59
60 /* Zero out pointers to permanent structures. */
61 cinfo->progress = NULL;
62 cinfo->dest = NULL;
63
64 cinfo->comp_info = NULL;
65
66 for (i = 0; i < NUM_QUANT_TBLS; i++) {
67 cinfo->quant_tbl_ptrs[i] = NULL;
68 cinfo->q_scale_factor[i] = 100;
69 }
70
71 for (i = 0; i < NUM_HUFF_TBLS; i++) {
72 cinfo->dc_huff_tbl_ptrs[i] = NULL;
73 cinfo->ac_huff_tbl_ptrs[i] = NULL;
74 }
75
76 cinfo->script_space = NULL;
77
78 cinfo->input_gamma = 1.0; /* in case application forgets */
79
80 /* OK, I'm ready */
81 cinfo->global_state = CSTATE_START;
82 }
83
84
85 /*
86 * Destruction of a JPEG compression object
87 */
88
89 GLOBAL(void)
90 jpeg_destroy_compress (j_compress_ptr cinfo)
91 {
92 jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
93 }
94
95
|
1 /*
2 * jcapimin.c
3 *
4 * Copyright (C) 1994-1998, Thomas G. Lane.
5 * Modified 2003-2010 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains application interface code for the compression half
10 * of the JPEG library. These are the "minimum" API routines that may be
11 * needed in either the normal full-compression case or the transcoding-only
12 * case.
13 *
14 * Most of the routines intended to be called directly by an application
15 * are in this file or in jcapistd.c. But also see jcparam.c for
16 * parameter-setup helper routines, jcomapi.c for routines shared by
17 * compression and decompression, and jctrans.c for the transcoding case.
18 */
19
20 #define JPEG_INTERNALS
21 #include "jinclude.h"
22 #include "jpeglib.h"
23
24
25 /*
57
58 /* Initialize a memory manager instance for this object */
59 jinit_memory_mgr((j_common_ptr) cinfo);
60
61 /* Zero out pointers to permanent structures. */
62 cinfo->progress = NULL;
63 cinfo->dest = NULL;
64
65 cinfo->comp_info = NULL;
66
67 for (i = 0; i < NUM_QUANT_TBLS; i++) {
68 cinfo->quant_tbl_ptrs[i] = NULL;
69 cinfo->q_scale_factor[i] = 100;
70 }
71
72 for (i = 0; i < NUM_HUFF_TBLS; i++) {
73 cinfo->dc_huff_tbl_ptrs[i] = NULL;
74 cinfo->ac_huff_tbl_ptrs[i] = NULL;
75 }
76
77 /* Must do it here for emit_dqt in case jpeg_write_tables is used */
78 cinfo->block_size = DCTSIZE;
79 cinfo->natural_order = jpeg_natural_order;
80 cinfo->lim_Se = DCTSIZE2-1;
81
82 cinfo->script_space = NULL;
83
84 cinfo->input_gamma = 1.0; /* in case application forgets */
85
86 /* OK, I'm ready */
87 cinfo->global_state = CSTATE_START;
88 }
89
90
91 /*
92 * Destruction of a JPEG compression object
93 */
94
95 GLOBAL(void)
96 jpeg_destroy_compress (j_compress_ptr cinfo)
97 {
98 jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
99 }
100
101
|