' ########################################################################################
' Microsoft Windows
' File: ImgUtil.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
' ########################################################################################
' Library name: ImgUtilLib
' Version: 1.0, Locale ID = 0
' Documentation string: ImgUtil 1.0 Type Library
' Library GUID: {CF790840-2DC4-11D0-B724-00AA006C1A01}
' ########################################################################################
#IF NOT %DEF(PBX_ImgUtil_PBI)
#DEFINE PBX_ImgUtil_PBI
%EQUATE `IMGUTIL_INC = 1
$LIBID_ImgUtilLib = GUID$("{CF790840-2DC4-11D0-B724-00AA006C1A01}")
' ========================================================================================
' ProgIDs (Program identifiers)
' ========================================================================================
' CLSID = {A860CE50-3910-11D0-86FC-00A0C913F750}
$PROGID_CoDitherToRGB881 = "ImgUtil.CoDitherToRGB8.1"
' CLSID = {30C3B080-30FB-11D0-B724-00AA006C1A01}
$PROGID_CoMapMIMEToCLSID1 = "ImgUtil.CoMapMIMEToCLSID.1"
' CLSID = {6A01FDA0-30DF-11D0-B724-00AA006C1A01}
$PROGID_CoSniffStream1 = "ImgUtil.CoSniffStream.1"
' ========================================================================================
' ClsIDs (Class identifiers)
' ========================================================================================
$CLSID_CoDitherToRGB8 = GUID$("{A860CE50-3910-11D0-86FC-00A0C913F750}")
$CLSID_CoMapMIMEToCLSID = GUID$("{30C3B080-30FB-11D0-B724-00AA006C1A01}")
$CLSID_CoSniffStream = GUID$("{6A01FDA0-30DF-11D0-B724-00AA006C1A01}")
' ========================================================================================
' IIDs (Interface identifiers)
' ========================================================================================
$IID_ISniffStream = GUID$("{4EF17940-30E0-11D0-B724-00AA006C1A01}")
$IID_IDithererImpl = GUID$("{7C48E840-3910-11D0-86FC-00A0C913F750}")
'/* header files for imported files */
#INCLUDE ONCE "Legacy/System/ocmm.inc"
#INCLUDE ONCE "Legacy/System/ddraw.inc"
DECLARE FUNCTION CreateMIMEMap LIB "imgutil.dll" ALIAS "CreateMIMEMap" ( BYREF ppMap AS IMapMIMEToCLSID ) AS LONG
DECLARE FUNCTION DecodeImage LIB "imgutil.dll" ALIAS "DecodeImage" ( BYVAL pStream AS IStream
 , BYVAL pMap AS IMapMIMEToCLSID
 , BYVAL pEventSink AS IUnknown
 ) AS LONG
DECLARE FUNCTION SniffStream LIB "imgutil.dll" ALIAS "SniffStream" ( BYVAL pInStream AS IStream
 , BYREF pInStream AS DWORD
 , BYREF ppOutStream AS IUnknown
 ) AS LONG
DECLARE FUNCTION GetMaxMIMEIDBytes LIB "imgutil.dll" ALIAS "GetMaxMIMEIDBytes" ( BYREF pnMaxBytes AS DWORD
 ) AS LONG
DECLARE FUNCTION IdentifyMIMEType LIB "imgutil.dll" ALIAS "IdentifyMIMEType" ( BYVAL pbBytes AS BYTE PTR
 , BYVAL nBytes AS DWORD
 , BYREF pnFormat AS DWORD
 ) AS LONG
DECLARE FUNCTION ComputeInvCMAP LIB "imgutil.dll" ALIAS "ComputeInvCMAP" ( BYREF pRGBColors AS RGBQUAD
 , BYVAL nColors AS DWORD
 , BYVAL pInvTable AS BYTE PTR
 , BYVAL cbTable AS DWORD
 ) AS LONG
DECLARE FUNCTION DitherTo8 LIB "imgutil.dll" ALIAS "DitherTo8" ( BYVAL pDestBits AS BYTE PTR
 , BYVAL nDestPitch AS LONG
 , BYVAL pSrcBits AS BYTE PTR
 , BYVAL nSrcPitch AS LONG
 , BYREF bfidSrc AS GUID
 , BYREF prgbDestColors AS RGBQUAD
 , BYREF prgbSrcColors AS RGBQUAD
 , BYVAL pbDestInvMap AS BYTE PTR
 , BYVAL x AS LONG
 , BYVAL y AS LONG
 , BYVAL cx AS LONG
 , BYVAL cy AS LONG
 , BYVAL lDestTrans AS LONG
 , BYVAL lSrcTrans AS LONG
 ) AS LONG
DECLARE FUNCTION CreateDDrawSurfaceOnDIB LIB "imgutil.dll" ALIAS "CreateDDrawSurfaceOnDIB" ( BYVAL hbmDib AS DWORD
 , BYREF ppSurface AS IDirectDrawSurface
 ) AS LONG
DECLARE FUNCTION DecodeImageEx LIB "imgutil.dll" ALIAS "DecodeImageEx" ( BYVAL pStream AS IStream
 , BYVAL pMap AS IMapMIMEToCLSID
 , BYVAL pEventSink AS IUnknown
 , BYREF pszMIMETypeParam AS WSTRINGZ
 ) AS LONG
' ########################################################################################
' Interface name = ISniffStream
' IID = 4EF17940-30E0-11D0-B724-00AA006C1A01
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISniffStream_INTERFACE_DEFINED)
 %ISniffStream_INTERFACE_DEFINED = 1
INTERFACE ISniffStream $IID_ISniffStream
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Init ( ' VTable offset = 12
 BYVAL pStream AS IStream
 ) AS LONG
 ' =====================================================================================
 METHOD Peek ( ' VTable offset = 16
 BYVAL pBuffer AS DWORD
 , BYVAL nBytes AS DWORD
 , BYREF pnBytesRead AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISniffStream_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IDithererImpl
' IID = 7C48E840-3910-11D0-86FC-00A0C913F750
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IDithererImpl_INTERFACE_DEFINED)
 %IDithererImpl_INTERFACE_DEFINED = 1
INTERFACE IDithererImpl $IID_IDithererImpl
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetDestColorTable ( ' VTable offset = 12
 BYVAL nColors AS DWORD
 , BYREF prgbColors AS RGBQUAD
 ) AS LONG
 ' =====================================================================================
 METHOD SetEventSink ( ' VTable offset = 16
 BYVAL pEventSink AS IImageDecodeEventSink
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IDithererImpl_INTERFACE_DEFINED__ */
#ENDIF
