1 /* 2 * Copyright (C) 2007 Google (Evan Stade) 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 18 19 #ifndef _GDIPLUSIMAGING_H 20 #define _GDIPLUSIMAGING_H 21 22 DEFINE_GUID(ImageFormatUndefined, 0xb96b3ca9, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 23 DEFINE_GUID(ImageFormatMemoryBMP, 0xb96b3caa, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 24 DEFINE_GUID(ImageFormatBMP, 0xb96b3cab, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 25 DEFINE_GUID(ImageFormatEMF, 0xb96b3cac, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 26 DEFINE_GUID(ImageFormatWMF, 0xb96b3cad, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 27 DEFINE_GUID(ImageFormatJPEG, 0xb96b3cae, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 28 DEFINE_GUID(ImageFormatPNG, 0xb96b3caf, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 29 DEFINE_GUID(ImageFormatGIF, 0xb96b3cb0, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 30 DEFINE_GUID(ImageFormatTIFF, 0xb96b3cb1, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 31 DEFINE_GUID(ImageFormatEXIF, 0xb96b3cb2, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 32 DEFINE_GUID(ImageFormatIcon, 0xb96b3cb5, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); 33 34 DEFINE_GUID(FrameDimensionTime, 0x6aedbd6d, 0x3fb5, 0x418a, 0x83, 0xa6, 0x7f, 0x45, 0x22, 0x9d, 0xc8, 0x72); 35 DEFINE_GUID(FrameDimensionPage, 0x7462dc86, 0x6180, 0x4c7e, 0x8e, 0x3f, 0xee, 0x73, 0x33, 0xa7, 0xa4, 0x83); 36 DEFINE_GUID(FrameDimensionResolution, 0x84236f7b, 0x3bd3, 0x428f, 0x8d, 0xab, 0x4e, 0xa1, 0x43, 0x9c, 0xa3, 0x15); 37 38 enum ImageLockMode 39 { 40 ImageLockModeRead = 1, 41 ImageLockModeWrite = 2, 42 ImageLockModeUserInputBuf = 4 43 }; 44 45 enum RotateFlipType 46 { 47 RotateNoneFlipNone = 0, 48 Rotate180FlipXY = RotateNoneFlipNone, 49 50 Rotate90FlipNone = 1, 51 Rotate270FlipXY = Rotate90FlipNone, 52 53 Rotate180FlipNone = 2, 54 RotateNoneFlipXY = Rotate180FlipNone, 55 56 Rotate270FlipNone = 3, 57 Rotate90FlipXY = Rotate270FlipNone, 58 59 RotateNoneFlipX = 4, 60 Rotate180FlipY = RotateNoneFlipX, 61 62 Rotate90FlipX = 5, 63 Rotate270FlipY = Rotate90FlipX, 64 65 Rotate180FlipX = 6, 66 RotateNoneFlipY = Rotate180FlipX, 67 68 Rotate270FlipX = 7, 69 Rotate90FlipY = Rotate270FlipX 70 }; 71 72 #ifdef __cplusplus 73 class EncoderParameter 74 { 75 public: 76 GUID Guid; 77 ULONG NumberOfValues; 78 ULONG Type; 79 VOID* Value; 80 }; 81 82 class EncoderParameters 83 { 84 public: 85 UINT Count; 86 EncoderParameter Parameter[1]; 87 }; 88 89 class ImageCodecInfo 90 { 91 public: 92 CLSID Clsid; 93 GUID FormatID; 94 const WCHAR* CodecName; 95 const WCHAR* DllName; 96 const WCHAR* FormatDescription; 97 const WCHAR* FilenameExtension; 98 const WCHAR* MimeType; 99 DWORD Flags; 100 DWORD Version; 101 DWORD SigCount; 102 DWORD SigSize; 103 const BYTE* SigPattern; 104 const BYTE* SigMask; 105 }; 106 107 class BitmapData 108 { 109 public: 110 UINT Width; 111 UINT Height; 112 INT Stride; 113 Gdiplus::PixelFormat PixelFormat; 114 VOID* Scan0; 115 UINT_PTR Reserved; 116 }; 117 118 class ImageItemData 119 { 120 public: 121 UINT Size; 122 UINT Position; 123 VOID* Desc; 124 UINT DescSize; 125 VOID* Data; 126 UINT DataSize; 127 UINT Cookie; 128 }; 129 130 class PropertyItem 131 { 132 public: 133 PROPID id; 134 ULONG length; 135 WORD type; 136 VOID* value; 137 }; 138 139 #else /* end of c++ typedefs */ 140 141 typedef enum ImageLockMode ImageLockMode; 142 typedef enum RotateFlipType RotateFlipType; 143 144 typedef struct EncoderParameter 145 { 146 GUID Guid; 147 ULONG NumberOfValues; 148 ULONG Type; 149 VOID* Value; 150 } EncoderParameter; 151 152 typedef struct EncoderParameters 153 { 154 UINT Count; 155 EncoderParameter Parameter[1]; 156 } EncoderParameters; 157 158 typedef struct ImageCodecInfo 159 { 160 CLSID Clsid; 161 GUID FormatID; 162 const WCHAR* CodecName; 163 const WCHAR* DllName; 164 const WCHAR* FormatDescription; 165 const WCHAR* FilenameExtension; 166 const WCHAR* MimeType; 167 DWORD Flags; 168 DWORD Version; 169 DWORD SigCount; 170 DWORD SigSize; 171 const BYTE* SigPattern; 172 const BYTE* SigMask; 173 } ImageCodecInfo; 174 175 typedef struct BitmapData 176 { 177 UINT Width; 178 UINT Height; 179 INT Stride; 180 PixelFormat PixelFormat; 181 VOID* Scan0; 182 UINT_PTR Reserved; /* undocumented: stores the lock mode */ 183 } BitmapData; 184 185 typedef struct ImageItemData 186 { 187 UINT Size; 188 UINT Position; 189 VOID* Desc; 190 UINT DescSize; 191 VOID* Data; 192 UINT DataSize; 193 UINT Cookie; 194 } ImageItemData; 195 196 typedef struct PropertyItem 197 { 198 PROPID id; 199 ULONG length; 200 WORD type; 201 VOID* value; 202 } PropertyItem; 203 204 #endif /* end of c typedefs */ 205 206 /* property types */ 207 #define PropertyTagTypeByte 1 208 #define PropertyTagTypeASCII 2 209 #define PropertyTagTypeShort 3 210 #define PropertyTagTypeLong 4 211 #define PropertyTagTypeRational 5 212 #define PropertyTagTypeUndefined 7 213 #define PropertyTagTypeSLONG 9 214 #define PropertyTagTypeSRational 10 215 216 /* property IDs */ 217 #define PropertyTagExifIFD 0x8769 218 #define PropertyTagGpsIFD 0x8825 219 220 #define PropertyTagNewSubfileType 0x00FE 221 #define PropertyTagSubfileType 0x00FF 222 #define PropertyTagImageWidth 0x0100 223 #define PropertyTagImageHeight 0x0101 224 #define PropertyTagBitsPerSample 0x0102 225 #define PropertyTagCompression 0x0103 226 #define PropertyTagPhotometricInterp 0x0106 227 #define PropertyTagThreshHolding 0x0107 228 #define PropertyTagCellWidth 0x0108 229 #define PropertyTagCellHeight 0x0109 230 #define PropertyTagFillOrder 0x010A 231 #define PropertyTagDocumentName 0x010D 232 #define PropertyTagImageDescription 0x010E 233 #define PropertyTagEquipMake 0x010F 234 #define PropertyTagEquipModel 0x0110 235 #define PropertyTagStripOffsets 0x0111 236 #define PropertyTagOrientation 0x0112 237 #define PropertyTagSamplesPerPixel 0x0115 238 #define PropertyTagRowsPerStrip 0x0116 239 #define PropertyTagStripBytesCount 0x0117 240 #define PropertyTagMinSampleValue 0x0118 241 #define PropertyTagMaxSampleValue 0x0119 242 #define PropertyTagXResolution 0x011A 243 #define PropertyTagYResolution 0x011B 244 #define PropertyTagPlanarConfig 0x011C 245 #define PropertyTagPageName 0x011D 246 #define PropertyTagXPosition 0x011E 247 #define PropertyTagYPosition 0x011F 248 #define PropertyTagFreeOffset 0x0120 249 #define PropertyTagFreeByteCounts 0x0121 250 #define PropertyTagGrayResponseUnit 0x0122 251 #define PropertyTagGrayResponseCurve 0x0123 252 #define PropertyTagT4Option 0x0124 253 #define PropertyTagT6Option 0x0125 254 #define PropertyTagResolutionUnit 0x0128 255 #define PropertyTagPageNumber 0x0129 256 #define PropertyTagTransferFuncition 0x012D 257 #define PropertyTagSoftwareUsed 0x0131 258 #define PropertyTagDateTime 0x0132 259 #define PropertyTagArtist 0x013B 260 #define PropertyTagHostComputer 0x013C 261 #define PropertyTagPredictor 0x013D 262 #define PropertyTagWhitePoint 0x013E 263 #define PropertyTagPrimaryChromaticities 0x013F 264 #define PropertyTagColorMap 0x0140 265 #define PropertyTagHalftoneHints 0x0141 266 #define PropertyTagTileWidth 0x0142 267 #define PropertyTagTileLength 0x0143 268 #define PropertyTagTileOffset 0x0144 269 #define PropertyTagTileByteCounts 0x0145 270 #define PropertyTagInkSet 0x014C 271 #define PropertyTagInkNames 0x014D 272 #define PropertyTagNumberOfInks 0x014E 273 #define PropertyTagDotRange 0x0150 274 #define PropertyTagTargetPrinter 0x0151 275 #define PropertyTagExtraSamples 0x0152 276 #define PropertyTagSampleFormat 0x0153 277 #define PropertyTagSMinSampleValue 0x0154 278 #define PropertyTagSMaxSampleValue 0x0155 279 #define PropertyTagTransferRange 0x0156 280 281 #define PropertyTagJPEGProc 0x0200 282 #define PropertyTagJPEGInterFormat 0x0201 283 #define PropertyTagJPEGInterLength 0x0202 284 #define PropertyTagJPEGRestartInterval 0x0203 285 #define PropertyTagJPEGLosslessPredictors 0x0205 286 #define PropertyTagJPEGPointTransforms 0x0206 287 #define PropertyTagJPEGQTables 0x0207 288 #define PropertyTagJPEGDCTables 0x0208 289 #define PropertyTagJPEGACTables 0x0209 290 291 #define PropertyTagYCbCrCoefficients 0x0211 292 #define PropertyTagYCbCrSubsampling 0x0212 293 #define PropertyTagYCbCrPositioning 0x0213 294 #define PropertyTagREFBlackWhite 0x0214 295 296 #define PropertyTagICCProfile 0x8773 297 298 #define PropertyTagGamma 0x0301 299 #define PropertyTagICCProfileDescriptor 0x0302 300 #define PropertyTagSRGBRenderingIntent 0x0303 301 302 #define PropertyTagImageTitle 0x0320 303 #define PropertyTagCopyright 0x8298 304 305 #define PropertyTagResolutionXUnit 0x5001 306 #define PropertyTagResolutionYUnit 0x5002 307 #define PropertyTagResolutionXLengthUnit 0x5003 308 #define PropertyTagResolutionYLengthUnit 0x5004 309 #define PropertyTagPrintFlags 0x5005 310 #define PropertyTagPrintFlagsVersion 0x5006 311 #define PropertyTagPrintFlagsCrop 0x5007 312 #define PropertyTagPrintFlagsBleedWidth 0x5008 313 #define PropertyTagPrintFlagsBleedWidthScale 0x5009 314 #define PropertyTagHalftoneLPI 0x500A 315 #define PropertyTagHalftoneLPIUnit 0x500B 316 #define PropertyTagHalftoneDegree 0x500C 317 #define PropertyTagHalftoneShape 0x500D 318 #define PropertyTagHalftoneMisc 0x500E 319 #define PropertyTagHalftoneScreen 0x500F 320 #define PropertyTagJPEGQuality 0x5010 321 #define PropertyTagGridSize 0x5011 322 #define PropertyTagThumbnailFormat 0x5012 323 #define PropertyTagThumbnailWidth 0x5013 324 #define PropertyTagThumbnailHeight 0x5014 325 #define PropertyTagThumbnailColorDepth 0x5015 326 #define PropertyTagThumbnailPlanes 0x5016 327 #define PropertyTagThumbnailRawBytes 0x5017 328 #define PropertyTagThumbnailSize 0x5018 329 #define PropertyTagThumbnailCompressedSize 0x5019 330 #define PropertyTagColorTransferFunction 0x501A 331 #define PropertyTagThumbnailData 0x501B 332 333 #define PropertyTagThumbnailImageWidth 0x5020 334 #define PropertyTagThumbnailImageHeight 0x5021 335 #define PropertyTagThumbnailBitsPerSample 0x5022 336 #define PropertyTagThumbnailCompression 0x5023 337 #define PropertyTagThumbnailPhotometricInterp 0x5024 338 #define PropertyTagThumbnailImageDescription 0x5025 339 #define PropertyTagThumbnailEquipMake 0x5026 340 #define PropertyTagThumbnailEquipModel 0x5027 341 #define PropertyTagThumbnailStripOffsets 0x5028 342 #define PropertyTagThumbnailOrientation 0x5029 343 #define PropertyTagThumbnailSamplesPerPixel 0x502A 344 #define PropertyTagThumbnailRowsPerStrip 0x502B 345 #define PropertyTagThumbnailStripBytesCount 0x502C 346 #define PropertyTagThumbnailResolutionX 0x502D 347 #define PropertyTagThumbnailResolutionY 0x502E 348 #define PropertyTagThumbnailPlanarConfig 0x502F 349 #define PropertyTagThumbnailResolutionUnit 0x5030 350 #define PropertyTagThumbnailTransferFunction 0x5031 351 #define PropertyTagThumbnailSoftwareUsed 0x5032 352 #define PropertyTagThumbnailDateTime 0x5033 353 #define PropertyTagThumbnailArtist 0x5034 354 #define PropertyTagThumbnailWhitePoint 0x5035 355 #define PropertyTagThumbnailPrimaryChromaticities 0x5036 356 #define PropertyTagThumbnailYCbCrCoefficients 0x5037 357 #define PropertyTagThumbnailYCbCrSubsampling 0x5038 358 #define PropertyTagThumbnailYCbCrPositioning 0x5039 359 #define PropertyTagThumbnailRefBlackWhite 0x503A 360 #define PropertyTagThumbnailCopyRight 0x503B 361 362 #define PropertyTagLuminanceTable 0x5090 363 #define PropertyTagChrominanceTable 0x5091 364 365 #define PropertyTagFrameDelay 0x5100 366 #define PropertyTagLoopCount 0x5101 367 #define PropertyTagGlobalPalette 0x5102 368 #define PropertyTagIndexBackground 0x5103 369 #define PropertyTagIndexTransparent 0x5104 370 371 #define PropertyTagPixelUnit 0x5110 372 #define PropertyTagPixelPerUnitX 0x5111 373 #define PropertyTagPixelPerUnitY 0x5112 374 #define PropertyTagPaletteHistogram 0x5113 375 376 #define PropertyTagExifExposureTime 0x829A 377 #define PropertyTagExifFNumber 0x829D 378 379 #define PropertyTagExifExposureProg 0x8822 380 #define PropertyTagExifSpectralSense 0x8824 381 #define PropertyTagExifISOSpeed 0x8827 382 #define PropertyTagExifOECF 0x8828 383 384 #define PropertyTagExifVer 0x9000 385 #define PropertyTagExifDTOrig 0x9003 386 #define PropertyTagExifDTDigitized 0x9004 387 388 #define PropertyTagExifCompConfig 0x9101 389 #define PropertyTagExifCompBPP 0x9102 390 391 #define PropertyTagExifShutterSpeed 0x9201 392 #define PropertyTagExifAperture 0x9202 393 #define PropertyTagExifBrightness 0x9203 394 #define PropertyTagExifExposureBias 0x9204 395 #define PropertyTagExifMaxAperture 0x9205 396 #define PropertyTagExifSubjectDist 0x9206 397 #define PropertyTagExifMeteringMode 0x9207 398 #define PropertyTagExifLightSource 0x9208 399 #define PropertyTagExifFlash 0x9209 400 #define PropertyTagExifFocalLength 0x920A 401 #define PropertyTagExifMakerNote 0x927C 402 #define PropertyTagExifUserComment 0x9286 403 #define PropertyTagExifDTSubsec 0x9290 404 #define PropertyTagExifDTOrigSS 0x9291 405 #define PropertyTagExifDTDigSS 0x9292 406 407 #define PropertyTagExifFPXVer 0xA000 408 #define PropertyTagExifColorSpace 0xA001 409 #define PropertyTagExifPixXDim 0xA002 410 #define PropertyTagExifPixYDim 0xA003 411 #define PropertyTagExifRelatedWav 0xA004 412 #define PropertyTagExifInterop 0xA005 413 #define PropertyTagExifFlashEnergy 0xA20B 414 #define PropertyTagExifSpatialFR 0xA20C 415 #define PropertyTagExifFocalXRes 0xA20E 416 #define PropertyTagExifFocalYRes 0xA20F 417 #define PropertyTagExifFocalResUnit 0xA210 418 #define PropertyTagExifSubjectLoc 0xA214 419 #define PropertyTagExifExposureIndex 0xA215 420 #define PropertyTagExifSensingMethod 0xA217 421 #define PropertyTagExifFileSource 0xA300 422 #define PropertyTagExifSceneType 0xA301 423 #define PropertyTagExifCfaPattern 0xA302 424 425 #define PropertyTagGpsVer 0x0000 426 #define PropertyTagGpsLatitudeRef 0x0001 427 #define PropertyTagGpsLatitude 0x0002 428 #define PropertyTagGpsLongitudeRef 0x0003 429 #define PropertyTagGpsLongitude 0x0004 430 #define PropertyTagGpsAltitudeRef 0x0005 431 #define PropertyTagGpsAltitude 0x0006 432 #define PropertyTagGpsGpsTime 0x0007 433 #define PropertyTagGpsGpsSatellites 0x0008 434 #define PropertyTagGpsGpsStatus 0x0009 435 #define PropertyTagGpsGpsMeasureMode 0x000A 436 #define PropertyTagGpsGpsDop 0x000B 437 #define PropertyTagGpsSpeedRef 0x000C 438 #define PropertyTagGpsSpeed 0x000D 439 #define PropertyTagGpsTrackRef 0x000E 440 #define PropertyTagGpsTrack 0x000F 441 #define PropertyTagGpsImgDirRef 0x0010 442 #define PropertyTagGpsImgDir 0x0011 443 #define PropertyTagGpsMapDatum 0x0012 444 #define PropertyTagGpsDestLatRef 0x0013 445 #define PropertyTagGpsDestLat 0x0014 446 #define PropertyTagGpsDestLongRef 0x0015 447 #define PropertyTagGpsDestLong 0x0016 448 #define PropertyTagGpsDestBearRef 0x0017 449 #define PropertyTagGpsDestBear 0x0018 450 #define PropertyTagGpsDestDistRef 0x0019 451 #define PropertyTagGpsDestDist 0x001A 452 453 #endif /* _GDIPLUSIMAGING_H */ 454