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.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 //
 28 //
 29 
 30 // class description:
 31 //
 32 //  This header file defines some static constant variables and error classes
 33 // used internally by G4JpegMaker and related classes
 34 //
 35 
 36 #ifndef G4RTJpeg_H
 37 #define G4RTJpeg_H 1
 38 
 39 typedef unsigned char u_char;
 40 typedef unsigned int  u_int;
 41 
 42 const char      JFIF[] = "JFIF";
 43 const char      JFXX[] = "JFXX";
 44 
 45 const double    Sqrt2 = 1.41421356;
 46 const double    DisSqrt2 = 1.0 / Sqrt2;
 47 const double    PaiDiv16 = 3.14159265 / 16;
 48 
 49 //Zigzag
 50 static const int Zigzag[64] = {
 51                  0,  1,  8, 16,  9,  2,  3, 10,
 52                 17, 24, 32, 25, 18, 11,  4,  5,
 53                 12, 19, 26, 33, 40, 48, 41, 34,
 54                 27, 20, 13,  6,  7, 14, 21, 28,
 55                 35, 42, 49, 56, 57, 50, 43, 36,
 56                 29, 22, 15, 23, 30, 37, 44, 51,
 57                 58, 59, 52, 45, 38, 31, 39, 46,
 58                 53, 60, 61, 54, 47, 55, 62, 63
 59 };
 60 
 61 //ProcessResult
 62 enum
 63 jProcessResult{
 64   M_NoError = 0,
 65   M_RuntimeError = -1,
 66   M_DataError = -2
 67 };
 68 
 69 // JpegMarkerCode
 70 enum
 71 jMarker{
 72 
 73         M_SOF0  = 0xc0,
 74         M_SOF1  = 0xc1,
 75         M_SOF2  = 0xc2,
 76         M_SOF3  = 0xc3,
 77 
 78         M_SOF5  = 0xc5,
 79         M_SOF6  = 0xc6,
 80         M_SOF7  = 0xc7,
 81 
 82         M_JPG   = 0xc8,
 83         M_SOF9  = 0xc9,
 84         M_SOF10 = 0xca,
 85         M_SOF11 = 0xcb,
 86 
 87         M_SOF13 = 0xcd,
 88         M_SOF14 = 0xce,
 89         M_SOF15 = 0xcf,
 90 
 91         M_DHT   = 0xc4,
 92 
 93         M_DAC   = 0xcc,
 94 
 95         M_RST0  = 0xd0,         M_RST1  = 0xd1,
 96         M_RST2  = 0xd2,         M_RST3  = 0xd3,
 97         M_RST4  = 0xd4,         M_RST5  = 0xd5,
 98         M_RST6  = 0xd6,         M_RST7  = 0xd7,
 99 
100         M_SOI   = 0xd8,
101         M_EOI   = 0xd9,
102         M_SOS   = 0xda,
103         M_DQT   = 0xdb,
104         M_DNL   = 0xdc,
105         M_DRI   = 0xdd,
106         M_DHP   = 0xde,
107         M_EXP   = 0xdf,
108         M_COM   = 0xfe,
109 
110         M_APP0  = 0xe0,         M_APP1  = 0xe1,
111         M_APP2  = 0xe2,         M_APP3  = 0xe3,
112         M_APP4  = 0xe4,         M_APP5  = 0xe5,
113         M_APP6  = 0xe6,         M_APP7  = 0xe7,
114         M_APP8  = 0xe8,         M_APP9  = 0xe9,
115         M_APP10 = 0xea,         M_APP11 = 0xeb,
116         M_APP12 = 0xec,         M_APP13 = 0xed,
117         M_APP14 = 0xee,         M_APP15 = 0xef,
118 
119 
120         M_JPG0  = 0xf0,         M_JPG1  = 0xf1,
121         M_JPG2  = 0xf2,         M_JPG3  = 0xf3,
122         M_JPG4  = 0xf4,         M_JPG5  = 0xf5,
123         M_JPG6  = 0xf6,         M_JPG7  = 0xf7,
124         M_JPG8  = 0xf8,         M_JPG9  = 0xf9,
125         M_JPG10 = 0xfa,         M_JPG11 = 0xfb,
126         M_JPG12 = 0xfc,         M_JPG13 = 0xfd,
127 
128 
129         M_TEM   = 0x01,
130         M_RESst  = 0x02,
131         M_RESend = 0xbf,
132 
133         M_Error  = 0xff,
134         M_Marker  = 0xff
135 };
136 
137 //JpegProperty
138 struct
139 G4JpegProperty{
140   G4JpegProperty()
141     :nRow(0)
142     ,nColumn(0)
143     ,Dimension(0)
144     ,SamplePrecision(0)
145     ,Comment(0)
146     ,Format(0)
147     ,MajorRevisions(0)
148     ,MinorRevisions(0)
149     ,Units(0)
150     ,HDensity(0)
151     ,VDensity(0)
152     ,HThumbnail(0)
153     ,VThumbnail(0)
154     ,ExtensionCode(0)
155   {}
156   int nRow;
157   int nColumn;
158   int Dimension;
159   int SamplePrecision;
160   const char * Comment;
161   int Format;
162   u_char MajorRevisions;
163   u_char MinorRevisions;
164   int Units;
165   int HDensity;
166   int VDensity;
167   int HThumbnail;
168   int VThumbnail;
169   int ExtensionCode;
170 };
171 
172 
173 //MemoryError
174 class G4MemoryError
175 {
176   public:
177     G4MemoryError(int size, const char* message)
178         {mSize = size;          mMessage = message;};
179         int mSize;
180         const char* mMessage;
181 };
182 
183 //IndexError
184 class G4IndexError
185 {
186   public:
187     G4IndexError(int maxIndex, int errorIndex, const char* mes)
188         {mMaxIndex = maxIndex;  mErrorIndex = errorIndex;  mMessage = mes;};
189         int mMaxIndex;
190         int mErrorIndex;
191         const char* mMessage;
192 };
193 
194 //BufferError
195 class G4BufferError
196 {
197   public:
198     G4BufferError(const char* mes)
199         {mMessage = mes;};
200         const char* mMessage;
201 };
202 
203 //DataFormatError
204 class G4DataFormatError
205 {
206   public:
207     G4DataFormatError(void* address, const char* message)
208         {mAddress = address;            mMessage = message;};
209         void* mAddress;
210         const char* mMessage;
211 };
212 
213 
214 //NotSupported
215 class G4NotSupported
216 {
217   public:
218     G4NotSupported(jMarker aMark, void* address)
219         {mMark = aMark;         mAddress = address;};
220         jMarker mMark;
221         void* mAddress;
222 };
223 
224 #endif
225