{*************************************************************************
                Copyright (c) PilotLogic Software House

  Package pl_ORCA
  This file is part of CodeTyphon Studio (https://www.pilotlogic.com/)

 ***** BEGIN LICENSE BLOCK *****
 * Version: LGPL-2.1 with link exception (Modified LGPL)
 *
 * The contents of this file are subject to the 
 * GNU LIBRARY GENERAL PUBLIC LICENSE Version 2.1 (the "License")
 * with the following modification:
 * 
 * As a special exception, the copyright holders of this library give you
 * permission to link this library with independent modules to produce an
 * executable, regardless of the license terms of these independent modules,
 * and to copy and distribute the resulting executable under terms of your choice,
 * provided that you also meet, for each linked independent module, the terms
 * and conditions of the license of that module. An independent module is a
 * module which is not derived from or based on this library. If you modify this
 * library, you may extend this exception to your version of the library, but
 * you are not obligated to do so. If you do not wish to do so, delete this
 * exception statement from your version.
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * ***** END LICENSE BLOCK *****
 
***************************************************************************}

Unit Wincodec;

Interface

{$ALIGN ON}
{$MINENUMSIZE 4}

Uses Windows, ActiveX;

Type
   { IPropertyBag2 interface }

   tagPROPBAG2 = Record
      dwType: DWORD;
      vt: TVarType;
      cfType: TClipFormat;
      dwHint: DWORD;
      pstrName: POleStr;
      clsid: TCLSID;
   End;
   TPropBag2 = tagPROPBAG2;
   PPropBag2 = ^TPropBag2;

   IPropertyBag2 = Interface(IUnknown)
      ['{22F55882-280B-11d0-A8A9-00A0C90C2004}']
      Function Read(pPropBag: PPropBag2; pErrLog: IErrorLog; pvarValue: PVariant; phrError: PHResult): HRESULT; Stdcall;
      Function Write(cProperties: ULONG; pPropBag: PPropBag2; pvarValue: PVariant): HRESULT; Stdcall;
      Function CountProperties(Var pcProperties: ULONG): HRESULT; Stdcall;
      Function GetPropertyInfo(iProperty, cProperties: ULONG; pPropBag: PPropBag2; Var pcProperties: ULONG): HRESULT; Stdcall;
      Function LoadObject(pstrName: POleStr; dwHint: DWORD; pUnkObject: IUnknown; pErrLog: IErrorLog): HRESULT; Stdcall;
   End;

Const
   SID_IWICPalette = '{00000040-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICBitmapSource = '{00000120-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICFormatConverter = '{00000301-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICBitmapScaler = '{00000302-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICBitmapClipper = '{E4FBCF03-223D-4e81-9333-D635556DD1B5}';
   SID_IWICBitmapFlipRotator = '{5009834F-2D6A-41ce-9E1B-17C5AFF7A782}';
   SID_IWICBitmapLock = '{00000123-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICBitmap = '{00000121-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICColorTransform = '{B66F034F-D0E2-40ab-B436-6DE39E321A94}';
   SID_IWICColorContext = '{3C613A02-34B2-44ea-9A7C-45AEA9C6FD6D}';
   SID_IWICFastMetadataEncoder = '{B84E2C09-78C9-4AC4-8BD3-524AE1663A2F}';
   SID_IWICStream = '{135FF860-22B7-4ddf-B0F6-218F4F299A43}';
   SID_IWICEnumMetadataItem = '{DC2BB46D-3F07-481E-8625-220C4AEDBB33}';
   SID_IWICMetadataQueryReader = '{30989668-E1C9-4597-B395-458EEDB808DF}';
   SID_IWICMetadataQueryWriter = '{A721791A-0DEF-4d06-BD91-2118BF1DB10B}';
   SID_IWICBitmapEncoder = '{00000103-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICBitmapFrameEncode = '{00000105-a8f2-4877-ba0a-fd2b6645fb94}';
   SID_IWICBitmapDecoder = '{9EDDE9E7-8DEE-47ea-99DF-E6FAF2ED44BF}';
   SID_IWICBitmapSourceTransform = '{3B16811B-6A43-4ec9-B713-3D5A0C13B940}';
   SID_IWICBitmapFrameDecode = '{3B16811B-6A43-4ec9-A813-3D930C13B940}';
   SID_IWICProgressiveLevelControl = '{DAAC296F-7AA5-4dbf-8D15-225C5976F891}';
   SID_IWICProgressCallback = '{4776F9CD-9517-45FA-BF24-E89C5EC5C60C}';
   SID_IWICBitmapCodecProgressNotification = '{64C1024E-C3CF-4462-8078-88C2B11C46D9}';
   SID_IWICComponentInfo = '{23BC3F0A-698B-4357-886B-F24D50671334}';
   SID_IWICFormatConverterInfo = '{9F34FB65-13F4-4f15-BC57-3726B5E53D9F}';
   SID_IWICBitmapCodecInfo = '{E87A44C4-B76E-4c47-8B09-298EB12A2714}';
   SID_IWICBitmapEncoderInfo = '{94C9B4EE-A09F-4f92-8A1E-4A9BCE7E76FB}';
   SID_IWICBitmapDecoderInfo = '{D8CD007F-D08F-4191-9BFC-236EA7F0E4B5}';
   SID_IWICPixelFormatInfo = '{E8EDA601-3D48-431a-AB44-69059BE88BBE}';
   SID_IWICPixelFormatInfo2 = '{A9DB33A2-AF5F-43C7-B679-74F5984B5AA4}';
   SID_IWICImagingFactory = '{ec5ec8a9-c395-4314-9c77-54d7a935ff70}';
   SID_IWICDevelopRawNotificationCallback = '{95c75a6e-3e8c-4ec2-85a8-aebcc551e59b}';
   SID_IWICDevelopRaw = '{fbec5e44-f7be-4b65-b7f8-c0c81fef026d}';

   IID_IWICPalette: TGUID = SID_IWICPalette;
   IID_IWICBitmapSource: TGUID = SID_IWICBitmapSource;
   IID_IWICFormatConverter: TGUID = SID_IWICFormatConverter;
   IID_IWICBitmapScaler: TGUID = SID_IWICBitmapScaler;
   IID_IWICBitmapClipper: TGUID = SID_IWICBitmapClipper;
   IID_IWICBitmapFlipRotator: TGUID = SID_IWICBitmapFlipRotator;
   IID_IWICBitmapLock: TGUID = SID_IWICBitmapLock;
   IID_IWICBitmap: TGUID = SID_IWICBitmap;
   IID_IWICColorTransform: TGUID = SID_IWICColorTransform;
   IID_IWICColorContext: TGUID = SID_IWICColorContext;
   IID_IWICFastMetadataEncoder: TGUID = SID_IWICFastMetadataEncoder;
   IID_IWICStream: TGUID = SID_IWICStream;
   IID_IWICEnumMetadataItem: TGUID = SID_IWICEnumMetadataItem;
   IID_IWICMetadataQueryReader: TGUID = SID_IWICMetadataQueryReader;
   IID_IWICMetadataQueryWriter: TGUID = SID_IWICMetadataQueryWriter;
   IID_IWICBitmapEncoder: TGUID = SID_IWICBitmapEncoder;
   IID_IWICBitmapFrameEncode: TGUID = SID_IWICBitmapFrameEncode;
   IID_IWICBitmapDecoder: TGUID = SID_IWICBitmapDecoder;
   IID_IWICBitmapSourceTransform: TGUID = SID_IWICBitmapSourceTransform;
   IID_IWICBitmapFrameDecode: TGUID = SID_IWICBitmapFrameDecode;
   IID_IWICProgressiveLevelControl: TGUID = SID_IWICProgressiveLevelControl;
   IID_IWICProgressCallback: TGUID = SID_IWICProgressCallback;
   IID_IWICBitmapCodecProgressNotification: TGUID = SID_IWICBitmapCodecProgressNotification;
   IID_IWICComponentInfo: TGUID = SID_IWICComponentInfo;
   IID_IWICFormatConverterInfo: TGUID = SID_IWICFormatConverterInfo;
   IID_IWICBitmapCodecInfo: TGUID = SID_IWICBitmapCodecInfo;
   IID_IWICBitmapEncoderInfo: TGUID = SID_IWICBitmapEncoderInfo;
   IID_IWICBitmapDecoderInfo: TGUID = SID_IWICBitmapDecoderInfo;
   IID_IWICPixelFormatInfo: TGUID = SID_IWICPixelFormatInfo;
   IID_IWICPixelFormatInfo2: TGUID = SID_IWICPixelFormatInfo2;
   IID_IWICImagingFactory: TGUID = SID_IWICImagingFactory;
   IID_IWICDevelopRawNotificationCallback: TGUID = SID_IWICDevelopRawNotificationCallback;
   IID_IWICDevelopRaw: TGUID = SID_IWICDevelopRaw;

Const
   WINCODEC_SDK_VERSION = $0236;
   CLSID_WICImagingFactory: TGUID = '{CACAF262-9370-4615-A13B-9F5539DA4C0A}';
   GUID_VendorMicrosoft: TGUID = '{F0E749CA-EDEF-4589-A73A-EE0E626A2A2B}';
   GUID_VendorMicrosoftBuiltIn: TGUID = '{257A30FD-06B6-462B-AEA4-63F70B86E533}';
   CLSID_WICBmpDecoder: TGUID = '{6B462062-7CBF-400D-9FDB-813DD10F2778}';
   CLSID_WICPngDecoder: TGUID = '{389EA17B-5078-4CDE-B6EF-25C15175C751}';
   CLSID_WICIcoDecoder: TGUID = '{C61BFCDF-2E0F-4AAD-A8D7-E06BAFEBCDFE}';
   CLSID_WICJpegDecoder: TGUID = '{9456A480-E88B-43EA-9E73-0B2D9B71B1CA}';
   CLSID_WICGifDecoder: TGUID = '{381DDA3C-9CE9-4834-A23E-1F98F8FC52BE}';
   CLSID_WICTiffDecoder: TGUID = '{B54E85D9-FE23-499F-8B88-6ACEA713752B}';
   CLSID_WICWmpDecoder: TGUID = '{A26CEC36-234C-4950-AE16-E34AACE71D0D}';
   CLSID_WICBmpEncoder: TGUID = '{69BE8BB4-D66D-47C8-865A-ED1589433782}';
   CLSID_WICPngEncoder: TGUID = '{27949969-876A-41D7-9447-568F6A35A4DC}';
   CLSID_WICJpegEncoder: TGUID = '{1A34F5C1-4A5A-46DC-B644-1F4567E7A676}';
   CLSID_WICGifEncoder: TGUID = '{114F5598-0B22-40A0-86A1-C83EA495ADBD}';
   CLSID_WICTiffEncoder: TGUID = '{0131BE10-2001-4C5F-A9B0-CC88FAB64CE8}';
   CLSID_WICWmpEncoder: TGUID = '{AC4CE3CB-E1C1-44CD-8215-5A1665509EC2}';
   GUID_ContainerFormatBmp: TGUID = '{0AF1D87E-FCFE-4188-BDEB-A7906471CBE3}';
   GUID_ContainerFormatPng: TGUID = '{1B7CFAF4-713F-473C-BBCD-6137425FAEAF}';
   GUID_ContainerFormatIco: TGUID = '{A3A860C4-338F-4C17-919A-FBA4B5628F21}';
   GUID_ContainerFormatJpeg: TGUID = '{19E4A5AA-5662-4FC5-A0C0-1758028E1057}';
   GUID_ContainerFormatTiff: TGUID = '{163BCC30-E2E9-4F0B-961D-A3E9FDB788A3}';
   GUID_ContainerFormatGif: TGUID = '{1F8A5601-7D4D-4CBD-9C82-1BC8D4EEB9A5}';
   GUID_ContainerFormatWmp: TGUID = '{57A37CAA-367A-4540-916B-F183C5093A4B}';
   CLSID_WICImagingCategories: TGUID = '{FAE3D380-FEA4-4623-8C75-C6B61110B681}';
   CATID_WICBitmapDecoders: TGUID = '{7ED96837-96F0-4812-B211-F13C24117ED3}';
   CATID_WICBitmapEncoders: TGUID = '{AC757296-3522-4E11-9862-C17BE5A1767E}';
   CATID_WICPixelFormats: TGUID = '{2B46E70F-CDA7-473E-89F6-DC9630A2390B}';
   CATID_WICFormatConverters: TGUID = '{7835EAE8-BF14-49D1-93CE-533A407B2248}';
   CATID_WICMetadataReader: TGUID = '{05AF94D8-7174-4CD2-BE4A-4124B80EE4B8}';
   CATID_WICMetadataWriter: TGUID = '{ABE3B9A4-257D-4B97-BD1A-294AF496222E}';
   CLSID_WICDefaultFormatConverter: TGUID = '{1A3F11DC-B514-4B17-8C5F-2154513852F1}';
   CLSID_WICFormatConverterHighColor: TGUID = '{AC75D454-9F37-48F8-B972-4E19BC856011}';
   CLSID_WICFormatConverterNChannel: TGUID = '{C17CABB2-D4A3-47D7-A557-339B2EFBD4F1}';
   CLSID_WICFormatConverterWMPhoto: TGUID = '{9CB5172B-D600-46BA-AB77-77BB7E3A00D9}';

Type
   WICColor = Cardinal;
   TWICColor = WICColor;
   PWICColor = ^TWicColor;

   WICRect = Record
      X: Integer;
      Y: Integer;
      Width: Integer;
      Height: Integer;
   End;
   PWICRect = ^WICRect;


   WICInProcPointer = ^Byte;
   { $EXTERNALSYM WICInProcPointer}
   TWICInProcPointer = WICInProcPointer;
   PWICInProcPointer = ^TWICInProcPointer;

Type
   WICColorContextType = Type Integer;

Const
   WICColorContextUninitialized = 0;
   WICColorContextProfile = $1;
   WICColorContextExifColorSpace = $2;

Type
   REFWICPixelFormatGUID = PGUID;
   WICPixelFormatGUID = TGUID;
   TWICPixelFormatGUID = WICPixelFormatGUID;
   PWICPixelFormatGUID = ^TWICPixelFormatGUID;

Const
   GUID_WICPixelFormatUndefined: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC900}';
   GUID_WICPixelFormatDontCare: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC900}';
   GUID_WICPixelFormat1bppIndexed: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC901}';
   GUID_WICPixelFormat2bppIndexed: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC902}';
   GUID_WICPixelFormat4bppIndexed: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC903}';
   GUID_WICPixelFormat8bppIndexed: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC904}';
   GUID_WICPixelFormatBlackWhite: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC905}';
   GUID_WICPixelFormat2bppGray: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC906}';
   GUID_WICPixelFormat4bppGray: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC907}';
   GUID_WICPixelFormat8bppGray: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC908}';
   GUID_WICPixelFormat8bppAlpha: TGUID = '{E6CD0116-EEBA-4161-AA85-27DD9FB3A895}';
   GUID_WICPixelFormat16bppBGR555: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC909}';
   GUID_WICPixelFormat16bppBGR565: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC90A}';
   GUID_WICPixelFormat16bppBGRA5551: TGUID = '{05EC7C2B-F1E6-4961-AD46-E1CC810A87D2}';
   GUID_WICPixelFormat16bppGray: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC90B}';
   GUID_WICPixelFormat24bppBGR: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC90C}';
   GUID_WICPixelFormat24bppRGB: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC90D}';
   GUID_WICPixelFormat32bppBGR: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC90E}';
   GUID_WICPixelFormat32bppBGRA: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC90F}';
   GUID_WICPixelFormat32bppPBGRA: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC910}';
   GUID_WICPixelFormat32bppGrayFloat: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC911}';
   GUID_WICPixelFormat32bppRGBA: TGUID = '{F5C7AD2D-6A8D-43DD-A7A8-A29935261AE9}';
   GUID_WICPixelFormat32bppPRGBA: TGUID = '{3CC4A650-A527-4D37-A916-3142C7EBEDBA}';
   GUID_WICPixelFormat48bppRGB: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC915}';
   GUID_WICPixelFormat48bppBGR: TGUID = '{E605A384-B468-46CE-BB2E-36F180E64313}';
   GUID_WICPixelFormat64bppRGBA: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC916}';
   GUID_WICPixelFormat64bppBGRA: TGUID = '{1562FF7C-D352-46F9-979E-42976B792246}';
   GUID_WICPixelFormat64bppPRGBA: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC917}';
   GUID_WICPixelFormat64bppPBGRA: TGUID = '{8C518E8E-A4EC-468B-AE70-C9A35A9C5530}';
   GUID_WICPixelFormat16bppGrayFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC913}';
   GUID_WICPixelFormat32bppBGR101010: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC914}';
   GUID_WICPixelFormat48bppRGBFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC912}';
   GUID_WICPixelFormat48bppBGRFixedPoint: TGUID = '{49CA140E-CAB6-493B-9DDF-60187C37532A}';
   GUID_WICPixelFormat96bppRGBFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC918}';
   GUID_WICPixelFormat128bppRGBAFloat: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC919}';
   GUID_WICPixelFormat128bppPRGBAFloat: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC91A}';
   GUID_WICPixelFormat128bppRGBFloat: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC91B}';
   GUID_WICPixelFormat32bppCMYK: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC91C}';
   GUID_WICPixelFormat64bppRGBAFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC91D}';
   GUID_WICPixelFormat64bppBGRAFixedPoint: TGUID = '{356de33c-54d2-4a23-bb04-9b7bf9b1d42d}';
   GUID_WICPixelFormat64bppRGBFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC940}';
   GUID_WICPixelFormat128bppRGBAFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC91E}';
   GUID_WICPixelFormat128bppRGBFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC941}';
   GUID_WICPixelFormat64bppRGBAHalf: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC93A}';
   GUID_WICPixelFormat64bppRGBHalf: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC942}';
   GUID_WICPixelFormat48bppRGBHalf: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC93B}';
   GUID_WICPixelFormat32bppRGBE: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC93D}';
   GUID_WICPixelFormat16bppGrayHalf: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC93E}';
   GUID_WICPixelFormat32bppGrayFixedPoint: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC93F}';
   GUID_WICPixelFormat32bppRGBA1010102: TGUID = '{25238D72-FCF9-4522-B514-5578E5AD55E0}';
   GUID_WICPixelFormat32bppRGBA1010102XR: TGUID = '{00DE6B9A-C101-434B-B502-D0165EE1122C}';
   GUID_WICPixelFormat64bppCMYK: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC91F}';
   GUID_WICPixelFormat24bpp3Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC920}';
   GUID_WICPixelFormat32bpp4Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC921}';
   GUID_WICPixelFormat40bpp5Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC922}';
   GUID_WICPixelFormat48bpp6Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC923}';
   GUID_WICPixelFormat56bpp7Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC924}';
   GUID_WICPixelFormat64bpp8Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC925}';
   GUID_WICPixelFormat48bpp3Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC926}';
   GUID_WICPixelFormat64bpp4Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC927}';
   GUID_WICPixelFormat80bpp5Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC928}';
   GUID_WICPixelFormat96bpp6Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC929}';
   GUID_WICPixelFormat112bpp7Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC92A}';
   GUID_WICPixelFormat128bpp8Channels: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC92B}';
   GUID_WICPixelFormat40bppCMYKAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC92C}';
   GUID_WICPixelFormat80bppCMYKAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC92D}';
   GUID_WICPixelFormat32bpp3ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC92E}';
   GUID_WICPixelFormat40bpp4ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC92F}';
   GUID_WICPixelFormat48bpp5ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC930}';
   GUID_WICPixelFormat56bpp6ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC931}';
   GUID_WICPixelFormat64bpp7ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC932}';
   GUID_WICPixelFormat72bpp8ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC933}';
   GUID_WICPixelFormat64bpp3ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC934}';
   GUID_WICPixelFormat80bpp4ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC935}';
   GUID_WICPixelFormat96bpp5ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC936}';
   GUID_WICPixelFormat112bpp6ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC937}';
   GUID_WICPixelFormat128bpp7ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC938}';
   GUID_WICPixelFormat144bpp8ChannelsAlpha: TGUID = '{6FDDC324-4E03-4BFE-B185-3D77768DC939}';

