MISR Toolkit  1.5.1
hcomp.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF. The full HDF copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the files COPYING and Copyright.html. COPYING can be found at the root *
9  * of the source code distribution tree; Copyright.html can be found at *
10  * http://hdfgroup.org/products/hdf4/doc/Copyright.html. If you do not have *
11  * access to either file, you may request a copy from help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /* $Id: hcomp.h 4932 2007-09-07 17:17:23Z bmribler $ */
15 
16 /*-----------------------------------------------------------------------------
17  * File: hcomp.h
18  * Purpose: header file for compression information & structures
19  * Dependencies: should be included after hdf.h
20  * Invokes:
21  * Contents:
22  * Structure definitions: comp_info
23  * Constant definitions: lots...
24  *---------------------------------------------------------------------------*/
25 
26 /* avoid re-inclusion */
27 #ifndef __HCOMP_H
28 #define __HCOMP_H
29 
30 /* For determining which type of modeling is being done */
31 typedef enum
32  {
33  COMP_MODEL_STDIO = 0 /* for Standard C I/O model */
34  }
36 
37 /* For determining which type of encoding is being done */
38 typedef enum
39  {
40  COMP_CODE_NONE = 0, /* don't encode at all, just store */
41  COMP_CODE_RLE, /* for simple RLE encoding */
42  COMP_CODE_NBIT, /* for N-bit encoding */
43  COMP_CODE_SKPHUFF, /* for Skipping huffman encoding */
44  COMP_CODE_DEFLATE, /* for gzip 'deflate' encoding */
45  COMP_CODE_SZIP, /* for szip encoding */
46  COMP_CODE_INVALID, /* invalid last code, for range checking */
47  COMP_CODE_JPEG /* _Ugly_ hack to allow JPEG images to be created with GRsetcompress */
48  }
50 
51 /* Compression types available */
52 #define COMP_NONE 0
53 #define COMP_JPEG 2
54 #define COMP_RLE 11
55 #define COMP_IMCOMP 12
56 
57 /* Compression encoder/decoder configuration */
58 #define COMP_DECODER_ENABLED 1
59 #define COMP_ENCODER_ENABLED 2
60 
61 #ifndef COMPRESS_MASTER
62 extern uint16 compress_map[];
63 #else
64 uint16 compress_map[COMP_MAX_COMP + 1] =
65 { /* Mapping from compression types to tags */
66  0, /* No corresponding tag for un-compressed data */
67  0, /* (1) */
68  DFTAG_JPEG5, /* COMP_JPEG -> DFTAG_JPEG5 (for JPEG compression) */
69  0, /* (3) */
70  0, /* (4) */
71  0, /* (5) */
72  0, /* (6) */
73  0, /* (7) */
74  0, /* (8) */
75  0, /* (9) */
76  0, /* (10) */
77  DFTAG_RLE, /* COMP_RLE -> DFTAG_RLE (for Run-length compression) */
78  DFTAG_IMC /* COMP_IMCOMP -> DFTAG_IMC (for IMCOMP compression) */
79 };
80 #endif
81 
82 typedef union tag_model_info
83  { /* Union to contain modeling information */
84  struct
85  {
86  int32 nt; /* number type */
87  intn ndim; /* number of dimensions */
88  int32 *dims; /* array of dimensions */
89  }
90  dim;
91  }
93 
94 typedef union tag_comp_info
95  { /* Union to contain compression information */
96  struct
97  { /* Struct to contain information about how to compress */
98  /* or decompress a JPEG encoded 24-bit image */
99  intn quality; /* Quality factor for JPEG compression, should be from */
100  /* 0 (terrible) to 100 (very good) */
101  intn force_baseline; /* If force_baseline is set to TRUE then */
102  /* quantization tables are limited to */
103  /* 0..255 for JPEG baseline compability */
104  /* This is only an issue for quality */
105  /* settings below 24 */
106  }
107  jpeg;
108  struct
109  { /* struct to contain information about how to compress */
110  /* or decompress a N-bit encoded dataset */
111  int32 nt; /* number type of the data to encode */
112  intn sign_ext; /* whether to sign extend or not */
113  intn fill_one; /* whether to fill with 1's or 0's */
114  intn start_bit; /* offset of the start bit in the data */
115  intn bit_len; /* number of bits to store */
116  }
117  nbit;
118  struct
119  { /* struct to contain info about how to compress */
120  /* or decompress a "skipping" huffman encoded dataset */
121  intn skp_size; /* size of the individual elements when skipping */
122  }
123  skphuff;
124  struct
125  { /* struct to contain info about how to compress */
126  /* or decompress a gzip encoded dataset */
127  intn level; /* how hard to work when compressing the data */
128  }
129  deflate;
130  struct
131  {
132  int32 options_mask; /* IN */
133  int32 pixels_per_block; /* IN */
134  int32 pixels_per_scanline; /* OUT: computed */
135  int32 bits_per_pixel; /* OUT: size of NT */
136  int32 pixels; /* OUT: size of dataset or chunk */
137  }
138  szip; /* for szip encoding */
139 
140  }
141 comp_info;
142 
143 #endif /* __HCOMP_H */
144 
comp_model_t
Definition: hcomp.h:31
int32 pixels
Definition: hcomp.h:136
int32 pixels_per_scanline
Definition: hcomp.h:134
intn quality
Definition: hcomp.h:99
union tag_model_info model_info
int32 pixels_per_block
Definition: hcomp.h:133
union tag_comp_info comp_info
intn force_baseline
Definition: hcomp.h:101
int32 * dims
Definition: hcomp.h:88
uint16 compress_map[]
intn skp_size
Definition: hcomp.h:121
struct tag_model_info::@6 dim
intn fill_one
Definition: hcomp.h:113
int32 nt
Definition: hcomp.h:111
int32 nt
Definition: hcomp.h:86
intn ndim
Definition: hcomp.h:87
#define COMP_MAX_COMP
Definition: hlimits.h:148
int32 bits_per_pixel
Definition: hcomp.h:135
intn sign_ext
Definition: hcomp.h:112
comp_coder_t
Definition: hcomp.h:38
#define DFTAG_RLE
Definition: htags.h:114
intn start_bit
Definition: hcomp.h:114
int32 options_mask
Definition: hcomp.h:132
#define DFTAG_JPEG5
Definition: htags.h:119
#define DFTAG_IMC
Definition: htags.h:115
intn bit_len
Definition: hcomp.h:115
intn level
Definition: hcomp.h:127

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52