source: trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/misc.ab@ 506

Last change on this file since 506 was 497, checked in by イグトランス (egtra), 16 years ago

インクルードガードとその他不要な前処理定義などの削除

File size: 17.3 KB
Line 
1' Classes/System/Drawing/Imaging/misc.ab
2
3#require <Classes/System/Drawing/Color.ab>
4
5TypeDef ARGB = DWord
6TypeDef ARGB64 = QWord
7
8Enum ColorMode
9 ARGB32 = 0
10 ARGB64 = 1
11End Enum
12
13Const ALPHA_SHIFT = 24 As DWord
14Const RED_SHIFT = 16 As DWord
15Const GREEN_SHIFT = 8 As DWord
16Const BLUE_SHIFT = 0 As DWord
17Const ALPHA_MASK = ((&hff As ARGB) << ALPHA_SHIFT)
18
19' In-memory pixel data formats:
20' bits 0-7 = format index
21' bits 8-15 = pixel size (in bits)
22' bits 16-23 = flags
23' bits 24-31 = reserved
24
25Enum PixelFormat
26 Indexed = &h00010000
27 Gdi = &h00020000
28 Alpha = &h00040000
29 PAlpha = &h00080000
30 Extended = &h00100000
31 Canonical = &h00200000
32
33 Undefined = 0
34 DontCare = 0
35
36 Format1bppIndexed = (1 Or ( 1 << 8) Or PixelFormat.Indexed Or PixelFormat.Gdi)
37 Format4bppIndexed = (2 Or ( 4 << 8) Or PixelFormat.Indexed Or PixelFormat.Gdi)
38 Format8bppIndexed = (3 Or ( 8 << 8) Or PixelFormat.Indexed Or PixelFormat.Gdi)
39 Format16bppGrayScale = (4 Or (16 << 8) Or PixelFormat.Extended)
40 Format16bppRGB555 = (5 Or (16 << 8) Or PixelFormat.Gdi)
41 Format16bppRGB565 = (6 Or (16 << 8) Or PixelFormat.Gdi)
42 Format16bppARGB1555 = (7 Or (16 << 8) Or PixelFormat.Alpha Or PixelFormat.Gdi)
43 Format24bppRGB = (8 Or (24 << 8) Or PixelFormat.Gdi)
44 Format32bppRGB = (9 Or (32 << 8) Or PixelFormat.Gdi)
45 Format32bppARGB = (10 Or (32 << 8) Or PixelFormat.Alpha Or PixelFormat.Gdi Or PixelFormat.Canonical)
46 Format32bppPARGB = (11 Or (32 << 8) Or PixelFormat.Alpha Or PixelFormat.PAlpha Or PixelFormat.Gdi)
47 Format48bppRGB = (12 Or (48 << 8) Or PixelFormat.Extended)
48 Format64bppARGB = (13 Or (64 << 8) Or PixelFormat.Alpha Or PixelFormat.Canonical Or PixelFormat.Extended)
49 Format64bppPARGB = (14 Or (64 << 8) Or PixelFormat.Alpha Or PixelFormat.PAlpha Or PixelFormat.Extended)
50 Max = 15
51End Enum
52
53Const GetPixelFormatSize(pixfmt) = ((((pixfmt As PixelFormat) >> 8) And &hff) As DWord)
54
55Const IsIndexedPixelFormat(pixfmt) = ((((pixfmt As PixelFormat) And PixelFormat.Indexed) <> 0) As BOOL)
56
57Const IsAlphaPixelFormat(pixfmt) = ((((pixfmt As PixelFormat) And PixelFormat.Alpha) <> 0) As BOOL)
58
59Const IsExtendedPixelFormat(pixfmt) = ((((pixfmt As PixelFormat) And PixelFormat.Extended) <> 0) As BOOL)
60
61Const IsCanonicalPixelFormat(pixfmt) = ((((pixfmt As PixelFormat) And PixelFormat.Canonical) <> 0) As BOOL)
62
63Enum PaletteFlags
64 PaletteFlagsHasAlpha = &h0001
65 PaletteFlagsGrayScale = &h0002
66 PaletteFlagsHalftone = &h0004
67End Enum
68
69Type Align(8) ColorPalette
70 Flags As DWord
71 Count As DWord
72 Entries[1] As ARGB
73End Type
74
75Enum ColorAdjustType
76 Default
77 Bitmap
78 Brush
79 Pen
80 Text
81 Count
82 Any
83End Enum
84
85Type ColorMatrix
86 m[5][5] As Single
87End Type
88
89Type ColorMap
90 OldColor As Color
91 NewColor As Color
92End Type
93
94Enum ColorMatrixFlag
95 Default = 0
96 SkipGrays = 1
97 AltGray = 2
98End Enum
99
100Enum ImageCodecFlags
101 Encoder = &h00000001
102 Decoder = &h00000002
103 SupportBitmap = &h00000004
104 SupportVector = &h00000008
105 SeekableEncode = &h00000010
106 BlockingDecode = &h00000020
107
108 Builtin = &h00010000
109 System = &h00020000
110 User = &h00040000
111End Enum
112
113Enum ImageLockMode
114 Read = &h0001
115 Write = &h0002
116 UserInputBuf= &h0004
117End Enum
118
119Type Align(8) BitmapData
120 Width As DWord
121 Height As DWord
122 Stride As Long
123 PixelFormat As PixelFormat
124 Scan0 As VoidPtr
125 Reserved As ULONG_PTR
126End Type
127
128Type Align(8) EncoderParameter
129 Guid As GUID
130 NumberOfValues As DWord
131 EncoderType As DWord '元はTypeという名前
132 Value As VoidPtr
133End Type
134
135Type Align(8) EncoderParameters
136 Count As DWord
137 Parameter[1] As EncoderParameter
138End Type
139
140Type Align(8) PropertyItem
141 id As PROPID
142 length As DWord
143 piType As Word
144 value As VoidPtr
145End Type
146
147Const PropertyTagTypeByte = 1
148Const PropertyTagTypeASCII = 2
149Const PropertyTagTypeShort = 3
150Const PropertyTagTypeLong = 4
151Const PropertyTagTypeRational = 5
152Const PropertyTagTypeUndefined = 7
153Const PropertyTagTypeSLONG = 9
154Const PropertyTagTypeSRational = 10
155
156Const PropertyTagExifIFD = &h8769
157Const PropertyTagGpsIFD = &h8825
158
159Const PropertyTagNewSubfileType = &h00FE
160Const PropertyTagSubfileType = &h00FF
161Const PropertyTagImageWidth = &h0100
162Const PropertyTagImageHeight = &h0101
163Const PropertyTagBitsPerSample = &h0102
164Const PropertyTagCompression = &h0103
165Const PropertyTagPhotometricInterp = &h0106
166Const PropertyTagThreshHolding = &h0107
167Const PropertyTagCellWidth = &h0108
168Const PropertyTagCellHeight = &h0109
169Const PropertyTagFillOrder = &h010A
170Const PropertyTagDocumentName = &h010D
171Const PropertyTagImageDescription = &h010E
172Const PropertyTagEquipMake = &h010F
173Const PropertyTagEquipModel = &h0110
174Const PropertyTagStripOffsets = &h0111
175Const PropertyTagOrientation = &h0112
176Const PropertyTagSamplesPerPixel = &h0115
177Const PropertyTagRowsPerStrip = &h0116
178Const PropertyTagStripBytesCount = &h0117
179Const PropertyTagMinSampleValue = &h0118
180Const PropertyTagMaxSampleValue = &h0119
181Const PropertyTagXResolution = &h011A ' Image resolution in width direction
182Const PropertyTagYResolution = &h011B ' Image resolution in height direction
183Const PropertyTagPlanarConfig = &h011C ' Image data arrangement
184Const PropertyTagPageName = &h011D
185Const PropertyTagXPosition = &h011E
186Const PropertyTagYPosition = &h011F
187Const PropertyTagFreeOffset = &h0120
188Const PropertyTagFreeByteCounts = &h0121
189Const PropertyTagGrayResponseUnit = &h0122
190Const PropertyTagGrayResponseCurve = &h0123
191Const PropertyTagT4Option = &h0124
192Const PropertyTagT6Option = &h0125
193Const PropertyTagResolutionUnit = &h0128 ' Unit of X and Y resolution
194Const PropertyTagPageNumber = &h0129
195Const PropertyTagTransferFuncition = &h012D
196Const PropertyTagSoftwareUsed = &h0131
197Const PropertyTagDateTime = &h0132
198Const PropertyTagArtist = &h013B
199Const PropertyTagHostComputer = &h013C
200Const PropertyTagPredictor = &h013D
201Const PropertyTagWhitePoint = &h013E
202Const PropertyTagPrimaryChromaticities = &h013F
203Const PropertyTagColorMap = &h0140
204Const PropertyTagHalftoneHints = &h0141
205Const PropertyTagTileWidth = &h0142
206Const PropertyTagTileLength = &h0143
207Const PropertyTagTileOffset = &h0144
208Const PropertyTagTileByteCounts = &h0145
209Const PropertyTagInkSet = &h014C
210Const PropertyTagInkNames = &h014D
211Const PropertyTagNumberOfInks = &h014E
212Const PropertyTagDotRange = &h0150
213Const PropertyTagTargetPrinter = &h0151
214Const PropertyTagExtraSamples = &h0152
215Const PropertyTagSampleFormat = &h0153
216Const PropertyTagSMinSampleValue = &h0154
217Const PropertyTagSMaxSampleValue = &h0155
218Const PropertyTagTransferRange = &h0156
219
220Const PropertyTagJPEGProc = &h0200
221Const PropertyTagJPEGInterFormat = &h0201
222Const PropertyTagJPEGInterLength = &h0202
223Const PropertyTagJPEGRestartInterval = &h0203
224Const PropertyTagJPEGLosslessPredictors = &h0205
225Const PropertyTagJPEGPointTransforms = &h0206
226Const PropertyTagJPEGQTables = &h0207
227Const PropertyTagJPEGDCTables = &h0208
228Const PropertyTagJPEGACTables = &h0209
229
230Const PropertyTagYCbCrCoefficients = &h0211
231Const PropertyTagYCbCrSubsampling = &h0212
232Const PropertyTagYCbCrPositioning = &h0213
233Const PropertyTagREFBlackWhite = &h0214
234
235Const PropertyTagICCProfile = &h8773 ' This TAG is defined by ICC
236 ' for embedded ICC in TIFF
237Const PropertyTagGamma = &h0301
238Const PropertyTagICCProfileDescriptor = &h0302
239Const PropertyTagSRGBRenderingIntent = &h0303
240
241Const PropertyTagImageTitle = &h0320
242Const PropertyTagCopyright = &h8298
243
244' Extra TAGs (Like Adobe Image Information tags etc.)
245
246Const PropertyTagResolutionXUnit = &h5001
247Const PropertyTagResolutionYUnit = &h5002
248Const PropertyTagResolutionXLengthUnit = &h5003
249Const PropertyTagResolutionYLengthUnit = &h5004
250Const PropertyTagPrintFlags = &h5005
251Const PropertyTagPrintFlagsVersion = &h5006
252Const PropertyTagPrintFlagsCrop = &h5007
253Const PropertyTagPrintFlagsBleedWidth = &h5008
254Const PropertyTagPrintFlagsBleedWidthScale = &h5009
255Const PropertyTagHalftoneLPI = &h500A
256Const PropertyTagHalftoneLPIUnit = &h500B
257Const PropertyTagHalftoneDegree = &h500C
258Const PropertyTagHalftoneShape = &h500D
259Const PropertyTagHalftoneMisc = &h500E
260Const PropertyTagHalftoneScreen = &h500F
261Const PropertyTagJPEGQuality = &h5010
262Const PropertyTagGridSize = &h5011
263Const PropertyTagThumbnailFormat = &h5012 ' 1 = JPEG, 0 = RAW RGB
264Const PropertyTagThumbnailWidth = &h5013
265Const PropertyTagThumbnailHeight = &h5014
266Const PropertyTagThumbnailColorDepth = &h5015
267Const PropertyTagThumbnailPlanes = &h5016
268Const PropertyTagThumbnailRawBytes = &h5017
269Const PropertyTagThumbnailSize = &h5018
270Const PropertyTagThumbnailCompressedSize = &h5019
271Const PropertyTagColorTransferFunction = &h501A
272Const PropertyTagThumbnailData = &h501B' RAW thumbnail bits in
273 ' JPEG format or RGB format
274 ' depends on
275 ' PropertyTagThumbnailFormat
276
277' Thumbnail related TAGs
278
279Const PropertyTagThumbnailImageWidth = &h5020 ' Thumbnail width
280Const PropertyTagThumbnailImageHeight = &h5021 ' Thumbnail height
281Const PropertyTagThumbnailBitsPerSample = &h5022 ' Number of bits per
282 ' component
283Const PropertyTagThumbnailCompression = &h5023 ' Compression Scheme
284Const PropertyTagThumbnailPhotometricInterp = &h5024 ' Pixel composition
285Const PropertyTagThumbnailImageDescription = &h5025 ' Image Tile
286Const PropertyTagThumbnailEquipMake = &h5026 ' Manufacturer of Image
287 ' Input equipment
288Const PropertyTagThumbnailEquipModel = &h5027 ' Model of Image input
289 ' equipment
290Const PropertyTagThumbnailStripOffsets = &h5028 ' Image data location
291Const PropertyTagThumbnailOrientation = &h5029 ' Orientation of image
292Const PropertyTagThumbnailSamplesPerPixel = &h502A ' Number of components
293Const PropertyTagThumbnailRowsPerStrip = &h502B ' Number of rows per strip
294Const PropertyTagThumbnailStripBytesCount = &h502C ' Bytes per compressed
295 ' strip
296Const PropertyTagThumbnailResolutionX = &h502D ' Resolution in width
297 ' direction
298Const PropertyTagThumbnailResolutionY = &h502E ' Resolution in height
299 ' direction
300Const PropertyTagThumbnailPlanarConfig = &h502F ' Image data arrangement
301Const PropertyTagThumbnailResolutionUnit = &h5030 ' Unit of X and Y
302 ' Resolution
303Const PropertyTagThumbnailTransferFunction = &h5031 ' Transfer function
304Const PropertyTagThumbnailSoftwareUsed = &h5032 ' Software used
305Const PropertyTagThumbnailDateTime = &h5033 ' File change date and
306 ' time
307Const PropertyTagThumbnailArtist = &h5034 ' Person who created the
308 ' image
309Const PropertyTagThumbnailWhitePoint = &h5035 ' White point chromaticity
310Const PropertyTagThumbnailPrimaryChromaticities = &h5036
311 ' Chromaticities of
312 ' primaries
313Const PropertyTagThumbnailYCbCrCoefficients = &h5037 ' Color space transforma-
314 ' tion coefficients
315Const PropertyTagThumbnailYCbCrSubsampling = &h5038 ' Subsampling ratio of Y
316 ' to C
317Const PropertyTagThumbnailYCbCrPositioning = &h5039 ' Y and C position
318Const PropertyTagThumbnailRefBlackWhite = &h503A ' Pair of black and white
319 ' reference values
320Const PropertyTagThumbnailCopyRight = &h503B ' CopyRight holder
321
322Const PropertyTagLuminanceTable = &h5090
323Const PropertyTagChrominanceTable = &h5091
324
325Const PropertyTagFrameDelay = &h5100
326Const PropertyTagLoopCount = &h5101
327
328Const PropertyTagPixelUnit = &h5110 ' Unit specifier for pixel/unit
329Const PropertyTagPixelPerUnitX = &h5111 ' Pixels per unit in X
330Const PropertyTagPixelPerUnitY = &h5112 ' Pixels per unit in Y
331Const PropertyTagPaletteHistogram = &h5113 ' Palette histogram
332
333' EXIF specific tag
334
335Const PropertyTagExifExposureTime = &h829A
336Const PropertyTagExifFNumber = &h829D
337
338Const PropertyTagExifExposureProg = &h8822
339Const PropertyTagExifSpectralSense = &h8824
340Const PropertyTagExifISOSpeed = &h8827
341Const PropertyTagExifOECF = &h8828
342
343Const PropertyTagExifVer = &h9000
344Const PropertyTagExifDTOrig = &h9003 ' Date & time of original
345Const PropertyTagExifDTDigitized = &h9004 ' Date & time of digital data generation
346
347Const PropertyTagExifCompConfig = &h9101
348Const PropertyTagExifCompBPP = &h9102
349
350Const PropertyTagExifShutterSpeed = &h9201
351Const PropertyTagExifAperture = &h9202
352Const PropertyTagExifBrightness = &h9203
353Const PropertyTagExifExposureBias = &h9204
354Const PropertyTagExifMaxAperture = &h9205
355Const PropertyTagExifSubjectDist = &h9206
356Const PropertyTagExifMeteringMode = &h9207
357Const PropertyTagExifLightSource = &h9208
358Const PropertyTagExifFlash = &h9209
359Const PropertyTagExifFocalLength = &h920A
360Const PropertyTagExifMakerNote = &h927C
361Const PropertyTagExifUserComment = &h9286
362Const PropertyTagExifDTSubsec = &h9290 ' Date & Time subseconds
363Const PropertyTagExifDTOrigSS = &h9291 ' Date & Time original subseconds
364Const PropertyTagExifDTDigSS = &h9292 ' Date & TIme digitized subseconds
365
366Const PropertyTagExifFPXVer = &hA000
367Const PropertyTagExifColorSpace = &hA001
368Const PropertyTagExifPixXDim = &hA002
369Const PropertyTagExifPixYDim = &hA003
370Const PropertyTagExifRelatedWav = &hA004 ' related sound file
371Const PropertyTagExifInterop = &hA005
372Const PropertyTagExifFlashEnergy = &hA20B
373Const PropertyTagExifSpatialFR = &hA20C ' Spatial Frequency Response
374Const PropertyTagExifFocalXRes = &hA20E ' Focal Plane X Resolution
375Const PropertyTagExifFocalYRes = &hA20F ' Focal Plane Y Resolution
376Const PropertyTagExifFocalResUnit = &hA210 ' Focal Plane Resolution Unit
377Const PropertyTagExifSubjectLoc = &hA214
378Const PropertyTagExifExposureIndex = &hA215
379Const PropertyTagExifSensingMethod = &hA217
380Const PropertyTagExifFileSource = &hA300
381Const PropertyTagExifSceneType = &hA301
382Const PropertyTagExifCfaPattern = &hA302
383
384Const PropertyTagGpsVer = &h0000
385Const PropertyTagGpsLatitudeRef = &h0001
386Const PropertyTagGpsLatitude = &h0002
387Const PropertyTagGpsLongitudeRef = &h0003
388Const PropertyTagGpsLongitude = &h0004
389Const PropertyTagGpsAltitudeRef = &h0005
390Const PropertyTagGpsAltitude = &h0006
391Const PropertyTagGpsGpsTime = &h0007
392Const PropertyTagGpsGpsSatellites = &h0008
393Const PropertyTagGpsGpsStatus = &h0009
394Const PropertyTagGpsGpsMeasureMode = &h00A
395Const PropertyTagGpsGpsDop = &h000B ' Measurement precision
396Const PropertyTagGpsSpeedRef = &h000C
397Const PropertyTagGpsSpeed = &h000D
398Const PropertyTagGpsTrackRef = &h000E
399Const PropertyTagGpsTrack = &h000F
400Const PropertyTagGpsImgDirRef = &h0010
401Const PropertyTagGpsImgDir = &h0011
402Const PropertyTagGpsMapDatum = &h0012
403Const PropertyTagGpsDestLatRef = &h0013
404Const PropertyTagGpsDestLat = &h0014
405Const PropertyTagGpsDestLongRef = &h0015
406Const PropertyTagGpsDestLong = &h0016
407Const PropertyTagGpsDestBearRef = &h0017
408Const PropertyTagGpsDestBear = &h0018
409Const PropertyTagGpsDestDistRef = &h0019
410Const PropertyTagGpsDestDist = &h001A
411
412Type ImageCodecInfo
413 Clsid As CLSID
414 FormatID As GUID
415 CodecName As PCWSTR
416 DllName As PCWSTR
417 FormatDescription As PCWSTR
418 FilenameExtension As PCWSTR
419 MimeType As PCWSTR
420 Flags As DWord
421 Version As DWord
422 SigCount As DWord
423 SigSize As DWord
424 SigPattern As *Byte
425 SigMask As DWord
426End Type
427
428Enum ColorChannelFlag
429 ColorChannelC = 0
430 ColorChannelM
431 ColorChannelY
432 ColorChannelK
433 ColorChannelLast
434End Enum
Note: See TracBrowser for help on using the repository browser.