Type
   WICBitmapCreateCacheOption = Type Integer;

Const
   WICBitmapNoCache = 0;
   WICBitmapCacheOnDemand = $1;
   WICBitmapCacheOnLoad = $2;
   WICBITMAPCREATECACHEOPTION_FORCE_DWORD = $7FFFFFFF;

Type
   WICDecodeOptions = Type Integer;

Const
   WICDecodeMetadataCacheOnDemand = 0;
   WICDecodeMetadataCacheOnLoad = $1;
   WICMETADATACACHEOPTION_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapEncoderCacheOption = Type Integer;

Const
   WICBitmapEncoderCacheInMemory = 0;
   WICBitmapEncoderCacheTempFile = $1;
   WICBitmapEncoderNoCache = $2;
   WICBITMAPENCODERCACHEOPTION_FORCE_DWORD = $7FFFFFFF;

Type
   WICComponentType = Type Integer;

Const
   WICDecoder = $1;
   WICEncoder = $2;
   WICPixelFormatConverter = $4;
   WICMetadataReader = $8;
   WICMetadataWriter = $10;
   WICPixelFormat = $20;
   WICAllComponents = $3F;
   WICCOMPONENTTYPE_FORCE_DWORD = $7FFFFFFF;

Type
   WICComponentEnumerateOptions = Type Integer;

