JXRGlue.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. //*@@@+++@@@@******************************************************************
  2. //
  3. // Copyright © Microsoft Corp.
  4. // All rights reserved.
  5. //
  6. // Redistribution and use in source and binary forms, with or without
  7. // modification, are permitted provided that the following conditions are met:
  8. //
  9. // • Redistributions of source code must retain the above copyright notice,
  10. // this list of conditions and the following disclaimer.
  11. // • Redistributions in binary form must reproduce the above copyright notice,
  12. // this list of conditions and the following disclaimer in the documentation
  13. // and/or other materials provided with the distribution.
  14. //
  15. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  19. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  20. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  21. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  22. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  23. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  24. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  25. // POSSIBILITY OF SUCH DAMAGE.
  26. //
  27. //*@@@---@@@@******************************************************************
  28. #pragma once
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #include <JXRMeta.h>
  33. #include <guiddef.h>
  34. //================================================================
  35. #define WMP_SDK_VERSION 0x0101
  36. #define PK_SDK_VERSION 0x0101
  37. #define sizeof2(array) (sizeof(array)/sizeof(*(array)))
  38. #ifndef max
  39. #define max(a,b) ((a) > (b) ? (a) : (b))
  40. #endif
  41. #ifndef min
  42. #define min(b,a) ((a) < (b) ? (a) : (b))
  43. #endif
  44. #ifdef __ANSI__
  45. #define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strncpy((pszDest), (pszSrc), (cbDest)) == (pszDest) ? 0 : 1)
  46. #else
  47. #define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strcpy_s((pszDest), (cbDest), (pszSrc)))
  48. #endif // __ANSI__
  49. //================================================================
  50. typedef struct tagPKRect
  51. {
  52. I32 X;
  53. I32 Y;
  54. I32 Width;
  55. I32 Height;
  56. } PKRect;
  57. //================================================================
  58. typedef U32 PKIID;
  59. EXTERN_C const PKIID IID_PKImageScanEncode;
  60. EXTERN_C const PKIID IID_PKImageFrameEncode;
  61. EXTERN_C const PKIID IID_PKImageWmpEncode;
  62. EXTERN_C const PKIID IID_PKImageWmpDecode;
  63. struct IFDEntry
  64. {
  65. U16 uTag;
  66. U16 uType;
  67. U32 uCount;
  68. U32 uValue;
  69. };
  70. EXTERN_C const U32 IFDEntryTypeSizes[13];
  71. EXTERN_C const U32 SizeofIFDEntry;
  72. //================================================================
  73. typedef float Float;
  74. typedef enum tagPKStreamFlags
  75. {
  76. PKStreamOpenRead = 0x00000000UL,
  77. PKStreamOpenWrite = 0x00000001UL,
  78. PKStreamOpenReadWrite = 0x00000002UL,
  79. PKStreamNoLock = 0x00010000UL,
  80. PKStreamNoSeek = 0x00020000UL,
  81. PKStreamCompress = 0x00040000UL,
  82. } PKStreamFlags;
  83. /* Undefined formats */
  84. #define GUID_PKPixelFormatUndefined GUID_PKPixelFormatDontCare
  85. DEFINE_GUID(GUID_PKPixelFormatDontCare, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x00);
  86. /* Indexed formats */
  87. //DEFINE_GUID(GUID_PKPixelFormat1bppIndexed, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x01);
  88. //DEFINE_GUID(GUID_PKPixelFormat2bppIndexed, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x02);
  89. //DEFINE_GUID(GUID_PKPixelFormat4bppIndexed, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x03);
  90. //DEFINE_GUID(GUID_PKPixelFormat8bppIndexed, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x04);
  91. DEFINE_GUID(GUID_PKPixelFormatBlackWhite, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x05);
  92. //DEFINE_GUID(GUID_PKPixelFormat2bppGray, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x06);
  93. //DEFINE_GUID(GUID_PKPixelFormat4bppGray, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x07);
  94. DEFINE_GUID(GUID_PKPixelFormat8bppGray, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x08);
  95. /* sRGB formats (gamma is approx. 2.2) */
  96. /* For a full definition, see the sRGB spec */
  97. /* 16bpp formats */
  98. DEFINE_GUID(GUID_PKPixelFormat16bppRGB555, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x09);
  99. DEFINE_GUID(GUID_PKPixelFormat16bppRGB565, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0a);
  100. DEFINE_GUID(GUID_PKPixelFormat16bppGray, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0b);
  101. /* 24bpp formats */
  102. DEFINE_GUID(GUID_PKPixelFormat24bppBGR, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0c);
  103. DEFINE_GUID(GUID_PKPixelFormat24bppRGB, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0d);
  104. /* 32bpp format */
  105. DEFINE_GUID(GUID_PKPixelFormat32bppBGR, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0e);
  106. DEFINE_GUID(GUID_PKPixelFormat32bppBGRA, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0f);
  107. DEFINE_GUID(GUID_PKPixelFormat32bppPBGRA, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x10);
  108. DEFINE_GUID(GUID_PKPixelFormat32bppGrayFloat, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x11);
  109. DEFINE_GUID(GUID_PKPixelFormat32bppRGB, 0xd98c6b95, 0x3efe, 0x47d6, 0xbb, 0x25, 0xeb, 0x17, 0x48, 0xab, 0x0c, 0xf1);
  110. DEFINE_GUID(GUID_PKPixelFormat32bppRGBA, 0xf5c7ad2d, 0x6a8d, 0x43dd, 0xa7, 0xa8, 0xa2, 0x99, 0x35, 0x26, 0x1a, 0xe9);
  111. DEFINE_GUID(GUID_PKPixelFormat32bppPRGBA, 0x3cc4a650, 0xa527, 0x4d37, 0xa9, 0x16, 0x31, 0x42, 0xc7, 0xeb, 0xed, 0xba);
  112. /* 48bpp format */
  113. DEFINE_GUID(GUID_PKPixelFormat48bppRGBFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x12);
  114. /* scRGB formats. Gamma is 1.0 */
  115. /* For a full definition, see the scRGB spec */
  116. /* 16bpp format */
  117. DEFINE_GUID(GUID_PKPixelFormat16bppGrayFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x13);
  118. /* 32bpp format */
  119. DEFINE_GUID(GUID_PKPixelFormat32bppRGB101010, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x14);
  120. /* 48bpp format */
  121. DEFINE_GUID(GUID_PKPixelFormat48bppRGB, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x15);
  122. /* 64bpp format */
  123. DEFINE_GUID(GUID_PKPixelFormat64bppRGBA, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x16);
  124. DEFINE_GUID(GUID_PKPixelFormat64bppPRGBA, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x17);
  125. /* 96bpp format */
  126. DEFINE_GUID(GUID_PKPixelFormat96bppRGBFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x18);
  127. DEFINE_GUID(GUID_PKPixelFormat96bppRGBFloat, 0xe3fed78f, 0xe8db, 0x4acf, 0x84, 0xc1, 0xe9, 0x7f, 0x61, 0x36, 0xb3, 0x27);
  128. /* Floating point scRGB formats */
  129. DEFINE_GUID(GUID_PKPixelFormat128bppRGBAFloat, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x19);
  130. DEFINE_GUID(GUID_PKPixelFormat128bppPRGBAFloat, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1a);
  131. DEFINE_GUID(GUID_PKPixelFormat128bppRGBFloat, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1b);
  132. /* CMYK formats. */
  133. DEFINE_GUID(GUID_PKPixelFormat32bppCMYK, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1c);
  134. /* Photon formats */
  135. DEFINE_GUID(GUID_PKPixelFormat64bppRGBAFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1d);
  136. DEFINE_GUID(GUID_PKPixelFormat64bppRGBFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x40);
  137. DEFINE_GUID(GUID_PKPixelFormat128bppRGBAFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1e);
  138. DEFINE_GUID(GUID_PKPixelFormat128bppRGBFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x41);
  139. DEFINE_GUID(GUID_PKPixelFormat64bppRGBAHalf, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3a);
  140. DEFINE_GUID(GUID_PKPixelFormat64bppRGBHalf, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x42);
  141. DEFINE_GUID(GUID_PKPixelFormat48bppRGBHalf, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3b);
  142. DEFINE_GUID(GUID_PKPixelFormat32bppRGBE, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3d);
  143. DEFINE_GUID(GUID_PKPixelFormat16bppGrayHalf, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3e);
  144. DEFINE_GUID(GUID_PKPixelFormat32bppGrayFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3f);
  145. /* More CMYK formats and n-Channel formats */
  146. DEFINE_GUID(GUID_PKPixelFormat64bppCMYK, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1f);
  147. DEFINE_GUID(GUID_PKPixelFormat24bpp3Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x20);
  148. DEFINE_GUID(GUID_PKPixelFormat32bpp4Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x21);
  149. DEFINE_GUID(GUID_PKPixelFormat40bpp5Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x22);
  150. DEFINE_GUID(GUID_PKPixelFormat48bpp6Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x23);
  151. DEFINE_GUID(GUID_PKPixelFormat56bpp7Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x24);
  152. DEFINE_GUID(GUID_PKPixelFormat64bpp8Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x25);
  153. DEFINE_GUID(GUID_PKPixelFormat48bpp3Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x26);
  154. DEFINE_GUID(GUID_PKPixelFormat64bpp4Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x27);
  155. DEFINE_GUID(GUID_PKPixelFormat80bpp5Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x28);
  156. DEFINE_GUID(GUID_PKPixelFormat96bpp6Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x29);
  157. DEFINE_GUID(GUID_PKPixelFormat112bpp7Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2a);
  158. DEFINE_GUID(GUID_PKPixelFormat128bpp8Channels, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2b);
  159. DEFINE_GUID(GUID_PKPixelFormat40bppCMYKAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2c);
  160. DEFINE_GUID(GUID_PKPixelFormat80bppCMYKAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2d);
  161. DEFINE_GUID(GUID_PKPixelFormat32bpp3ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2e);
  162. DEFINE_GUID(GUID_PKPixelFormat40bpp4ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2f);
  163. DEFINE_GUID(GUID_PKPixelFormat48bpp5ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x30);
  164. DEFINE_GUID(GUID_PKPixelFormat56bpp6ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x31);
  165. DEFINE_GUID(GUID_PKPixelFormat64bpp7ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x32);
  166. DEFINE_GUID(GUID_PKPixelFormat72bpp8ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x33);
  167. DEFINE_GUID(GUID_PKPixelFormat64bpp3ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x34);
  168. DEFINE_GUID(GUID_PKPixelFormat80bpp4ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x35);
  169. DEFINE_GUID(GUID_PKPixelFormat96bpp5ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x36);
  170. DEFINE_GUID(GUID_PKPixelFormat112bpp6ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x37);
  171. DEFINE_GUID(GUID_PKPixelFormat128bpp7ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x38);
  172. DEFINE_GUID(GUID_PKPixelFormat144bpp8ChannelsAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x39);
  173. /* YCrCb from Advanced Profile */
  174. DEFINE_GUID(GUID_PKPixelFormat12bppYCC420, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x44);
  175. DEFINE_GUID(GUID_PKPixelFormat16bppYCC422, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x45);
  176. DEFINE_GUID(GUID_PKPixelFormat20bppYCC422, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x46);
  177. DEFINE_GUID(GUID_PKPixelFormat32bppYCC422, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x47);
  178. DEFINE_GUID(GUID_PKPixelFormat24bppYCC444, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x48);
  179. DEFINE_GUID(GUID_PKPixelFormat30bppYCC444, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x49);
  180. DEFINE_GUID(GUID_PKPixelFormat48bppYCC444, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x4a);
  181. DEFINE_GUID(GUID_PKPixelFormat16bpp48bppYCC444FixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x4b);
  182. DEFINE_GUID(GUID_PKPixelFormat20bppYCC420Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x4c);
  183. DEFINE_GUID(GUID_PKPixelFormat24bppYCC422Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x4d);
  184. DEFINE_GUID(GUID_PKPixelFormat30bppYCC422Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x4e);
  185. DEFINE_GUID(GUID_PKPixelFormat48bppYCC422Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x4f);
  186. DEFINE_GUID(GUID_PKPixelFormat32bppYCC444Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x50);
  187. DEFINE_GUID(GUID_PKPixelFormat40bppYCC444Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x51);
  188. DEFINE_GUID(GUID_PKPixelFormat64bppYCC444Alpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x52);
  189. DEFINE_GUID(GUID_PKPixelFormat64bppYCC444AlphaFixedPoint, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x53);
  190. //YUV
  191. #define GUID_PKPixelFormat12bppYUV420 GUID_PKPixelFormat12bppYCC420
  192. #define GUID_PKPixelFormat16bppYUV422 GUID_PKPixelFormat16bppYCC422
  193. #define GUID_PKPixelFormat24bppYUV444 GUID_PKPixelFormat24bppYCC444
  194. /* CMYKDIRECT from Advanced Profile */
  195. DEFINE_GUID(GUID_PKPixelFormat32bppCMYKDIRECT, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x54);
  196. DEFINE_GUID(GUID_PKPixelFormat64bppCMYKDIRECT, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x55);
  197. DEFINE_GUID(GUID_PKPixelFormat40bppCMYKDIRECTAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x56);
  198. DEFINE_GUID(GUID_PKPixelFormat80bppCMYKDIRECTAlpha, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x43);
  199. // PhotometricInterpretation
  200. #define PK_PI_W0 0 // WhiteIsZero
  201. #define PK_PI_B0 1 // BlackIsZero
  202. #define PK_PI_RGB 2
  203. #define PK_PI_RGBPalette 3
  204. #define PK_PI_TransparencyMask 4
  205. #define PK_PI_CMYK 5
  206. #define PK_PI_YCbCr 6
  207. #define PK_PI_CIELab 8
  208. #define PK_PI_NCH 100
  209. #define PK_PI_RGBE 101
  210. #define PK_pixfmtNul 0x00000000
  211. #define PK_pixfmtHasAlpha 0x00000010
  212. #define PK_pixfmtPreMul 0x00000020
  213. #define PK_pixfmtBGR 0x00000040
  214. #define PK_pixfmtNeedConvert 0x80000000
  215. #define LOOKUP_FORWARD 0
  216. #define LOOKUP_BACKWARD_TIF 1
  217. typedef unsigned long WMP_GRBIT;
  218. typedef GUID PKPixelFormatGUID;
  219. typedef struct tagPKPixelInfo
  220. {
  221. const PKPixelFormatGUID* pGUIDPixFmt;
  222. size_t cChannel;
  223. COLORFORMAT cfColorFormat;
  224. BITDEPTH_BITS bdBitDepth;
  225. U32 cbitUnit;
  226. WMP_GRBIT grBit;
  227. // TIFF
  228. U32 uInterpretation;
  229. U32 uSamplePerPixel;
  230. U32 uBitsPerSample;
  231. U32 uSampleFormat;
  232. } PKPixelInfo;
  233. //================================================================
  234. ERR PKAlloc(void** ppv, size_t cb);
  235. ERR PKFree(void** ppv);
  236. //----------------------------------------------------------------
  237. //ERR GetPixelInfo(PKPixelFormatGUID enPixelFormat, const PKPixelInfo** ppPI);
  238. ERR PixelFormatLookup(PKPixelInfo* pPI, U8 uLookupType);
  239. const PKPixelFormatGUID* GetPixelFormatFromHash(const U8 uPFHash);
  240. ERR GetImageEncodeIID(const char* szExt, const PKIID** ppIID);
  241. ERR GetImageDecodeIID(const char* szExt, const PKIID** ppIID);
  242. //================================================================
  243. #ifdef __ANSI__
  244. struct tagPKFactory;
  245. struct tagPKCodecFactory;
  246. struct tagPKImageDecode;
  247. struct tagPKImageEncode;
  248. struct tagPKFormatConverter;
  249. #define PKFactory struct tagPKFactory
  250. #define PKCodecFactory struct tagPKCodecFactory
  251. #define PKImageDecode struct tagPKImageDecode
  252. #define PKImageEncode struct tagPKImageEncode
  253. #define PKFormatConverter struct tagPKFormatConverter
  254. #else // __ANSI__
  255. typedef struct tagPKFactory PKFactory;
  256. typedef struct tagPKCodecFactory PKCodecFactory;
  257. typedef struct tagPKImageDecode PKImageDecode;
  258. typedef struct tagPKImageEncode PKImageEncode;
  259. typedef struct tagPKFormatConverter PKFormatConverter;
  260. #endif // __ANSI__
  261. //================================================================
  262. typedef struct tagPKStream
  263. {
  264. ERR (*InitializeFromFilename)(const char*, ULong);
  265. ERR (*Release)(void);
  266. FILE* fp;
  267. } PKStream;
  268. //================================================================
  269. typedef struct tagPKFactory
  270. {
  271. ERR (*CreateStream)(PKStream**);
  272. ERR (*CreateStreamFromFilename)(struct WMPStream**, const char*, const char*);
  273. ERR (*CreateStreamFromMemory)(struct WMPStream**, void*, size_t);
  274. ERR (*Release)(PKFactory**);
  275. #ifdef __ANSI__
  276. #undef PKFactory
  277. #endif // __ANSI__
  278. } PKFactory;
  279. //----------------------------------------------------------------
  280. ERR PKCreateFactory_CreateStream(PKStream** ppStream);
  281. ERR PKCreateFactory_Release(PKFactory** ppFactory);
  282. EXTERN_C ERR PKCreateFactory(PKFactory**, U32);
  283. //================================================================
  284. typedef struct tagPKCodecFactory
  285. {
  286. ERR (*CreateCodec)(const PKIID*, void**);
  287. ERR (*CreateDecoderFromFile)(const char*, PKImageDecode**);
  288. ERR (*CreateFormatConverter)(PKFormatConverter**);
  289. ERR (*Release)(PKCodecFactory**);
  290. #ifdef __ANSI__
  291. #undef PKCodecFactory
  292. #endif // __ANSI__
  293. } PKCodecFactory;
  294. //----------------------------------------------------------------
  295. ERR PKCodecFactory_CreateCodec(const PKIID* iid, void** ppv);
  296. ERR PKCreateCodecFactory_Release(PKCodecFactory** ppCFactory);
  297. EXTERN_C ERR PKCreateCodecFactory(PKCodecFactory**, U32);
  298. //================================================================
  299. typedef enum BANDEDENCSTATE
  300. {
  301. BANDEDENCSTATE_UNINITIALIZED = 0,
  302. BANDEDENCSTATE_INIT,
  303. BANDEDENCSTATE_ENCODING,
  304. BANDEDENCSTATE_TERMINATED,
  305. BANDEDENCSTATE_NONBANDEDENCODE,
  306. } BANDEDENCSTATE;
  307. typedef struct tagPKImageEncode
  308. {
  309. //ERR (*GetPixelFormat)(MILPixelFormat*));
  310. ERR (*Initialize)(PKImageEncode*, struct WMPStream*, void*, size_t);
  311. ERR (*Terminate)(PKImageEncode*);
  312. ERR (*SetPixelFormat)(PKImageEncode*, PKPixelFormatGUID);
  313. ERR (*SetSize)(PKImageEncode*, I32, I32);
  314. ERR (*SetResolution)(PKImageEncode*, Float, Float);
  315. ERR (*SetColorContext)(PKImageEncode *pIE, const U8 *pbColorContext,
  316. U32 cbColorContext);
  317. ERR (*SetDescriptiveMetadata)(PKImageEncode *pIE,
  318. const DESCRIPTIVEMETADATA *pDescMetadata);
  319. ERR (*WritePixels)(PKImageEncode*, U32, U8*, U32);
  320. ERR (*WriteSource)(PKImageEncode*, PKFormatConverter*, PKRect*);
  321. // Banded encode API - currently only implemented for WMP encoder
  322. ERR (*WritePixelsBandedBegin)(PKImageEncode* pEncoder, struct WMPStream *pPlanarAlphaTempFile);
  323. ERR (*WritePixelsBanded)(PKImageEncode* pEncoder, U32 cLines, U8* pbPixels, U32 cbStride, Bool fLastCall);
  324. ERR (*WritePixelsBandedEnd)(PKImageEncode* pEncoder);
  325. #define TEMPFILE_COPYBUF_SIZE 8192 // Means when using tempfile for planar alpha banded encode, copy this many bytes at a time
  326. ERR (*Transcode)(PKImageEncode*, PKImageDecode*, CWMTranscodingParam*);
  327. ERR (*CreateNewFrame)(PKImageEncode*, void*, size_t);
  328. ERR (*Release)(PKImageEncode**);
  329. struct WMPStream* pStream;
  330. size_t offStart;
  331. PKPixelFormatGUID guidPixFormat;
  332. U32 uWidth;
  333. U32 uHeight;
  334. U32 idxCurrentLine;
  335. Float fResX;
  336. Float fResY;
  337. U32 cFrame;
  338. Bool fHeaderDone;
  339. size_t offPixel;
  340. size_t cbPixel;
  341. U8 *pbColorContext;
  342. U32 cbColorContext;
  343. U8 *pbEXIFMetadata;
  344. U32 cbEXIFMetadataByteCount;
  345. U8 *pbGPSInfoMetadata;
  346. U32 cbGPSInfoMetadataByteCount;
  347. U8 *pbIPTCNAAMetadata;
  348. U32 cbIPTCNAAMetadataByteCount;
  349. U8 *pbXMPMetadata;
  350. U32 cbXMPMetadataByteCount;
  351. U8 *pbPhotoshopMetadata;
  352. U32 cbPhotoshopMetadataByteCount;
  353. DESCRIPTIVEMETADATA sDescMetadata;
  354. Bool bWMP;//for the encoder in decoding
  355. struct
  356. {
  357. WmpDEMisc wmiDEMisc;
  358. CWMImageInfo wmiI;
  359. CWMIStrCodecParam wmiSCP;
  360. CTXSTRCODEC ctxSC;
  361. CWMImageInfo wmiI_Alpha;
  362. CWMIStrCodecParam wmiSCP_Alpha;
  363. CTXSTRCODEC ctxSC_Alpha;
  364. Bool bHasAlpha;
  365. Long nOffImage;
  366. Long nCbImage;
  367. Long nOffAlpha;
  368. Long nCbAlpha;
  369. ORIENTATION oOrientation;
  370. // Banded encode state variables
  371. BANDEDENCSTATE eBandedEncState;
  372. struct WMPStream *pPATempFile;
  373. } WMP;
  374. #ifdef __ANSI__
  375. #undef PKImageEncode
  376. #endif // __ANSI__
  377. } PKImageEncode;
  378. //----------------------------------------------------------------
  379. ERR PKImageEncode_Create_WMP(PKImageEncode** ppIE);
  380. ERR PKImageEncode_Initialize(PKImageEncode* pIE, struct WMPStream* pStream, void* pvParam, size_t cbParam);
  381. ERR PKImageEncode_Terminate(PKImageEncode* pIE);
  382. ERR PKImageEncode_SetPixelFormat(PKImageEncode* pIE, PKPixelFormatGUID enPixelFormat);
  383. ERR PKImageEncode_SetSize(PKImageEncode* pIE, I32 iWidth, I32 iHeight);
  384. ERR PKImageEncode_SetResolution(PKImageEncode* pIE, Float rX, Float rY);
  385. ERR PKImageEncode_SetColorContext(PKImageEncode *pIE, const U8 *pbColorContext, U32 cbColorContext);
  386. ERR PKImageEncode_SetDescriptiveMetadata(PKImageEncode *pIE, const DESCRIPTIVEMETADATA *pDescMetadata);
  387. ERR PKImageEncode_WritePixels(PKImageEncode* pIE, U32 cLine, U8* pbPixel, U32 cbStride);
  388. ERR PKImageEncode_CreateNewFrame(PKImageEncode* pIE, void* pvParam, size_t cbParam);
  389. ERR PKImageEncode_Release(PKImageEncode** ppIE);
  390. ERR PKImageEncode_SetXMPMetadata_WMP(PKImageEncode *pIE, const U8 *pbXMPMetadata, U32 cbXMPMetadata);
  391. ERR PKImageEncode_SetEXIFMetadata_WMP(PKImageEncode *pIE, const U8 *pbEXIFMetadata, U32 cbEXIFMetadata);
  392. ERR PKImageEncode_SetGPSInfoMetadata_WMP(PKImageEncode *pIE, const U8 *pbGPSInfoMetadata, U32 cbGPSInfoMetadata);
  393. ERR PKImageEncode_SetIPTCNAAMetadata_WMP(PKImageEncode *pIE, const U8 *pbIPTCNAAMetadata, U32 cbIPTCNAAMetadata);
  394. ERR PKImageEncode_SetPhotoshopMetadata_WMP(PKImageEncode *pIE, const U8 *pbPhotoshopMetadata, U32 cbPhotoshopMetadata);
  395. void FreeDescMetadata(DPKPROPVARIANT *pvar);
  396. ERR PKImageEncode_Create(PKImageEncode** ppIE);
  397. //================================================================
  398. typedef struct tagPKImageDecode
  399. {
  400. ERR (*Initialize)(PKImageDecode*, struct WMPStream* pStream);
  401. ERR (*GetPixelFormat)(PKImageDecode*, PKPixelFormatGUID*);
  402. ERR (*GetSize)(PKImageDecode*, I32*, I32*);
  403. ERR (*GetResolution)(PKImageDecode*, Float*, Float*);
  404. ERR (*GetColorContext)(PKImageDecode *pID, U8 *pbColorContext,
  405. U32 *pcbColorContext);
  406. ERR (*GetDescriptiveMetadata)(PKImageDecode *pIE,
  407. DESCRIPTIVEMETADATA *pDescMetadata);
  408. ERR (*GetRawStream)(PKImageDecode*, struct WMPStream**);
  409. ERR (*Copy)(PKImageDecode*, const PKRect*, U8*, U32);
  410. ERR (*GetFrameCount)(PKImageDecode*, U32*);
  411. ERR (*SelectFrame)(PKImageDecode*, U32);
  412. ERR (*Release)(PKImageDecode**);
  413. struct WMPStream* pStream;
  414. Bool fStreamOwner;
  415. size_t offStart;
  416. PKPixelFormatGUID guidPixFormat;
  417. U32 uWidth;
  418. U32 uHeight;
  419. U32 idxCurrentLine;
  420. Float fResX;
  421. Float fResY;
  422. U32 cFrame;
  423. struct
  424. {
  425. WmpDEMisc wmiDEMisc;
  426. CWMImageInfo wmiI;
  427. CWMIStrCodecParam wmiSCP;
  428. CTXSTRCODEC ctxSC;
  429. CWMImageInfo wmiI_Alpha;
  430. CWMIStrCodecParam wmiSCP_Alpha;
  431. CTXSTRCODEC ctxSC_Alpha;
  432. Bool bHasAlpha;
  433. Long nOffImage;
  434. Long nCbImage;
  435. Long nOffAlpha;
  436. Long nCbAlpha;
  437. Bool bIgnoreOverlap;
  438. size_t DecoderCurrMBRow;
  439. size_t DecoderCurrAlphaMBRow;
  440. size_t cMarker;
  441. size_t cLinesDecoded;
  442. size_t cLinesCropped; // Lines may be cropped from the top - buffer for subsequent decodes must be adjusted
  443. Bool fFirstNonZeroDecode;
  444. Bool fOrientationFromContainer;
  445. ORIENTATION oOrientationFromContainer; // Tag 0xBC02 in HD Photo container
  446. DESCRIPTIVEMETADATA sDescMetadata;
  447. } WMP;
  448. #ifdef __ANSI__
  449. #undef PKImageDecode
  450. #endif // __ANSI__
  451. } PKImageDecode;
  452. //----------------------------------------------------------------
  453. ERR PKImageDecode_Create_WMP(PKImageDecode** ppID);
  454. ERR PKImageDecode_Initialize(PKImageDecode* pID, struct WMPStream* pStream);
  455. ERR PKImageDecode_GetPixelFormat(PKImageDecode* pID, PKPixelFormatGUID* pPF);
  456. ERR PKImageDecode_GetSize(PKImageDecode* pID, I32* piWidth, I32* piHeight);
  457. ERR PKImageDecode_GetResolution(PKImageDecode* pID, Float* pfrX, Float* pfrY);
  458. ERR PKImageDecode_GetColorContext(PKImageDecode *pID, U8 *pbColorContext, U32 *pcbColorContext);
  459. ERR PKImageDecode_GetDescriptiveMetadata(PKImageDecode *pID, DESCRIPTIVEMETADATA *pDescMetadata);
  460. ERR PKImageDecode_Copy(PKImageDecode* pID, const PKRect* pRect, U8* pb, U32 cbStride);
  461. ERR PKImageDecode_GetFrameCount(PKImageDecode* pID, U32* puCount);
  462. ERR PKImageDecode_SelectFrame(PKImageDecode* pID, U32 uFrame);
  463. ERR PKImageDecode_Release(PKImageDecode** ppID);
  464. ERR PKImageDecode_GetXMPMetadata_WMP(PKImageDecode *pID, U8 *pbXMPMetadata, U32 *pcbXMPMetadata);
  465. ERR PKImageDecode_GetEXIFMetadata_WMP(PKImageDecode *pID, U8 *pbEXIFMetadata, U32 *pcbEXIFMetadata);
  466. ERR PKImageDecode_GetGPSInfoMetadata_WMP(PKImageDecode *pID, U8 *pbGPSInfoMetadata, U32 *pcbGPSInfoMetadata);
  467. ERR PKImageDecode_GetIPTCNAAMetadata_WMP(PKImageDecode *pID, U8 *pbIPTCNAAMetadata, U32 *pcbIPTCNAAMetadata);
  468. ERR PKImageDecode_GetPhotoshopMetadata_WMP(PKImageDecode *pID, U8 *pbPhotoshopMetadata, U32 *pcbPhotoshopMetadata);
  469. ERR PKImageDecode_Create(PKImageDecode** ppID);
  470. ERR PKCodecFactory_CreateDecoderFromFile(const char* szFilename, PKImageDecode** ppDecoder);
  471. //================================================================
  472. typedef struct tagPKFormatConverter
  473. {
  474. ERR (*Initialize)(PKFormatConverter*, PKImageDecode*, char *pExt, PKPixelFormatGUID);
  475. ERR (*InitializeConvert)(PKFormatConverter* pFC, const PKPixelFormatGUID enPFFrom,
  476. char *pExt, PKPixelFormatGUID enPFTTo);
  477. ERR (*GetPixelFormat)(PKFormatConverter*, PKPixelFormatGUID*);
  478. ERR (*GetSourcePixelFormat)(PKFormatConverter*, PKPixelFormatGUID*);
  479. ERR (*GetSize)(PKFormatConverter*, I32*, I32*);
  480. ERR (*GetResolution)(PKFormatConverter*, Float*, Float*);
  481. ERR (*Copy)(PKFormatConverter*, const PKRect*, U8*, U32);
  482. ERR (*Convert)(PKFormatConverter*, const PKRect*, U8*, U32);
  483. ERR (*Release)(PKFormatConverter**);
  484. PKImageDecode* pDecoder;
  485. PKPixelFormatGUID enPixelFormat;
  486. #ifdef __ANSI__
  487. #undef PKFormatConverter
  488. #endif // __ANSI__
  489. } PKFormatConverter;
  490. //----------------------------------------------------------------
  491. ERR PKImageEncode_Transcode(PKImageEncode* pIE, PKFormatConverter* pFC, PKRect* pRect);
  492. ERR PKImageEncode_WriteSource(PKImageEncode* pIE, PKFormatConverter* pFC, PKRect* pRect);
  493. ERR PKFormatConverter_Initialize(PKFormatConverter* pFC, PKImageDecode* pID, char *pExt, PKPixelFormatGUID enPF);
  494. ERR PKFormatConverter_InitializeConvert(PKFormatConverter* pFC, const PKPixelFormatGUID enPFFrom,
  495. char *pExt, PKPixelFormatGUID enPFTo);
  496. ERR PKFormatConverter_GetPixelFormat(PKFormatConverter* pFC, PKPixelFormatGUID* pPF);
  497. ERR PKFormatConverter_GetSourcePixelFormat(PKFormatConverter* pFC, PKPixelFormatGUID* pPF);
  498. ERR PKFormatConverter_GetSize(PKFormatConverter* pFC, I32* piWidth, I32* piHeight);
  499. ERR PKFormatConverter_GetResolution(PKFormatConverter* pFC, Float* pfrX, Float* pfrY);
  500. ERR PKFormatConverter_Copy(PKFormatConverter* pFC, const PKRect* pRect, U8* pb, U32 cbStride);
  501. ERR PKFormatConverter_Convert(PKFormatConverter* pFC, const PKRect* pRect, U8* pb, U32 cbStride);
  502. ERR PKFormatConverter_Release(PKFormatConverter** ppFC);
  503. // Think of this as static member of PKFormatConverter "class"
  504. ERR PKFormatConverter_EnumConversions(const PKPixelFormatGUID *pguidSourcePF,
  505. const U32 iIndex,
  506. const PKPixelFormatGUID **ppguidTargetPF);
  507. ERR PKCodecFactory_CreateFormatConverter(PKFormatConverter** ppFConverter);
  508. //----------------------------------------------------------------
  509. ERR PKAlloc(void** ppv, size_t cb);
  510. ERR PKFree(void** ppv);
  511. ERR PKAllocAligned(void** ppv, size_t cb, size_t iAlign);
  512. ERR PKFreeAligned(void** ppv);
  513. #ifdef __cplusplus
  514. } // extern "C"
  515. #endif