Vincent Povirk : windowscodecs: Register the PNG decoder.

Alexandre Julliard julliard at winehq.org
Fri Aug 28 10:17:51 CDT 2009


Module: wine
Branch: master
Commit: 59810aa4f41da40cd09c46a6bf237545fa3d63df
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=59810aa4f41da40cd09c46a6bf237545fa3d63df

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Thu Aug 13 16:41:35 2009 -0500

windowscodecs: Register the PNG decoder.

---

 dlls/windowscodecs/regsvr.c |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index 12ef7d8..81218b9 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -777,7 +777,7 @@ static struct regsvr_coclass const coclass_list[] = {
 /***********************************************************************
  *		decoder list
  */
-static const BYTE mask_all[] = {0xff,0xff,0xff,0xff,0xff,0xff};
+static const BYTE mask_all[] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
 
 static const BYTE bmp_magic[] = {0x42,0x4d};
 
@@ -838,6 +838,30 @@ static struct decoder_pattern const jpeg_patterns[] = {
     {0}
 };
 
+static const BYTE png_magic[] = {137,80,78,71,13,10,26,10};
+
+static GUID const * const png_formats[] = {
+    &GUID_WICPixelFormatBlackWhite,
+    &GUID_WICPixelFormat2bppGray,
+    &GUID_WICPixelFormat4bppGray,
+    &GUID_WICPixelFormat8bppGray,
+    &GUID_WICPixelFormat16bppGray,
+    &GUID_WICPixelFormat32bppBGRA,
+    &GUID_WICPixelFormat64bppRGBA,
+    &GUID_WICPixelFormat1bppIndexed,
+    &GUID_WICPixelFormat2bppIndexed,
+    &GUID_WICPixelFormat4bppIndexed,
+    &GUID_WICPixelFormat8bppIndexed,
+    &GUID_WICPixelFormat24bppBGR,
+    &GUID_WICPixelFormat48bppRGB,
+    NULL
+};
+
+static struct decoder_pattern const png_patterns[] = {
+    {8,0,png_magic,mask_all,0},
+    {0}
+};
+
 static struct regsvr_decoder const decoder_list[] = {
     {   &CLSID_WICBmpDecoder,
 	"The Wine Project",
@@ -879,6 +903,16 @@ static struct regsvr_decoder const decoder_list[] = {
 	jpeg_formats,
 	jpeg_patterns
     },
+    {   &CLSID_WICPngDecoder,
+	"The Wine Project",
+	"PNG Decoder",
+	"1.0.0.0",
+	&GUID_VendorMicrosoft,
+	"image/png",
+	".png",
+	png_formats,
+	png_patterns
+    },
     { NULL }			/* list terminator */
 };
 




More information about the wine-cvs mailing list