Const
   WICComponentEnumerateDefault = 0;
   WICComponentEnumerateRefresh = $1;
   WICComponentEnumerateDisabled = $80000000;
   WICComponentEnumerateUnsigned = $40000000;
   WICComponentEnumerateBuiltInOnly = $20000000;
   WICCOMPONENTENUMERATEOPTIONS_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapPattern = Record
      Position: ULARGE_INTEGER;
      Length: ULONG;
      Pattern: Pbyte;
      Mask: Pbyte;
      EndOfStream: BOOL;
   End;
   TWICBitmapPattern = WICBitmapPattern;
   PWICBitmapPattern = ^WICBitmapPattern;

Type
   WICBitmapInterpolationMode = Type Integer;

Const
   WICBitmapInterpolationModeNearestNeighbor = 0;
   WICBitmapInterpolationModeLinear = $1;
   WICBitmapInterpolationModeCubic = $2;
   WICBitmapInterpolationModeFant = $3;
   WICBITMAPINTERPOLATIONMODE_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapPaletteType = Type Integer;

Const
   WICBitmapPaletteTypeCustom = 0;
   WICBitmapPaletteTypeMedianCut = $1;
   WICBitmapPaletteTypeFixedBW = $2;
   WICBitmapPaletteTypeFixedHalftone8 = $3;
   WICBitmapPaletteTypeFixedHalftone27 = $4;
   WICBitmapPaletteTypeFixedHalftone64 = $5;
   WICBitmapPaletteTypeFixedHalftone125 = $6;
   WICBitmapPaletteTypeFixedHalftone216 = $7;
   WICBitmapPaletteTypeFixedWebPalette = WICBITMAPPALETTETYPEFIXEDHALFTONE216;
   WICBitmapPaletteTypeFixedHalftone252 = $8;
   WICBitmapPaletteTypeFixedHalftone256 = $9;
   WICBitmapPaletteTypeFixedGray4 = $A;
   WICBitmapPaletteTypeFixedGray16 = $B;
   WICBitmapPaletteTypeFixedGray256 = $C;
   WICBITMAPPALETTETYPE_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapDitherType = Type Integer;

Const
   WICBitmapDitherTypeNone = 0;
   WICBitmapDitherTypeSolid = 0;
   WICBitmapDitherTypeOrdered4x4 = $1;
   WICBitmapDitherTypeOrdered8x8 = $2;
   WICBitmapDitherTypeOrdered16x16 = $3;
   WICBitmapDitherTypeSpiral4x4 = $4;
   WICBitmapDitherTypeSpiral8x8 = $5;
   WICBitmapDitherTypeDualSpiral4x4 = $6;
   WICBitmapDitherTypeDualSpiral8x8 = $7;
   WICBitmapDitherTypeErrorDiffusion = $8;
   WICBITMAPDITHERTYPE_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapAlphaChannelOption = Type Integer;

Const
   WICBitmapUseAlpha = 0;
   WICBitmapUsePremultipliedAlpha = $1;
   WICBitmapIgnoreAlpha = $2;
   WICBITMAPALPHACHANNELOPTIONS_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapTransformOptions = Type Integer;

Const
   WICBitmapTransformRotate0 = 0;
   WICBitmapTransformRotate90 = $1;
   WICBitmapTransformRotate180 = $2;
   WICBitmapTransformRotate270 = $3;
   WICBitmapTransformFlipHorizontal = $8;
   WICBitmapTransformFlipVertical = $10;
   WICBITMAPTRANSFORMOPTIONS_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapLockFlags = Type Integer;

Const
   WICBitmapLockRead = $1;
   WICBitmapLockWrite = $2;
   WICBITMAPLOCKFLAGS_FORCE_DWORD = $7FFFFFFF;

Type
   WICBitmapDecoderCapabilities = Type Integer;

Const
   WICBitmapDecoderCapabilitySameEncoder = $1;
   WICBitmapDecoderCapabilityCanDecodeAllImages = $2;
   WICBitmapDecoderCapabilityCanDecodeSomeImages = $4;
   WICBitmapDecoderCapabilityCanEnumerateMetadata = $8;
   WICBitmapDecoderCapabilityCanDecodeThumbnail = $10;
   WICBITMAPDECODERCAPABILITIES_FORCE_DWORD = $7FFFFFFF;

Type
   WICProgressOperation = Type Integer;

Const
   WICProgressOperationCopyPixels = $1;
   WICProgressOperationWritePixels = $2;
   WICProgressOperationAll = $FFFF;
   WICPROGRESSOPERATION_FORCE_DWORD = $7FFFFFFF;

Type
   WICProgressNotification = Type Integer;

Const
   WICProgressNotificationBegin = $10000;
   WICProgressNotificationEnd = $20000;
   WICProgressNotificationFrequent = $40000;
   WICProgressNotificationAll = $FFFF0000;
   WICPROGRESSNOTIFICATION_FORCE_DWORD = $7FFFFFFF;

Type
   WICComponentSigning = Type Integer;

