image.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #if !defined (mdl_type_resource_generator) && !defined (mdl_resource_compiler)
12 #endif
13 
15 
16 typedef struct rgbFile RGBFile;
17 
19 
20 /*----------------------------------------------------------------------+
21 | |
22 | Video File Formats |
23 | |
24 +----------------------------------------------------------------------*/
26  {
27  VIDEOFILE_FLI = 14,/* Replace the now obsolete IMAGEFILE_FLI*/
28  VIDEOFILE_FLC = 15,/* Replace the now obsolete IMAGEFILE_FLC*/
29  VIDEOFILE_AVI = 26,/* Replace the now obsolete IMAGEFILE_AVI*/
30  VIDEOFILE_WMV = 53,/* Replace the now obsolete IMAGEFILE_WMV*/
31  //Add new type here
32 
33  };
34 
35 
36 /*----------------------------------------------------------------------+
37 | |
38 | Image File Formats |
39 | |
40 +----------------------------------------------------------------------*/
42  {
44  //IMAGEFILE_RAWTIFF = 0, /* Obsolete: use IMAGEFILE_TIFF with COMPRESSTYPE_NONE*/
58  _IMAGEFILE_FLI = VIDEOFILE_FLI, /* IMAGEFILE_FLI is now obsolete in mdlImage - use mdlVideo API and VIDEOFILE_FLI*/
59  _IMAGEFILE_FLC = VIDEOFILE_FLC, /* IMAGEFILE_FLC is now obsolete in mdlImage - use mdlVideo API and VIDEOFILE_FLC*/
70  _IMAGEFILE_AVI = VIDEOFILE_AVI, /* IMAGEFILE_AVI is now obsolete in mdlImage - use mdlVideo API and VIDEOFILE_AVI*/
86  //IMAGEFILE_RGBCOMPRESSED = 42, Obsolete: use IMAGEFILE_RGB with COMPRESSTYPE_RLE8
97  _IMAGEFILE_WMV = VIDEOFILE_WMV, /* IMAGEFILE_WMV is now obsolete in mdlImage - use mdlVideo API and VIDEOFILE_WMV*/
109 
110  //Value between 1000 and 2000 are reserved for COM file format- Image COM file plugin ID will dynamically be assigned in this range
111 
112  // There is no actual support for this format in our image routines, but these IMAGEFILE_ values have propagated to other
113  // code assets that need image enum values that DO provide support for this format. As of 2011 the PowerVR texture
114  // format is the ideal format for iOS devices and we include support for it in our panorama technology stack.
115  // We use a .pvr extension for files in this format and a mime-type of image/vnd.pvrtc
117  };
118 
119 #if !defined (mdl_type_resource_generator) && !defined (mdl_resource_compiler)
120 static const long IMAGEFILE_ALL =-1;
121 static const long IMAGEFILE_ALLIMAGEFILES = 98;
122 static const long IMAGEFILE_ALLFILES = 99;
123 
124  // Image COM file plugin ID will dynamically be assigned in this range.
125 static const long IMAGEFILE_MIN_COM_RESERVED = 1000;
126 static const long IMAGEFILE_MAX_COM_RESERVED = 2000;
127 #else
128 #define IMAGEFILE_ALL (-1)
129 #define IMAGEFILE_ALLIMAGEFILES (98)
130 #define IMAGEFILE_ALLFILES (99)
131 #endif
132 
133 /*----------------------------------------------------------------------+
134 | |
135 | Image Formats |
136 | |
137 +----------------------------------------------------------------------*/
139  {
149  IMAGEFORMAT_BGRA = 10, // Same as Windows DIB
152  };
153 
154 /*----------------------------------------------------------------------+
155 | |
156 | Degrees of Compression |
157 | |
158 +----------------------------------------------------------------------*/
160  {
162  COMPRESSIONRATIO_MIN = 90, //minimal compression - better image quality
163  COMPRESSIONRATIO_LOW = 75, // | ^
164  COMPRESSIONRATIO_MED = 55, // V |
165  COMPRESSIONRATIO_HIGH = 40, //high compression - lowest image quality
167  };
168 
169 
170 /*----------------------------------------------------------------------+
171 | |
172 | Compression Algorithms (use TIFF types where possible) |
173 | |
174 +----------------------------------------------------------------------*/
176  {
178  COMPRESSTYPE_NONE = 0, /* no compression (old false) */
179  COMPRESSTYPE_DEFAULT = 1, /* default compression (old true) */
180  COMPRESSTYPE_CCITTRLE = 2, /* CCITT modified Huffman RLE */
181  COMPRESSTYPE_CCITTFAX3 = 3, /* CCITT Group 3 fax encoding */
182  COMPRESSTYPE_CCITTFAX4 = 4, /* CCITT Group 4 fax encoding */
183  COMPRESSTYPE_LZW = 5, /* Lempel-Ziv & Welch */
184  COMPRESSTYPE_OJPEG = 6, /* !6.0 JPEG */
185  COMPRESSTYPE_JPEG = 7, /* %JPEG DCT compression */
186  COMPRESSTYPE_BMPRLE8 = 8, /* BMP RLE8 */
187  COMPRESSTYPE_BMPRLE4 = 9, /* BMP RLE4 */
188  COMPRESSTYPE_GIFLZW = 10, /* GIF LZW */
189  COMPRESSTYPE_NEXT = 32766, /* NeXT 2-bit RLE */
190  COMPRESSTYPE_CCITTRLEW = 32771, /* #1 w/ word alignment */
191  COMPRESSTYPE_PACKBITS = 32773, /* Macintosh RLE */
192  COMPRESSTYPE_THUNDERSCAN = 32809, /* ThunderScan RLE */
193  COMPRESSTYPE_PIXARFILM = 32908, /* Pixar companded 10bit LZW */
194  COMPRESSTYPE_DEFLATE = 32946, /* Deflate compression */
195  COMPRESSTYPE_JBIG = 34661, /* ISO JBIG */
196 
197  COMPRESSTYPE_JPEG2000 = 34712, /* JPEG2000 */
198 // COMPRESSTYPE_JPEG2000LOSSLESS= 34713, /* Obsolete: use COMPRESSTYPE_JPEG2000 with COMPRESSIONRATIO_LOSSLESS */
199 // COMPRESSTYPE_JPEG2000MIN = 34714, /* Obsolete: use COMPRESSTYPE_JPEG2000 with COMPRESSIONRATIO_MIN */
200 // COMPRESSTYPE_JPEG2000LOW = 34715, /* Obsolete: use COMPRESSTYPE_JPEG2000 with COMPRESSIONRATIO_LOW */
201 // COMPRESSTYPE_JPEG2000MED = 34716, /* Obsolete: use COMPRESSTYPE_JPEG2000 with COMPRESSIONRATIO_MED */
202 // COMPRESSTYPE_JPEG2000HIGH = 34717, /* Obsolete: use COMPRESSTYPE_JPEG2000 with COMPRESSIONRATIO_HIGH */
203 
204  COMPRESSTYPE_ECW = 34811, /* ECW ERMAPPER*/
205 // COMPRESSTYPE_ECWMIN = 34812, /* Obsolete: use COMPRESSTYPE_ECW with COMPRESSIONRATIO_MIN */
206 // COMPRESSTYPE_ECWLOW = 34813, /* Obsolete: use COMPRESSTYPE_ECW with COMPRESSIONRATIO_LOW */
207 // COMPRESSTYPE_ECWMED = 34814, /* Obsolete: use COMPRESSTYPE_ECW with COMPRESSIONRATIO_MED */
208 // COMPRESSTYPE_ECWHIGH = 34815, /* Obsolete: use COMPRESSTYPE_ECW with COMPRESSIONRATIO_HIGH */
209 
210 // COMPRESSTYPE_JPEGMIN = COMPRESSIONRATIO_MIN, /* Obsolete: use COMPRESSTYPE_JPEG with COMPRESSIONRATIO_MIN */
211 // COMPRESSTYPE_JPEGLOW = COMPRESSIONRATIO_LOW, /* Obsolete: use COMPRESSTYPE_JPEG with COMPRESSIONRATIO_LOW */
212 // COMPRESSTYPE_JPEGMED = COMPRESSIONRATIO_MED, /* Obsolete: use COMPRESSTYPE_JPEG with COMPRESSIONRATIO_MED */
213 // COMPRESSTYPE_JPEGHIGH = COMPRESSIONRATIO_HIGH, /* Obsolete: use COMPRESSTYPE_JPEG with COMPRESSIONRATIO_HIGH */
214  COMPRESSTYPE_RLE1 = 40000, /* RLE1 compression */
215  COMPRESSTYPE_RLE8 = 40001, /* RLE8 compression */
216  COMPRESSTYPE_ZLIB = 40002, /* ZLIB compression */
217  COMPRESSTYPE_FLASHPIX = 40003, /* FLASHPIX compression */
218  COMPRESSTYPE_TGARLE = 40213, /* TARGA RLE compression*/
219  COMPRESSTYPE_LRD = 40214, /* LRD (special RLE ) compression*/
220  COMPRESSTYPE_FLIRLE8 = 40215, /* FLI (special RLE ) compression*/
221  COMPRESSTYPE_CRL8 = 40216 /* CRL (special RLE ) compression*/
222  };
223 
224 
225 
226 /*----------------------------------------------------------------------+
227 | |
228 | Orientations (as returned by mdlImage_extractIngrAttach) |
229 | |
230 +----------------------------------------------------------------------*/
232  {
241  };
242 
243 /*----------------------------------------------------------------------+
244 | |
245 | Orientations (as returned by mdlImage_readFileParams |
246 | |
247 +----------------------------------------------------------------------*/
249  {
250  TOP_LEFT = 0,
254  };
255 
256 
257 
258 /*----------------------------------------------------------------------+
259 | |
260 | Miscellaneous |
261 | |
262 +----------------------------------------------------------------------*/
263 #if !defined (mdl_type_resource_generator) && !defined (mdl_resource_compiler)
264 static const double MONOCHROME_THRESHOLD = 128.0;
265 #else
266 #define MONOCHROME_THRESHOLD 128.0
267 #endif
268 #define BITMAP_ROWBYTES(nColumns) (((nColumns) + 7) >> 3)
269 #define BITMAP_BYTES(nColumns, nRows) (nRows * BITMAP_ROWBYTES(nColumns))
270 
271 /*----------------------------------------------------------------------+
272 | |
273 | Movie Frame Transition Modes |
274 | |
275 +----------------------------------------------------------------------*/
277  {
282  };
283 
284 /*----------------------------------------------------------------------+
285 | |
286 | Movies Structure |
287 | |
288 +----------------------------------------------------------------------*/
289 #if ! defined (resource)
290 
291 typedef struct msMovieFrame
292  {
298  } MSMovieFrame;
299 
300 typedef struct msMovies
301  {
304  int nFrames;
305  int speed;
306  byte redMap[256];
307  byte grnMap[256];
308  byte bluMap[256];
311  bool buffered;
312  } MSMovie;
313 
314 #endif
315 
struct Bentley::DgnPlatform::msMovies MSMovie
struct rgbFile RGBFile
Definition: image.h:16
int speed
Definition: image.h:305
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
bool buffered
Definition: image.h:311
Definition: image.h:251
Integer x,y rectangle coordinates.
Definition: BSIRect.h:24
int imageFormat
Definition: image.h:295
double gammaCorrection
Definition: image.h:310
VideoFileFormat
Definition: image.h:25
Definition: image.h:252
Definition: DgnPlatform.r.h:25
BSIRect changeRect
Definition: image.h:296
Definition: image.h:291
CompressionRatio
Definition: image.h:159
Definition: image.h:300
Definition: image.h:281
ImageIngrOrientation
Definition: image.h:231
Definition: image.h:250
int paletteSize
Definition: image.h:309
unsigned char byte
Definition: Bentley.r.h:144
MovieFrameTransition
Definition: image.h:276
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
struct msMovieFrame * nextP
Definition: image.h:297
wchar_t TagWChar
Definition: DgnPlatform.r.h:1729
byte * dataP
Definition: image.h:293
MSMovieFrame * firstFrameP
Definition: image.h:302
Point2d size
Definition: image.h:303
ImageFileFormat
Definition: image.h:41
Definition: image.h:253
ImageFormat
Definition: image.h:138
ImageOriginOrientation
Definition: image.h:248
An integer 2d point, useful for screen pixel references, but not for real geometry.
Definition: Point.h:20
struct Bentley::DgnPlatform::msMovieFrame MSMovieFrame
Integer x,y rectangle coordinates for GUI: BSIRect.
CompressionType
Definition: image.h:175
int nFrames
Definition: image.h:304

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.