ReactOS  0.4.14-dev-342-gdc047f9
jcomapi.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
Include dependency graph for jcomapi.c:

Go to the source code of this file.

Macros

#define JPEG_INTERNALS
 

Functions

 jpeg_abort (j_common_ptr cinfo)
 
 jpeg_destroy (j_common_ptr cinfo)
 
 jpeg_alloc_quant_table (j_common_ptr cinfo)
 
 jpeg_alloc_huff_table (j_common_ptr cinfo)
 

Macro Definition Documentation

◆ JPEG_INTERNALS

#define JPEG_INTERNALS

Definition at line 12 of file jcomapi.c.

Function Documentation

◆ jpeg_abort()

jpeg_abort ( j_common_ptr  cinfo)

Definition at line 29 of file jcomapi.c.

30 {
31  int pool;
32 
33  /* Do nothing if called on a not-initialized or destroyed JPEG object. */
34  if (cinfo->mem == NULL)
35  return;
36 
37  /* Releasing pools in reverse order might help avoid fragmentation
38  * with some (brain-damaged) malloc libraries.
39  */
40  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
41  (*cinfo->mem->free_pool) (cinfo, pool);
42  }
43 
44  /* Reset overall state for possible reuse of object */
45  if (cinfo->is_decompressor) {
46  cinfo->global_state = DSTATE_START;
47  /* Try to keep application from accessing now-deleted marker list.
48  * A bit kludgy to do it here, but this is the most central place.
49  */
50  ((j_decompress_ptr) cinfo)->marker_list = NULL;
51  } else {
52  cinfo->global_state = CSTATE_START;
53  }
54 }
struct jpeg_decompress_struct * j_decompress_ptr
Definition: jpeglib.h:286
#define CSTATE_START
Definition: jpegint.h:26
smooth NULL
Definition: ftsmooth.c:416
#define DSTATE_START
Definition: jpegint.h:30
#define JPOOL_NUMPOOLS
Definition: jpeglib.h:809
#define JPOOL_PERMANENT
Definition: jpeglib.h:807

Referenced by jpeg_abort_compress(), jpeg_abort_decompress(), jpeg_finish_compress(), jpeg_finish_decompress(), and jpeg_read_header().

◆ jpeg_alloc_huff_table()

jpeg_alloc_huff_table ( j_common_ptr  cinfo)

Definition at line 98 of file jcomapi.c.

99 {
100  JHUFF_TBL *tbl;
101 
102  tbl = (JHUFF_TBL *)
103  (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
104  tbl->sent_table = FALSE; /* make sure this is false in any new table */
105  return tbl;
106 }
boolean sent_table
Definition: jpeglib.h:119
#define SIZEOF(_ar)
Definition: calc.h:97
#define JPOOL_PERMANENT
Definition: jpeglib.h:807

Referenced by add_huff_table(), finish_pass_gather(), and get_dht().

◆ jpeg_alloc_quant_table()

jpeg_alloc_quant_table ( j_common_ptr  cinfo)

Definition at line 86 of file jcomapi.c.

87 {
88  JQUANT_TBL *tbl;
89 
90  tbl = (JQUANT_TBL *)
91  (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
92  tbl->sent_table = FALSE; /* make sure this is false in any new table */
93  return tbl;
94 }
#define SIZEOF(_ar)
Definition: calc.h:97
boolean sent_table
Definition: jpeglib.h:103
#define JPOOL_PERMANENT
Definition: jpeglib.h:807

Referenced by get_dqt(), jpeg_add_quant_table(), and jpeg_copy_critical_parameters().

◆ jpeg_destroy()

jpeg_destroy ( j_common_ptr  cinfo)

Definition at line 69 of file jcomapi.c.

70 {
71  /* We need only tell the memory manager to release everything. */
72  /* NB: mem pointer is NULL if memory mgr failed to initialize. */
73  if (cinfo->mem != NULL)
74  (*cinfo->mem->self_destruct) (cinfo);
75  cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
76  cinfo->global_state = 0; /* mark it destroyed */
77 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by error_exit(), jpeg_destroy_compress(), and jpeg_destroy_decompress().