Const
   WICComponentSigned = $1;
   WICComponentUnsigned = $2;
   WICComponentSafe = $4;
   WICComponentDisabled = $80000000;
   WICCOMPONENTSIGNING_FORCE_DWORD = $7FFFFFFF;

Type
   WICGifLogicalScreenDescriptorProperties = Type Integer;

Const
   WICGifLogicalScreenSignature = $1;
   WICGifLogicalScreenDescriptorWidth = $2;
   WICGifLogicalScreenDescriptorHeight = $3;
   WICGifLogicalScreenDescriptorGlobalColorTableFlag = $4;
   WICGifLogicalScreenDescriptorColorResolution = $5;
   WICGifLogicalScreenDescriptorSortFlag = $6;
   WICGifLogicalScreenDescriptorGlobalColorTableSize = $7;
   WICGifLogicalScreenDescriptorBackgroundColorIndex = $8;
   WICGifLogicalScreenDescriptorPixelAspectRatio = $9;
   WICGifLogicalScreenDescriptorProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICGifImageDescriptorProperties = Type Integer;

Const
   WICGifImageDescriptorLeft = $1;
   WICGifImageDescriptorTop = $2;
   WICGifImageDescriptorWidth = $3;
   WICGifImageDescriptorHeight = $4;
   WICGifImageDescriptorLocalColorTableFlag = $5;
   WICGifImageDescriptorInterlaceFlag = $6;
   WICGifImageDescriptorSortFlag = $7;
   WICGifImageDescriptorLocalColorTableSize = $8;
   WICGifImageDescriptorProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICGifGraphicControlExtensionProperties = Type Integer;

Const
   WICGifGraphicControlExtensionDisposal = $1;
   WICGifGraphicControlExtensionUserInputFlag = $2;
   WICGifGraphicControlExtensionTransparencyFlag = $3;
   WICGifGraphicControlExtensionDelay = $4;
   WICGifGraphicControlExtensionTransparentColorIndex = $5;
   WICGifGraphicControlExtensionProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICGifApplicationExtensionProperties = Type Integer;

Const
   WICGifApplicationExtensionApplication = $1;
   WICGifApplicationExtensionData = $2;
   WICGifApplicationExtensionProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICGifCommentExtensionProperties = Type Integer;

Const
   WICGifCommentExtensionText = $1;
   WICGifCommentExtensionProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICJpegCommentProperties = Type Integer;

Const
   WICJpegCommentText = $1;
   WICJpegCommentProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICJpegLuminanceProperties = Type Integer;

Const
   WICJpegLuminanceTable = $1;
   WICJpegLuminanceProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICJpegChrominanceProperties = Type Integer;

Const
   WICJpegChrominanceTable = $1;
   WICJpegChrominanceProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WIC8BIMIptcProperties = Type Integer;

Const
   WIC8BIMIptcPString = 0;
   WIC8BIMIptcEmbeddedIPTC = $1;
   WIC8BIMIptcProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WIC8BIMResolutionInfoProperties = Type Integer;

Const
   WIC8BIMResolutionInfoPString = $1;
   WIC8BIMResolutionInfoHResolution = $2;
   WIC8BIMResolutionInfoHResolutionUnit = $3;
   WIC8BIMResolutionInfoWidthUnit = $4;
   WIC8BIMResolutionInfoVResolution = $5;
   WIC8BIMResolutionInfoVResolutionUnit = $6;
   WIC8BIMResolutionInfoHeightUnit = $7;
   WIC8BIMResolutionInfoProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WIC8BIMIptcDigestProperties = Type Integer;

Const
   WIC8BIMIptcDigestPString = $1;
   WIC8BIMIptcDigestIptcDigest = $2;
   WIC8BIMIptcDigestProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngGamaProperties = Type Integer;

Const
   WICPngGamaGamma = $1;
   WICPngGamaProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngBkgdProperties = Type Integer;

Const
   WICPngBkgdBackgroundColor = $1;
   WICPngBkgdProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngItxtProperties = Type Integer;

Const
   WICPngItxtKeyword = $1;
   WICPngItxtCompressionFlag = $2;
   WICPngItxtLanguageTag = $3;
   WICPngItxtTranslatedKeyword = $4;
   WICPngItxtText = $5;
   WICPngItxtProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngChrmProperties = Type Integer;

Const
   WICPngChrmWhitePointX = $1;
   WICPngChrmWhitePointY = $2;
   WICPngChrmRedX = $3;
   WICPngChrmRedY = $4;
   WICPngChrmGreenX = $5;
   WICPngChrmGreenY = $6;
   WICPngChrmBlueX = $7;
   WICPngChrmBlueY = $8;
   WICPngChrmProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngHistProperties = Type Integer;

Const
   WICPngHistFrequencies = $1;
   WICPngHistProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngIccpProperties = Type Integer;

Const
   WICPngIccpProfileName = $1;
   WICPngIccpProfileData = $2;
   WICPngIccpProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngSrgbProperties = Type Integer;

Const
   WICPngSrgbRenderingIntent = $1;
   WICPngSrgbProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngTimeProperties = Type Integer;

Const
   WICPngTimeYear = $1;
   WICPngTimeMonth = $2;
   WICPngTimeDay = $3;
   WICPngTimeHour = $4;
   WICPngTimeMinute = $5;
   WICPngTimeSecond = $6;
   WICPngTimeProperties_FORCE_DWORD = $7FFFFFFF;

Type
   WICSectionAccessLevel = Type Integer;

Const
   WICSectionAccessLevelRead = $1;
   WICSectionAccessLevelReadWrite = $3;
   WICSectionAccessLevel_FORCE_DWORD = $7FFFFFFF;

Type
   WICPixelFormatNumericRepresentation = Type Integer;

Const
   WICPixelFormatNumericRepresentationUnspecified = 0;
   WICPixelFormatNumericRepresentationIndexed = $1;
   WICPixelFormatNumericRepresentationUnsignedInteger = $2;
   WICPixelFormatNumericRepresentationSignedInteger = $3;
   WICPixelFormatNumericRepresentationFixed = $4;
   WICPixelFormatNumericRepresentationFloat = $5;
   WICPixelFormatNumericRepresentation_FORCE_DWORD = $7FFFFFFF;

