Geant4  10.00.p03
G4RTJpeg.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4RTJpeg.hh 66373 2012-12-18 09:41:34Z gcosmo $
28 //
29 //
30 
31 // class description:
32 //
33 // This header file defines some static constant variables and error classes
34 // used internally by G4JpegMaker and related classes
35 //
36 
37 #ifndef G4RTJpeg_H
38 #define G4RTJpeg_H 1
39 
40 typedef unsigned char u_char;
41 typedef unsigned int u_int;
42 
43 const char JFIF[] = "JFIF";
44 const char JFXX[] = "JFXX";
45 
46 const double Sqrt2 = 1.41421356;
47 const double DisSqrt2 = 1.0 / Sqrt2;
48 const double PaiDiv16 = 3.14159265 / 16;
49 
50 //Zigzag
51 static const int Zigzag[64] = {
52  0, 1, 8, 16, 9, 2, 3, 10,
53  17, 24, 32, 25, 18, 11, 4, 5,
54  12, 19, 26, 33, 40, 48, 41, 34,
55  27, 20, 13, 6, 7, 14, 21, 28,
56  35, 42, 49, 56, 57, 50, 43, 36,
57  29, 22, 15, 23, 30, 37, 44, 51,
58  58, 59, 52, 45, 38, 31, 39, 46,
59  53, 60, 61, 54, 47, 55, 62, 63
60 };
61 
62 //ProcessResult
63 enum
65  M_NoError = 0,
68 };
69 
70 // JpegMarkerCode
71 enum
72 jMarker{
73 
74  M_SOF0 = 0xc0,
75  M_SOF1 = 0xc1,
76  M_SOF2 = 0xc2,
77  M_SOF3 = 0xc3,
78 
79  M_SOF5 = 0xc5,
80  M_SOF6 = 0xc6,
81  M_SOF7 = 0xc7,
82 
83  M_JPG = 0xc8,
84  M_SOF9 = 0xc9,
85  M_SOF10 = 0xca,
86  M_SOF11 = 0xcb,
87 
88  M_SOF13 = 0xcd,
89  M_SOF14 = 0xce,
90  M_SOF15 = 0xcf,
91 
92  M_DHT = 0xc4,
93 
94  M_DAC = 0xcc,
95 
96  M_RST0 = 0xd0, M_RST1 = 0xd1,
97  M_RST2 = 0xd2, M_RST3 = 0xd3,
98  M_RST4 = 0xd4, M_RST5 = 0xd5,
99  M_RST6 = 0xd6, M_RST7 = 0xd7,
100 
101  M_SOI = 0xd8,
102  M_EOI = 0xd9,
103  M_SOS = 0xda,
104  M_DQT = 0xdb,
105  M_DNL = 0xdc,
106  M_DRI = 0xdd,
107  M_DHP = 0xde,
108  M_EXP = 0xdf,
109  M_COM = 0xfe,
110 
111  M_APP0 = 0xe0, M_APP1 = 0xe1,
112  M_APP2 = 0xe2, M_APP3 = 0xe3,
113  M_APP4 = 0xe4, M_APP5 = 0xe5,
114  M_APP6 = 0xe6, M_APP7 = 0xe7,
115  M_APP8 = 0xe8, M_APP9 = 0xe9,
116  M_APP10 = 0xea, M_APP11 = 0xeb,
117  M_APP12 = 0xec, M_APP13 = 0xed,
118  M_APP14 = 0xee, M_APP15 = 0xef,
119 
120 
121  M_JPG0 = 0xf0, M_JPG1 = 0xf1,
122  M_JPG2 = 0xf2, M_JPG3 = 0xf3,
123  M_JPG4 = 0xf4, M_JPG5 = 0xf5,
124  M_JPG6 = 0xf6, M_JPG7 = 0xf7,
125  M_JPG8 = 0xf8, M_JPG9 = 0xf9,
126  M_JPG10 = 0xfa, M_JPG11 = 0xfb,
127  M_JPG12 = 0xfc, M_JPG13 = 0xfd,
128 
129 
130  M_TEM = 0x01,
131  M_RESst = 0x02,
132  M_RESend = 0xbf,
133 
134  M_Error = 0xff,
135  M_Marker = 0xff
136 };
137 
138 //JpegProperty
139 struct
142  :nRow(0)
143  ,nColumn(0)
144  ,Dimension(0)
145  ,SamplePrecision(0)
146  ,Comment(0)
147  ,Format(0)
148  ,MajorRevisions(0)
149  ,MinorRevisions(0)
150  ,Units(0)
151  ,HDensity(0)
152  ,VDensity(0)
153  ,HThumbnail(0)
154  ,VThumbnail(0)
155  ,ExtensionCode(0)
156  {}
157  int nRow;
158  int nColumn;
161  const char * Comment;
162  int Format;
165  int Units;
166  int HDensity;
167  int VDensity;
171 };
172 
173 
174 //MemoryError
176 {
177  public:
178  G4MemoryError(int size, const char* message)
179  {mSize = size; mMessage = message;};
180  int mSize;
181  const char* mMessage;
182 };
183 
184 //IndexError
186 {
187  public:
188  G4IndexError(int maxIndex, int errorIndex, const char* mes)
189  {mMaxIndex = maxIndex; mErrorIndex = errorIndex; mMessage = mes;};
190  int mMaxIndex;
192  const char* mMessage;
193 };
194 
195 //BufferError
197 {
198  public:
199  G4BufferError(const char* mes)
200  {mMessage = mes;};
201  const char* mMessage;
202 };
203 
204 //DataFormatError
206 {
207  public:
208  G4DataFormatError(void* address, const char* message)
209  {mAddress = address; mMessage = message;};
210  void* mAddress;
211  const char* mMessage;
212 };
213 
214 
215 //NotSupported
217 {
218  public:
219  G4NotSupported(jMarker aMark, void* address)
220  {mMark = aMark; mAddress = address;};
221  jMarker mMark;
222  void* mAddress;
223 };
224 
225 #endif
const char * mMessage
Definition: G4RTJpeg.hh:200
const char * mMessage
Definition: G4RTJpeg.hh:211
unsigned int u_int
Definition: G4RTJpeg.hh:41
const double DisSqrt2
Definition: G4RTJpeg.hh:47
const double PaiDiv16
Definition: G4RTJpeg.hh:48
u_char MinorRevisions
Definition: G4RTJpeg.hh:164
G4NotSupported(jMarker aMark, void *address)
Definition: G4RTJpeg.hh:219
int SamplePrecision
Definition: G4RTJpeg.hh:160
const char * mMessage
Definition: G4RTJpeg.hh:192
static const int Zigzag[64]
Definition: G4RTJpeg.hh:51
G4BufferError(const char *mes)
Definition: G4RTJpeg.hh:199
G4MemoryError(int size, const char *message)
Definition: G4RTJpeg.hh:178
jMarker mMark
Definition: G4RTJpeg.hh:220
const char JFXX[]
Definition: G4RTJpeg.hh:44
jMarker
Definition: G4RTJpeg.hh:71
unsigned char u_char
Definition: G4RTJpeg.hh:40
const char * mMessage
Definition: G4RTJpeg.hh:181
G4IndexError(int maxIndex, int errorIndex, const char *mes)
Definition: G4RTJpeg.hh:188
const char * Comment
Definition: G4RTJpeg.hh:161
int mErrorIndex
Definition: G4RTJpeg.hh:191
const char JFIF[]
Definition: G4RTJpeg.hh:43
jProcessResult
Definition: G4RTJpeg.hh:63
u_char MajorRevisions
Definition: G4RTJpeg.hh:163
const double Sqrt2
Definition: G4RTJpeg.hh:46
G4DataFormatError(void *address, const char *message)
Definition: G4RTJpeg.hh:208
void * mAddress
Definition: G4RTJpeg.hh:222