#include "wincodecs_private.h"
+#include <shlwapi.h>
+
/***********************************************************************
* interface for self-registering
*/
*/
static const WCHAR clsid_keyname[] = {
'C', 'L', 'S', 'I', 'D', 0 };
-static const WCHAR curver_keyname[] = {
- 'C', 'u', 'r', 'V', 'e', 'r', 0 };
-static const WCHAR ips_keyname[] = {
- 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
- 0 };
-static const WCHAR ips32_keyname[] = {
- 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
- '3', '2', 0 };
-static const WCHAR progid_keyname[] = {
- 'P', 'r', 'o', 'g', 'I', 'D', 0 };
-static const WCHAR viprogid_keyname[] = {
- 'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
- 'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
- 0 };
-static const char tmodel_valuename[] = "ThreadingModel";
static const char author_valuename[] = "Author";
static const char friendlyname_valuename[] = "FriendlyName";
static const WCHAR vendor_valuename[] = {'V','e','n','d','o','r',0};
&GUID_WICPixelFormatBlackWhite,
&GUID_WICPixelFormat4bppGray,
&GUID_WICPixelFormat8bppGray,
+ &GUID_WICPixelFormat16bppGray,
+ &GUID_WICPixelFormat32bppGrayFloat,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
&GUID_WICPixelFormat4bppIndexed,
&GUID_WICPixelFormat8bppIndexed,
&GUID_WICPixelFormat24bppBGR,
&GUID_WICPixelFormat48bppRGB,
&GUID_WICPixelFormat64bppRGBA,
&GUID_WICPixelFormat64bppPRGBA,
+ &GUID_WICPixelFormat32bppCMYK,
+ &GUID_WICPixelFormat64bppCMYK,
+ &GUID_WICPixelFormat128bppRGBAFloat,
NULL
};
&GUID_WICPixelFormat16bppBGR565,
&GUID_WICPixelFormat24bppBGR,
&GUID_WICPixelFormat32bppBGR,
+ &GUID_WICPixelFormatBlackWhite,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
+ &GUID_WICPixelFormat4bppIndexed,
+ &GUID_WICPixelFormat8bppIndexed,
NULL
};
&GUID_WICPixelFormat32bppBGRA,
&GUID_WICPixelFormat48bppRGB,
&GUID_WICPixelFormat64bppRGBA,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
+ &GUID_WICPixelFormat4bppIndexed,
+ &GUID_WICPixelFormat8bppIndexed,
NULL
};
&GUID_WICPixelFormatBlackWhite,
&GUID_WICPixelFormat4bppGray,
&GUID_WICPixelFormat8bppGray,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
+ &GUID_WICPixelFormat4bppIndexed,
+ &GUID_WICPixelFormat8bppIndexed,
&GUID_WICPixelFormat24bppBGR,
&GUID_WICPixelFormat32bppBGRA,
&GUID_WICPixelFormat32bppPBGRA,
".bmp,.dib,.rle",
bmp_encode_formats
},
+ { &CLSID_WICGifEncoder,
+ "The Wine Project",
+ "GIF Encoder",
+ "1.0.0.0",
+ &GUID_VendorMicrosoft,
+ &GUID_ContainerFormatGif,
+ "image/gif",
+ ".gif",
+ gif_formats
+ },
{ &CLSID_WICJpegEncoder,
"The Wine Project",
"JPEG Encoder",
&GUID_WICPixelFormat24bppBGR,
&GUID_WICPixelFormat24bppRGB,
&GUID_WICPixelFormat32bppBGR,
+ &GUID_WICPixelFormat32bppRGB,
&GUID_WICPixelFormat32bppBGRA,
+ &GUID_WICPixelFormat32bppRGBA,
&GUID_WICPixelFormat32bppPBGRA,
+ &GUID_WICPixelFormat32bppPRGBA,
+ &GUID_WICPixelFormat32bppGrayFloat,
&GUID_WICPixelFormat48bppRGB,
&GUID_WICPixelFormat64bppRGBA,
&GUID_WICPixelFormat32bppCMYK,
{ NULL } /* list terminator */
};
+static const BYTE gAMA[] = "gAMA";
+
+static const struct metadata_pattern pnggama_metadata_pattern[] = {
+ { 4, 4, gAMA, mask_all, 4 },
+ { 0 }
+};
+
+static const struct reader_containers pnggama_containers[] = {
+ {
+ &GUID_ContainerFormatPng,
+ pnggama_metadata_pattern
+ },
+ { NULL } /* list terminator */
+};
+
+static const BYTE cHRM[] = "cHRM";
+
+static const struct metadata_pattern pngchrm_metadata_pattern[] = {
+ { 4, 4, cHRM, mask_all, 4 },
+ { 0 }
+};
+
+static const struct reader_containers pngchrm_containers[] = {
+ {
+ &GUID_ContainerFormatPng,
+ pngchrm_metadata_pattern
+ },
+ { NULL } /* list terminator */
+};
+
static const struct metadata_pattern lsd_metadata_patterns[] = {
{ 0, 6, gif87a_magic, mask_all, 0 },
{ 0, 6, gif89a_magic, mask_all, 0 },
1, 1, 0,
ifd_containers
},
+ { &CLSID_WICPngChrmMetadataReader,
+ "The Wine Project",
+ "Chunk cHRM Reader",
+ "1.0.0.0",
+ "1.0.0.0",
+ &GUID_VendorMicrosoft,
+ &GUID_MetadataFormatChunkcHRM,
+ 0, 0, 0,
+ pngchrm_containers
+ },
+ { &CLSID_WICPngGamaMetadataReader,
+ "The Wine Project",
+ "Chunk gAMA Reader",
+ "1.0.0.0",
+ "1.0.0.0",
+ &GUID_VendorMicrosoft,
+ &GUID_MetadataFormatChunkgAMA,
+ 0, 0, 0,
+ pnggama_containers
+ },
{ &CLSID_WICPngTextMetadataReader,
"The Wine Project",
"Chunk tEXt Reader",
static BYTE const channel_mask_16bit3[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
static BYTE const channel_mask_16bit4[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
+static BYTE const channel_mask_32bit[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 };
+
+static BYTE const channel_mask_128bit1[] = { 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
+static BYTE const channel_mask_128bit2[] = { 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
+static BYTE const channel_mask_128bit3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00 };
+static BYTE const channel_mask_128bit4[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff };
+
static BYTE const channel_mask_5bit[] = { 0x1f, 0x00 };
static BYTE const channel_mask_5bit2[] = { 0xe0, 0x03 };
static BYTE const channel_mask_5bit3[] = { 0x00, 0x7c };
static BYTE const * const channel_masks_16bit[] = { channel_mask_16bit,
channel_mask_16bit2, channel_mask_16bit3, channel_mask_16bit4};
+static BYTE const * const channel_masks_32bit[] = { channel_mask_32bit };
+static BYTE const * const channel_masks_128bit[] = { channel_mask_128bit1, channel_mask_128bit2, channel_mask_128bit3, channel_mask_128bit4 };
+
static BYTE const * const channel_masks_BGRA5551[] = { channel_mask_5bit,
channel_mask_5bit2, channel_mask_5bit3, channel_mask_5bit4 };
1, /* channel count */
channel_masks_1bit,
WICPixelFormatNumericRepresentationIndexed,
- 1
+ 0
},
{ &GUID_WICPixelFormat2bppIndexed,
"The Wine Project",
1, /* channel count */
channel_masks_2bit,
WICPixelFormatNumericRepresentationIndexed,
- 1
+ 0
},
{ &GUID_WICPixelFormat4bppIndexed,
"The Wine Project",
1, /* channel count */
channel_masks_4bit,
WICPixelFormatNumericRepresentationIndexed,
- 1
+ 0
},
{ &GUID_WICPixelFormat8bppIndexed,
"The Wine Project",
1, /* channel count */
channel_masks_8bit,
WICPixelFormatNumericRepresentationIndexed,
- 1
+ 0
},
{ &GUID_WICPixelFormatBlackWhite,
"The Wine Project",
WICPixelFormatNumericRepresentationUnsignedInteger,
0
},
+ { &GUID_WICPixelFormat32bppRGB,
+ "The Wine Project",
+ "32bpp RGB",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 32, /* bitsperpixel */
+ 3, /* channel count */
+ channel_masks_8bit,
+ WICPixelFormatNumericRepresentationUnsignedInteger,
+ 0
+ },
{ &GUID_WICPixelFormat32bppBGRA,
"The Wine Project",
"32bpp BGRA",
WICPixelFormatNumericRepresentationUnsignedInteger,
1
},
+ { &GUID_WICPixelFormat32bppRGBA,
+ "The Wine Project",
+ "32bpp RGBA",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 32, /* bitsperpixel */
+ 4, /* channel count */
+ channel_masks_8bit,
+ WICPixelFormatNumericRepresentationUnsignedInteger,
+ 1
+ },
{ &GUID_WICPixelFormat32bppPBGRA,
"The Wine Project",
"32bpp PBGRA",
WICPixelFormatNumericRepresentationUnsignedInteger,
1
},
+ { &GUID_WICPixelFormat32bppPRGBA,
+ "The Wine Project",
+ "32bpp PRGBA",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 32, /* bitsperpixel */
+ 4, /* channel count */
+ channel_masks_8bit,
+ WICPixelFormatNumericRepresentationUnsignedInteger,
+ 1
+ },
+ { &GUID_WICPixelFormat32bppGrayFloat,
+ "The Wine Project",
+ "32bpp GrayFloat",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 32, /* bitsperpixel */
+ 1, /* channel count */
+ channel_masks_32bit,
+ WICPixelFormatNumericRepresentationFloat,
+ 0
+ },
{ &GUID_WICPixelFormat48bppRGB,
"The Wine Project",
"48bpp RGB",
WICPixelFormatNumericRepresentationUnsignedInteger,
0
},
+ { &GUID_WICPixelFormat64bppCMYK,
+ "The Wine Project",
+ "64bpp CMYK",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 64, /* bitsperpixel */
+ 4, /* channel count */
+ channel_masks_16bit,
+ WICPixelFormatNumericRepresentationUnsignedInteger,
+ 0
+ },
+ { &GUID_WICPixelFormat128bppRGBAFloat,
+ "The Wine Project",
+ "128bpp RGBAFloat",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 128, /* bitsperpixel */
+ 4, /* channel count */
+ channel_masks_128bit,
+ WICPixelFormatNumericRepresentationFloat,
+ 1
+ },
{ NULL } /* list terminator */
};