Type
   IWICBitmapSource = Interface;
   IWICMetadataQueryWriter = Interface;
   IWICBitmapEncoderInfo = Interface;
   IWICBitmapFrameEncode = Interface;
   IWICBitmapDecoderInfo = Interface;
   IWICBitmapFrameDecode = Interface;

   { interface IWICPalette }
   IWICPalette = Interface(IUnknown)
      [SID_IWICPalette]
      Function InitializePredefined(ePaletteType: WICBitmapPaletteType; fAddTransparentColor: BOOL): HRESULT; Stdcall;
      Function InitializeCustom(pColors: PWICColor; cCount: UINT): HRESULT; Stdcall;
      Function InitializeFromBitmap(pISurface: IWICBitmapSource; cCount: UINT; fAddTransparentColor: BOOL): HRESULT; Stdcall;
      Function InitializeFromPalette(pIPalette: IWICPalette): HRESULT; Stdcall;
      Function GetType(Var pePaletteType: WICBitmapPaletteType): HRESULT; Stdcall;
      Function GetColorCount(Var pcCount: UINT): HRESULT; Stdcall;
      Function GetColors(cCount: UINT; pColors: PWICColor; Var pcActualColors: UINT): HRESULT; Stdcall;
      Function IsBlackWhite(Var pfIsBlackWhite: BOOL): HRESULT; Stdcall;
      Function IsGrayscale(Var pfIsGrayscale: BOOL): HRESULT; Stdcall;
      Function HasAlpha(Var pfHasAlpha: BOOL): HRESULT; Stdcall;
   End;

   { interface IWICBitmapSource }
   IWICBitmapSource = Interface(IUnknown)
      [SID_IWICBitmapSource]
      Function GetSize(Var puiWidth: UINT; Var puiHeight: UINT): HRESULT; Stdcall;
      Function GetPixelFormat(Var pPixelFormat: WICPixelFormatGUID): HRESULT; Stdcall;
      Function GetResolution(Var pDpiX: Double; Var pDpiY: Double): HRESULT; Stdcall;
      Function CopyPalette(pIPalette: IWICPalette): HRESULT; Stdcall;
      Function CopyPixels(prc: PWICRect; cbStride: UINT; cbBufferSize: UINT; pbBuffer: Pbyte): HRESULT; Stdcall;
   End;

   { interface IWICFormatConverter }
   IWICFormatConverter = Interface(IWICBitmapSource)
      [SID_IWICFormatConverter]
      Function Initialize(pISource: IWICBitmapSource; Const dstFormat: WICPixelFormatGUID; dither: WICBitmapDitherType; Const pIPalette: IWICPalette;
         alphaThresholdPercent: Double; paletteTranslate: WICBitmapPaletteType): HRESULT; Stdcall;
      Function CanConvert(srcPixelFormat: REFWICPixelFormatGUID; dstPixelFormat: REFWICPixelFormatGUID; Var pfCanConvert: BOOL): HRESULT; Stdcall;
   End;

   { interface IWICBitmapScaler }
   IWICBitmapScaler = Interface(IWICBitmapSource)
      [SID_IWICBitmapScaler]
      Function Initialize(pISource: IWICBitmapSource; uiWidth: UINT; uiHeight: UINT; mode: WICBitmapInterpolationMode): HRESULT; Stdcall;
   End;

   { interface IWICBitmapClipper }
   IWICBitmapClipper = Interface(IWICBitmapSource)
      [SID_IWICBitmapClipper]
      Function Initialize(pISource: IWICBitmapSource; Var prc: WICRect): HRESULT; Stdcall;
   End;

   { interface IWICBitmapFlipRotator }
   IWICBitmapFlipRotator = Interface(IWICBitmapSource)
      [SID_IWICBitmapFlipRotator]
      Function Initialize(pISource: IWICBitmapSource; options: WICBitmapTransformOptions): HRESULT; Stdcall;
   End;

   { interface IWICBitmapLock }
   IWICBitmapLock = Interface(IUnknown)
      [SID_IWICBitmapLock]
      Function GetSize(Var puiWidth: UINT; Var puiHeight: UINT): HRESULT; Stdcall;
      Function GetStride(Var pcbStride: UINT): HRESULT; Stdcall;
      Function GetDataPointer(Var pcbBufferSize: UINT; Var ppbData: WICInProcPointer): HRESULT; Stdcall;
      Function GetPixelFormat(Var pPixelFormat: WICPixelFormatGUID): HRESULT; Stdcall;
   End;

   { interface IWICBitmap }
   IWICBitmap = Interface(IWICBitmapSource)
      [SID_IWICBitmap]
      Function Lock(Const prcLock: WICRect; flags: DWORD; out ppILock: IWICBitmapLock): HRESULT; Stdcall;
      Function SetPalette(pIPalette: IWICPalette): HRESULT; Stdcall;
      Function SetResolution(dpiX: Double; dpiY: Double): HRESULT; Stdcall;
   End;

   { interface IWICColorContext }
   IWICColorContext = Interface(IUnknown)
      [SID_IWICColorContext]
      Function InitializeFromFilename(wzFilename: LPCWSTR): HRESULT; Stdcall;
      Function InitializeFromMemory(Const pbBuffer: Pbyte; cbBufferSize: UINT): HRESULT; Stdcall;
      Function InitializeFromExifColorSpace(Value: UINT): HRESULT; Stdcall;
      Function GetType(Var pType: WICColorContextType): HRESULT; Stdcall;
      Function GetProfileBytes(cbBuffer: UINT; pbBuffer: Pbyte; Var pcbActual: UINT): HRESULT; Stdcall;
      Function GetExifColorSpace(Var pValue: UINT): HRESULT; Stdcall;
   End;

   PIWICColorContext = ^IWICColorContext;

   { interface IWICColorTransform }
   IWICColorTransform = Interface(IWICBitmapSource)
      [SID_IWICColorTransform]
      Function Initialize(pIBitmapSource: IWICBitmapSource; pIContextSource: IWICColorContext; pIContextDest: IWICColorContext; pixelFmtDest: REFWICPixelFormatGUID): HRESULT; Stdcall;
   End;

   { interface IWICFastMetadataEncoder }
   IWICFastMetadataEncoder = Interface(IUnknown)
      [SID_IWICFastMetadataEncoder]
      Function Commit: HRESULT; Stdcall;
      Function GetMetadataQueryWriter(out ppIMetadataQueryWriter: IWICMetadataQueryWriter): HRESULT; Stdcall;
   End;

   { interface IWICStream }
   IWICStream = Interface(IStream)
      [SID_IWICStream]
      Function InitializeFromIStream(pIStream: IStream): HRESULT; Stdcall;
      Function InitializeFromFilename(wzFileName: LPCWSTR; dwDesiredAccess: DWORD): HRESULT; Stdcall;
      Function InitializeFromMemory(pbBuffer: WICInProcPointer; cbBufferSize: DWORD): HRESULT; Stdcall;
      Function InitializeFromIStreamRegion(pIStream: IStream; ulOffset: ULARGE_INTEGER; ulMaxSize: ULARGE_INTEGER): HRESULT; Stdcall;
   End;

   { interface IWICEnumMetadataItem }
   IWICEnumMetadataItem = Interface(IUnknown)
      [SID_IWICEnumMetadataItem]
      Function Next(celt: Cardinal; rgeltSchema: PPropVariant; rgeltID: PPropVariant; rgeltValue: PPropVariant; Var pceltFetched: ULONG): HRESULT; Stdcall;
      Function Skip(celt: Cardinal): HRESULT; Stdcall;
      Function Reset: HRESULT; Stdcall;
      Function Clone(out ppIEnumMetadataItem: IWICEnumMetadataItem): HRESULT; Stdcall;
   End;

   { interface IWICMetadataQueryReader }
   IWICMetadataQueryReader = Interface(IUnknown)
      [SID_IWICMetadataQueryReader]
      Function GetContainerFormat(Var pguidContainerFormat: TGUID): HRESULT; Stdcall;
      Function GetLocation(cchMaxLength: UINT; wzNamespace: PWCHAR; Var pcchActualLength: UINT): HRESULT; Stdcall;
      Function GetMetadataByName(wzName: LPCWSTR; Var pvarValue: PROPVARIANT): HRESULT; Stdcall;
      Function GetEnumerator(out ppIEnumString: IEnumString): HRESULT; Stdcall;
   End;

   { interface IWICMetadataQueryWriter }
   IWICMetadataQueryWriter = Interface(IWICMetadataQueryReader)
      [SID_IWICMetadataQueryWriter]
      Function SetMetadataByName(wzName: LPCWSTR; Const pvarValue: TPropVariant): HRESULT; Stdcall;
      Function RemoveMetadataByName(wzName: LPCWSTR): HRESULT; Stdcall;
   End;

   { interface IWICBitmapEncoder }
   IWICBitmapEncoder = Interface(IUnknown)
      [SID_IWICBitmapEncoder]
      Function Initialize(pIStream: IStream; cacheOption: WICBitmapEncoderCacheOption): HRESULT; Stdcall;
      Function GetContainerFormat(Var pguidContainerFormat: TGUID): HRESULT; Stdcall;
      Function GetEncoderInfo(out ppIEncoderInfo: IWICBitmapEncoderInfo): HRESULT; Stdcall;
      Function SetColorContexts(cCount: UINT; ppIColorContext: PIWICColorContext): HRESULT; Stdcall;
      Function SetPalette(pIPalette: IWICPalette): HRESULT; Stdcall;
      Function SetThumbnail(pIThumbnail: IWICBitmapSource): HRESULT; Stdcall;
      Function SetPreview(pIPreview: IWICBitmapSource): HRESULT; Stdcall;
      Function CreateNewFrame(out ppIFrameEncode: IWICBitmapFrameEncode; Var ppIEncoderOptions: IPropertyBag2): HRESULT; Stdcall;
      Function Commit: HRESULT; Stdcall;
      Function GetMetadataQueryWriter(out ppIMetadataQueryWriter: IWICMetadataQueryWriter): HRESULT; Stdcall;
   End;

   { interface IWICBitmapFrameEncode }
   IWICBitmapFrameEncode = Interface(IUnknown)
      [SID_IWICBitmapFrameEncode]
      Function Initialize(pIEncoderOptions: IUnknown): HRESULT; Stdcall;
      Function SetSize(uiWidth: UINT; uiHeight: UINT): HRESULT; Stdcall;
      Function SetResolution(dpiX: Double; dpiY: Double): HRESULT; Stdcall;
      Function SetPixelFormat(Var pPixelFormat: WICPixelFormatGUID): HRESULT; Stdcall;
      Function SetColorContexts(cCount: UINT; ppIColorContext: PIWICColorContext): HRESULT; Stdcall;
      Function SetPalette(pIPalette: IWICPalette): HRESULT; Stdcall;
      Function SetThumbnail(pIThumbnail: IWICBitmapSource): HRESULT; Stdcall;
      Function WritePixels(lineCount: UINT; cbStride: UINT; cbBufferSize: UINT; pbPixels: Pbyte): HRESULT; Stdcall;
      Function WriteSource(pIBitmapSource: IWICBitmapSource; prc: PWICRect): HRESULT; Stdcall;
      Function Commit: HRESULT; Stdcall;
      Function GetMetadataQueryWriter(out ppIMetadataQueryWriter: IWICMetadataQueryWriter): HRESULT; Stdcall;
   End;

   { interface IWICBitmapDecoder }
   IWICBitmapDecoder = Interface(IUnknown)
      [SID_IWICBitmapDecoder]
      Function QueryCapability(pIStream: IStream; Var pdwCapability: DWORD): HRESULT; Stdcall;
      Function Initialize(pIStream: IStream; cacheOptions: WICDecodeOptions): HRESULT; Stdcall;
      Function GetContainerFormat(Var pguidContainerFormat: TGUID): HRESULT; Stdcall;
      Function GetDecoderInfo(out ppIDecoderInfo: IWICBitmapDecoderInfo): HRESULT; Stdcall;
      Function CopyPalette(pIPalette: IWICPalette): HRESULT; Stdcall;
      Function GetMetadataQueryReader(out ppIMetadataQueryReader: IWICMetadataQueryReader): HRESULT; Stdcall;
      Function GetPreview(out ppIBitmapSource: IWICBitmapSource): HRESULT; Stdcall;
      Function GetColorContexts(cCount: UINT; ppIColorContexts: PIWICColorContext; Var pcActualCount: UINT): HRESULT; Stdcall;
      Function GetThumbnail(out ppIThumbnail: IWICBitmapSource): HRESULT; Stdcall;
      Function GetFrameCount(Var pCount: UINT): HRESULT; Stdcall;
      Function GetFrame(index: UINT; out ppIBitmapFrame: IWICBitmapFrameDecode): HRESULT; Stdcall;

   End;

   { interface IWICBitmapSourceTransform }
   IWICBitmapSourceTransform = Interface(IUnknown)
      [SID_IWICBitmapSourceTransform]
      Function CopyPixels(Var prc: WICRect; uiWidth: UINT; uiHeight: UINT; Var pguidDstFormat: WICPixelFormatGUID; dstTransform: WICBitmapTransformOptions;
         nStride: UINT; cbBufferSize: UINT; pbBuffer: Pbyte): HRESULT; Stdcall;
      Function GetClosestSize(Var puiWidth: UINT; Var puiHeight: UINT): HRESULT; Stdcall;
      Function GetClosestPixelFormat(Var pguidDstFormat: WICPixelFormatGUID): HRESULT; Stdcall;
      Function DoesSupportTransform(dstTransform: WICBitmapTransformOptions; Var pfIsSupported: BOOL): HRESULT; Stdcall;
   End;

   { interface IWICBitmapFrameDecode }
   IWICBitmapFrameDecode = Interface(IWICBitmapSource)
      [SID_IWICBitmapFrameDecode]
      Function GetMetadataQueryReader(out ppIMetadataQueryReader: IWICMetadataQueryReader): HRESULT; Stdcall;
      Function GetColorContexts(cCount: UINT; ppIColorContexts: PIWICColorContext; Var pcActualCount: UINT): HRESULT; Stdcall;
      Function GetThumbnail(out ppIThumbnail: IWICBitmapSource): HRESULT; Stdcall;
   End;

   { interface IWICProgressiveLevelControl }
   IWICProgressiveLevelControl = Interface(IUnknown)
      [SID_IWICProgressiveLevelControl]
      Function GetLevelCount(Var pcLevels: UINT): HRESULT; Stdcall;
      Function GetCurrentLevel(Var pnLevel: UINT): HRESULT; Stdcall;
      Function SetCurrentLevel(nLevel: UINT): HRESULT; Stdcall;
   End;

   { interface IWICProgressCallback }
   IWICProgressCallback = Interface(IUnknown)
      [SID_IWICProgressCallback]
      Function Notify(uFrameNum: Cardinal; operation: WICProgressOperation; dblProgress: Double): HRESULT; Stdcall;
   End;

   { interface IWICBitmapCodecProgressNotification }
   FNProgressNotification = Function(pvData: Pointer; uFrameNum: Cardinal; operation: WICProgressOperation; dblProgress: Double): HRESULT; Stdcall;
   PFNProgressNotification = ^FNProgressNotification;

   IWICBitmapCodecProgressNotification = Interface(IUnknown)
      [SID_IWICBitmapCodecProgressNotification]
      Function RegisterProgressNotification(pfnProgressNotification: PFNProgressNotification; pvData: Pointer; dwProgressFlags: DWORD): HRESULT; Stdcall;
   End;

   { interface IWICComponentInfo }
   IWICComponentInfo = Interface(IUnknown)
      [SID_IWICComponentInfo]
      Function GetComponentType(Var pType: WICComponentType): HRESULT; Stdcall;
      Function GetCLSID(Var pclsid: TGUID): HRESULT; Stdcall;
      Function GetSigningStatus(Var pStatus: DWORD): HRESULT; Stdcall;
      Function GetAuthor(cchAuthor: UINT; wzAuthor: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetVendorGUID(Var pguidVendor: TGUID): HRESULT; Stdcall;
      Function GetVersion(cchVersion: UINT; wzVersion: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetSpecVersion(cchSpecVersion: UINT; wzSpecVersion: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetFriendlyName(cchFriendlyName: UINT; wzFriendlyName: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
   End;

   { interface IWICFormatConverterInfo }
   IWICFormatConverterInfo = Interface(IWICComponentInfo)
      [SID_IWICFormatConverterInfo]
      Function GetPixelFormats(cFormats: UINT; pPixleFormatGUIDs: PWICPixelFormatGUID; Var pcActual: UINT): HRESULT; Stdcall;
      Function CreateInstance(out ppIConverter: IWICFormatConverter): HRESULT; Stdcall;
   End;

   { interface IWICBitmapCodecInfo }
   IWICBitmapCodecInfo = Interface(IWICComponentInfo)
      [SID_IWICBitmapCodecInfo]
      Function GetContainerFormat(Var pguidContainerFormat: TGUID): HRESULT; Stdcall;
      Function GetPixelFormats(cFormats: UINT; Var guidPixelFormats: PGUID; Var pcActual: UINT): HRESULT; Stdcall;
      Function GetColorManagementVersion(cchColorManagementVersion: UINT; wzColorManagementVersion: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetDeviceManufacturer(cchDeviceManufacturer: UINT; wzDeviceManufacturer: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetDeviceModels(cchDeviceModels: UINT; wzDeviceModels: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetMimeTypes(cchMimeTypes: UINT; wzMimeTypes: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function GetFileExtensions(cchFileExtensions: UINT; wzFileExtensions: PWCHAR; Var pcchActual: UINT): HRESULT; Stdcall;
      Function DoesSupportAnimation(Var pfSupportAnimation: BOOL): HRESULT; Stdcall;
      Function DoesSupportChromakey(Var pfSupportChromakey: BOOL): HRESULT; Stdcall;
      Function DoesSupportLossless(Var pfSupportLossless: BOOL): HRESULT; Stdcall;
      Function DoesSupportMultiframe(Var pfSupportMultiframe: BOOL): HRESULT; Stdcall;
      Function MatchesMimeType(wzMimeType: LPCWSTR; Var pfMatches: BOOL): HRESULT; Stdcall;

   End;

   { interface IWICBitmapEncoderInfo }
   IWICBitmapEncoderInfo = Interface(IWICBitmapCodecInfo)
      [SID_IWICBitmapEncoderInfo]
      Function CreateInstance(out ppIBitmapEncoder: IWICBitmapEncoder): HRESULT; Stdcall;
   End;

   { interface IWICBitmapDecoderInfo }
   IWICBitmapDecoderInfo = Interface(IWICBitmapCodecInfo)
      [SID_IWICBitmapDecoderInfo]
      Function GetPatterns(cbSizePatterns: UINT; pPatterns: PWICBitmapPattern; Var pcPatterns: UINT; Var pcbPatternsActual: UINT): HRESULT; Stdcall;
      Function MatchesPattern(pIStream: IStream; Var pfMatches: BOOL): HRESULT; Stdcall;
      Function CreateInstance(out ppIBitmapDecoder: IWICBitmapDecoder): HRESULT; Stdcall;
   End;

   { interface IWICPixelFormatInfo }
   IWICPixelFormatInfo = Interface(IWICComponentInfo)
      [SID_IWICPixelFormatInfo]
      Function GetFormatGUID(Var pFormat: TGUID): HRESULT; Stdcall;
      Function GetColorContext(out ppIColorContext: IWICColorContext): HRESULT; Stdcall;
      Function GetBitsPerPixel(Var puiBitsPerPixel: UINT): HRESULT; Stdcall;
      Function GetChannelCount(Var puiChannelCount: UINT): HRESULT; Stdcall;
      Function GetChannelMask(uiChannelIndex: UINT; cbMaskBuffer: UINT; pbMaskBuffer: Pbyte; Var pcbActual: UINT): HRESULT; Stdcall;
   End;

   { interface IWICPixelFormatInfo2 }
   IWICPixelFormatInfo2 = Interface(IWICPixelFormatInfo)
      [SID_IWICPixelFormatInfo2]
      Function SupportsTransparency(Var pfSupportsTransparency: BOOL): HRESULT; Stdcall;
      Function GetNumericRepresentation(Var pNumericRepresentation: WICPixelFormatNumericRepresentation): HRESULT; Stdcall;
   End;

   { interface IWICImagingFactory }
   IWICImagingFactory = Interface(IUnknown)
      [SID_IWICImagingFactory]
      Function CreateDecoderFromFilename(wzFilename: LPCWSTR; pguidVendor: PGUID; dwDesiredAccess: DWORD; metadataOptions: WICDecodeOptions; out ppIDecoder: IWICBitmapDecoder): HRESULT; Stdcall;

      Function CreateDecoderFromStream(pIStream: IStream; pguidVendor: PGUID; metadataOptions: WICDecodeOptions; out ppIDecoder: IWICBitmapDecoder): HRESULT; Stdcall;

      Function CreateDecoderFromFileHandle(hFile: Longword; Const pguidVendor: TGUID; metadataOptions: WICDecodeOptions; out ppIDecoder: IWICBitmapDecoder): HRESULT; Stdcall;

      Function CreateComponentInfo(Const clsidComponent: TGUID; out ppIInfo: IWICComponentInfo): HRESULT; Stdcall;

      Function CreateDecoder(Const guidContainerFormat: TGuid; Const pguidVendor: TGUID; out ppIDecoder: IWICBitmapDecoder): HRESULT; Stdcall;

      Function CreateEncoder(Const guidContainerFormat: TGuid; Const pguidVendor: PGUID; out ppIEncoder: IWICBitmapEncoder): HRESULT; Stdcall;

      Function CreatePalette(out ppIPalette: IWICPalette): HRESULT; Stdcall;
      Function CreateFormatConverter(out ppIFormatConverter: IWICFormatConverter): HRESULT; Stdcall;
      Function CreateBitmapScaler(out ppIBitmapScaler: IWICBitmapScaler): HRESULT; Stdcall;
      Function CreateBitmapClipper(out ppIBitmapClipper: IWICBitmapClipper): HRESULT; Stdcall;
      Function CreateBitmapFlipRotator(out ppIBitmapFlipRotator: IWICBitmapFlipRotator): HRESULT; Stdcall;
      Function CreateStream(out ppIWICStream: IWICStream): HRESULT; Stdcall;
      Function CreateColorContext(out ppIWICColorContext: IWICColorContext): HRESULT; Stdcall;
      Function CreateColorTransformer(out ppIWICColorTransform: IWICColorTransform): HRESULT; Stdcall;
      Function CreateBitmap(uiWidth: UINT; uiHeight: UINT; pixelFormat: REFWICPixelFormatGUID; option: WICBitmapCreateCacheOption; out ppIBitmap: IWICBitmap): HRESULT; Stdcall;

      Function CreateBitmapFromSource(pIBitmapSource: IWICBitmapSource; option: WICBitmapCreateCacheOption; out ppIBitmap: IWICBitmap): HRESULT; Stdcall;

      Function CreateBitmapFromSourceRect(pIBitmapSource: IWICBitmapSource; x: UINT; y: UINT; Width: UINT; Height: UINT; out ppIBitmap: IWICBitmap): HRESULT; Stdcall;

      Function CreateBitmapFromMemory(uiWidth: UINT; uiHeight: UINT; Const pixelFormat: WICPixelFormatGUID; cbStride: UINT; cbBufferSize: UINT; pbBuffer: Pbyte; out ppIBitmap: IWICBitmap): HRESULT; Stdcall;

      Function CreateBitmapFromHBITMAP(hBitmap: HBITMAP; hPalette: HPALETTE; options: WICBitmapAlphaChannelOption; out ppIBitmap: IWICBitmap): HRESULT; Stdcall;

      Function CreateBitmapFromHICON(hIcon: HICON; out ppIBitmap: IWICBitmap): HRESULT; Stdcall;
      Function CreateComponentEnumerator(componentTypes: DWORD; options: DWORD; out ppIEnumUnknown: IEnumUnknown): HRESULT; Stdcall;
      Function CreateFastMetadataEncoderFromDecoder(pIDecoder: IWICBitmapDecoder; out ppIFastEncoder: IWICFastMetadataEncoder): HRESULT; Stdcall;
      Function CreateFastMetadataEncoderFromFrameDecode(pIFrameDecoder: IWICBitmapFrameDecode; out ppIFastEncoder: IWICFastMetadataEncoder): HRESULT; Stdcall;

      Function CreateQueryWriter(Const guidMetadataFormat: TGuid; Const pguidVendor: TGUID; out ppIQueryWriter: IWICMetadataQueryWriter): HRESULT; Stdcall;

      Function CreateQueryWriterFromReader(pIQueryReader: IWICMetadataQueryReader; Const pguidVendor: TGUID; out ppIQueryWriter: IWICMetadataQueryWriter): HRESULT; Stdcall;
   End;

Const
   FACILITY_WINCODEC_ERR = $898;
   WINCODEC_ERR_BASE = $2000;

   WINCODEC_ERR_GENERIC_ERROR = E_FAIL;
   WINCODEC_ERR_INVALIDPARAMETER = E_INVALIDARG;
   WINCODEC_ERR_OUTOFMEMORY = E_OUTOFMEMORY;
   WINCODEC_ERR_NOTIMPLEMENTED = E_NOTIMPL;
   WINCODEC_ERR_ABORTED = E_ABORT;
   WINCODEC_ERR_ACCESSDENIED = E_ACCESSDENIED;
   WINCODEC_ERR_VALUEOVERFLOW = $80070216; //INTSAFE_E_ARITHMETIC_OVERFLOW;
   WINCODEC_ERR_WRONGSTATE = $88982f04;
   WINCODEC_ERR_VALUEOUTOFRANGE = $88982f05;
   WINCODEC_ERR_UNKNOWNIMAGEFORMAT = $88982f07;
   WINCODEC_ERR_UNSUPPORTEDVERSION = $88982f0B;
   WINCODEC_ERR_NOTINITIALIZED = $88982f0C;
   WINCODEC_ERR_ALREADYLOCKED = $88982f0D;
   WINCODEC_ERR_PROPERTYNOTFOUND = $88982f40;
   WINCODEC_ERR_PROPERTYNOTSUPPORTED = $88982f41;
   WINCODEC_ERR_PROPERTYSIZE = $88982f42;
   WINCODEC_ERR_CODECPRESENT = $88982f43;
   WINCODEC_ERR_CODECNOTHUMBNAIL = $88982f44;
   WINCODEC_ERR_PALETTEUNAVAILABLE = $88982f45;
   WINCODEC_ERR_CODECTOOMANYSCANLINES = $88982f46;
   WINCODEC_ERR_INTERNALERROR = $88982f48;
   WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS = $88982f49;
   WINCODEC_ERR_COMPONENTNOTFOUND = $88982f50;
   WINCODEC_ERR_IMAGESIZEOUTOFRANGE = $88982f51;
   WINCODEC_ERR_TOOMUCHMETADATA = $88982f52;
   WINCODEC_ERR_BADIMAGE = $88982f60;
   WINCODEC_ERR_BADHEADER = $88982f61;
   WINCODEC_ERR_FRAMEMISSING = $88982f62;
   WINCODEC_ERR_BADMETADATAHEADER = $88982f63;
   WINCODEC_ERR_BADSTREAMDATA = $88982f70;
   WINCODEC_ERR_STREAMWRITE = $88982f71;
   WINCODEC_ERR_STREAMREAD = $88982f72;
   WINCODEC_ERR_STREAMNOTAVAILABLE = $88982f73;
   WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT = $88982f80;
   WINCODEC_ERR_UNSUPPORTEDOPERATION = $88982f81;
   WINCODEC_ERR_INVALIDREGISTRATION = $88982f8A;
   WINCODEC_ERR_COMPONENTINITIALIZEFAILURE = $88982f8B;
   WINCODEC_ERR_INSUFFICIENTBUFFER = $88982f8C;
   WINCODEC_ERR_DUPLICATEMETADATAPRESENT = $88982f8D;
   WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE = $88982f8E;
   WINCODEC_ERR_UNEXPECTEDSIZE = $88982f8F;
   WINCODEC_ERR_INVALIDQUERYREQUEST = $88982f90;
   WINCODEC_ERR_UNEXPECTEDMETADATATYPE = $88982f91;
   WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT = $88982f92;
   WINCODEC_ERR_INVALIDQUERYCHARACTER = $88982f93;
   WINCODEC_ERR_WIN32ERROR = $88982f94;
   WINCODEC_ERR_INVALIDPROGRESSIVELEVEL = $88982f95;

Type
   WICTiffCompressionOption = Type Integer;

Const
   WICTiffCompressionDontCare = 0;
   WICTiffCompressionNone = $1;
   WICTiffCompressionCCITT3 = $2;
   WICTiffCompressionCCITT4 = $3;
   WICTiffCompressionLZW = $4;
   WICTiffCompressionRLE = $5;
   WICTiffCompressionZIP = $6;
   WICTiffCompressionLZWHDifferencing = $7;
   WICTIFFCOMPRESSIONOPTION_FORCE_DWORD = $7FFFFFFF;

Type
   WICJpegYCrCbSubsamplingOption = Type Integer;

Const
   WICJpegYCrCbSubsamplingDefault = 0;
   WICJpegYCrCbSubsampling420 = $1;
   WICJpegYCrCbSubsampling422 = $2;
   WICJpegYCrCbSubsampling444 = $3;
   WICJPEGYCRCBSUBSAMPLING_FORCE_DWORD = $7FFFFFFF;

Type
   WICPngFilterOption = Type Integer;

Const
   WICPngFilterUnspecified = 0;
   WICPngFilterNone = $1;
   WICPngFilterSub = $2;
   WICPngFilterUp = $3;
   WICPngFilterAverage = $4;
   WICPngFilterPaeth = $5;
   WICPngFilterAdaptive = $6;
   WICPNGFILTEROPTION_FORCE_DWORD = $7FFFFFFF;

Type
   WICNamedWhitePoint = Type Integer;

Const
   WICWhitePointDefault = $1;
   WICWhitePointDaylight = $2;
   WICWhitePointCloudy = $4;
   WICWhitePointShade = $8;
   WICWhitePointTungsten = $10;
   WICWhitePointFluorescent = $20;
   WICWhitePointFlash = $40;
   WICWhitePointUnderwater = $80;
   WICWhitePointCustom = $100;
   WICWhitePointAutoWhiteBalance = $200;
   WICWhitePointAsShot = WICWHITEPOINTDEFAULT;
   WICNAMEDWHITEPOINT_FORCE_DWORD = $7FFFFFFF;

Type
   WICRawCapabilities = Type Integer;

Const
   WICRawCapabilityNotSupported = 0;
   WICRawCapabilityGetSupported = $1;
   WICRawCapabilityFullySupported = $2;
   WICRAWCAPABILITIES_FORCE_DWORD = $7FFFFFFF;

Type
   WICRawRotationCapabilities = Type Integer;

Const
   WICRawRotationCapabilityNotSupported = 0;
   WICRawRotationCapabilityGetSupported = $1;
   WICRawRotationCapabilityNinetyDegreesSupported = $2;
   WICRawRotationCapabilityFullySupported = $3;
   WICRAWROTATIONCAPABILITIES_FORCE_DWORD = $7FFFFFFF;

Type
   WICRawCapabilitiesInfo = Record
      cbSize: UINT;
      CodecMajorVersion: UINT;
      CodecMinorVersion: UINT;
      ExposureCompensationSupport: WICRawCapabilities;
      ContrastSupport: WICRawCapabilities;
      RGBWhitePointSupport: WICRawCapabilities;
      NamedWhitePointSupport: WICRawCapabilities;
      NamedWhitePointSupportMask: UINT;
      KelvinWhitePointSupport: WICRawCapabilities;
      GammaSupport: WICRawCapabilities;
      TintSupport: WICRawCapabilities;
      SaturationSupport: WICRawCapabilities;
      SharpnessSupport: WICRawCapabilities;
      NoiseReductionSupport: WICRawCapabilities;
      DestinationColorProfileSupport: WICRawCapabilities;
      ToneCurveSupport: WICRawCapabilities;
      RotationSupport: WICRawRotationCapabilities;
      RenderModeSupport: WICRawCapabilities;
   End;

Type
   WICRawParameterSet = Type Integer;

Const
   WICAsShotParameterSet = $1;
   WICUserAdjustedParameterSet = $2;
   WICAutoAdjustedParameterSet = $3;
   WICRAWPARAMETERSET_FORCE_DWORD = $7FFFFFFF;

Type
   WICRawRenderMode = Type Integer;

Const
   WICRawRenderModeDraft = $1;
   WICRawRenderModeNormal = $2;
   WICRawRenderModeBestQuality = $3;
   WICRAWRENDERMODE_FORCE_DWORD = $7FFFFFFF;

Type
   WICRawToneCurvePoint = Record
      Input: Double;
      Output: Double;
   End;

   WICRawToneCurve = Record
      cPoints: UINT;
      apoints: Array[0..0] Of WICRawToneCurvePoint;
   End;
   TWICRawToneCurve = WICRawToneCurve;
   PWICRawToneCurve = ^TWICRawToneCurve;

Const
   WICRawChangeNotification_ExposureCompensation = $00000001;
   WICRawChangeNotification_NamedWhitePoint = $00000002;
   WICRawChangeNotification_KelvinWhitePoint = $00000004;
   WICRawChangeNotification_RGBWhitePoint = $00000008;
   WICRawChangeNotification_Contrast = $00000010;
   WICRawChangeNotification_Gamma = $00000020;
   WICRawChangeNotification_Sharpness = $00000040;
   WICRawChangeNotification_Saturation = $00000080;
   WICRawChangeNotification_Tint = $00000100;
   WICRawChangeNotification_NoiseReduction = $00000200;
   WICRawChangeNotification_DestinationColorContext = $00000400;
   WICRawChangeNotification_ToneCurve = $00000800;
   WICRawChangeNotification_Rotation = $00001000;
   WICRawChangeNotification_RenderMode = $00002000;

   { interface IWICDevelopRawNotificationCallback }
Type
   IWICDevelopRawNotificationCallback = Interface(IUnknown)
      [SID_IWICDevelopRawNotificationCallback]
      Function Notify(NotificationMask: UINT): HRESULT; Stdcall;
   End;

   { interface IWICDevelopRaw }
   IWICDevelopRaw = Interface(IWICBitmapFrameDecode)
      [SID_IWICDevelopRaw]
      Function QueryRawCapabilitiesInfo(Var pInfo: WICRawCapabilitiesInfo): HRESULT; Stdcall;
      Function LoadParameterSet(ParameterSet: WICRawParameterSet): HRESULT; Stdcall;
      Function GetCurrentParameterSet(out ppCurrentParameterSet: IUnknown): HRESULT; Stdcall;
      Function SetExposureCompensation(ev: Double): HRESULT; Stdcall;
      Function GetExposureCompensation(Var pEV: Double): HRESULT; Stdcall;
      Function SetWhitePointRGB(Red: UINT; Green: UINT; Blue: UINT): HRESULT; Stdcall;
      Function GetWhitePointRGB(Var pRed: UINT; Var pGreen: UINT; Var pBlue: UINT): HRESULT; Stdcall;
      Function SetNamedWhitePoint(WhitePoint: WICNamedWhitePoint): HRESULT; Stdcall;
      Function GetNamedWhitePoint(Var pWhitePoint: WICNamedWhitePoint): HRESULT; Stdcall;
      Function SetWhitePointKelvin(WhitePointKelvin: UINT): HRESULT; Stdcall;
      Function GetWhitePointKelvin(Var pWhitePointKelvin: UINT): HRESULT; Stdcall;
      Function GetKelvinRangeInfo(Var pMinKelvinTemp: UINT; Var pMaxKelvinTemp: UINT; Var pKelvinTempStepValue: UINT): HRESULT; Stdcall;
      Function SetContrast(Contrast: Double): HRESULT; Stdcall;
      Function GetContrast(Var pContrast: Double): HRESULT; Stdcall;
      Function SetGamma(Gamma: Double): HRESULT; Stdcall;
      Function GetGamma(Var pGamma: Double): HRESULT; Stdcall;
      Function SetSharpness(Sharpness: Double): HRESULT; Stdcall;
      Function GetSharpness(Var pSharpness: Double): HRESULT; Stdcall;
      Function SetSaturation(Saturation: Double): HRESULT; Stdcall;
      Function GetSaturation(Var pSaturation: Double): HRESULT; Stdcall;
      Function SetTint(Tint: Double): HRESULT; Stdcall;
      Function GetTint(Var pTint: Double): HRESULT; Stdcall;
      Function SetNoiseReduction(NoiseReduction: Double): HRESULT; Stdcall;
      Function GetNoiseReduction(Var pNoiseReduction: Double): HRESULT; Stdcall;
      Function SetDestinationColorContext(pColorContext: IWICColorContext): HRESULT; Stdcall;
      Function SetToneCurve(cbToneCurveSize: UINT; pToneCurve: PWICRawToneCurve): HRESULT; Stdcall;
      Function GetToneCurve(cbToneCurveBufferSize: UINT; pToneCurve: PWICRawToneCurve; Var pcbActualToneCurveBufferSize: UINT): HRESULT; Stdcall;
      Function SetRotation(Rotation: Double): HRESULT; Stdcall;
      Function GetRotation(Var pRotation: Double): HRESULT; Stdcall;
      Function SetRenderMode(RenderMode: WICRawRenderMode): HRESULT; Stdcall;
      Function GetRenderMode(Var pRenderMode: WICRawRenderMode): HRESULT; Stdcall;
      Function SetNotificationCallback(pCallback: IWICDevelopRawNotificationCallback): HRESULT; Stdcall;
   End;


Implementation

End.
