summaryrefslogtreecommitdiffstats
path: root/Src/png
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 14:54:57 +0200
committerJef <jef@targetspot.com>2024-09-24 14:54:57 +0200
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/png
parentAdding .gitignore (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar
winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.bz2
winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.lz
winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.xz
winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.zst
winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.zip
Diffstat (limited to 'Src/png')
-rw-r--r--Src/png/PNGLoader.cpp232
-rw-r--r--Src/png/PNGLoader.h27
-rw-r--r--Src/png/PNGWriter.cpp193
-rw-r--r--Src/png/PNGWriter.h21
-rw-r--r--Src/png/api__png.h12
-rw-r--r--Src/png/factory_png.cpp71
-rw-r--r--Src/png/factory_png.h25
-rw-r--r--Src/png/factory_pngwrite.cpp71
-rw-r--r--Src/png/factory_pngwrite.h25
-rw-r--r--Src/png/png.rc76
-rw-r--r--Src/png/png.sln54
-rw-r--r--Src/png/png.vcxproj302
-rw-r--r--Src/png/png.vcxproj.filters65
-rw-r--r--Src/png/png.xcodeproj/project.pbxproj278
-rw-r--r--Src/png/resource.h14
-rw-r--r--Src/png/version.rc239
-rw-r--r--Src/png/wa5_png.cpp54
-rw-r--r--Src/png/wa5_png.h15
-rw-r--r--Src/png/zlib.cpp59
19 files changed, 1633 insertions, 0 deletions
diff --git a/Src/png/PNGLoader.cpp b/Src/png/PNGLoader.cpp
new file mode 100644
index 000000000..5f5c6fbcd
--- /dev/null
+++ b/Src/png/PNGLoader.cpp
@@ -0,0 +1,232 @@
+#include "PNGLoader.h"
+#include "api__png.h"
+#include <png.h>
+#include <wchar.h>
+#include <malloc.h>
+#include <bfc/platform/strcmp.h>
+#include <intsafe.h>
+void premultiplyARGB32(ARGB32 *words, int nwords)
+{
+ for (; nwords > 0; nwords--, words++) {
+ unsigned char *pixel = (unsigned char *)words;
+ unsigned int alpha = pixel[3];
+ if (alpha == 255) continue;
+ pixel[0] = (pixel[0] * alpha) >> 8; // blue
+ pixel[1] = (pixel[1] * alpha) >> 8; // green
+ pixel[2] = (pixel[2] * alpha) >> 8; // red
+ }
+}
+
+static bool StringEnds(const wchar_t *a, const wchar_t *b)
+{
+ size_t aLen = wcslen(a);
+ size_t bLen = wcslen(b);
+ if (aLen < bLen) return false; // too short
+ if (!_wcsicmp(a + aLen- bLen, b))
+ return true;
+ return false;
+}
+
+int PNGLoader::isMine(const wchar_t *filename)
+{
+ if (filename && StringEnds(filename, L".PNG"))
+ return 1;
+ else
+ return 0;
+}
+
+const wchar_t *PNGLoader::mimeType()
+{
+ return L"image/png";
+}
+
+int PNGLoader::getHeaderSize()
+{
+ return 8;
+}
+
+int PNGLoader::testData(const void *data, int datalen) {
+ unsigned char *ptr = (unsigned char *)data;
+ return !png_sig_cmp(ptr, 0, datalen);
+}
+
+typedef struct {
+ const unsigned char *data;
+ size_t pos;
+ size_t datalen;
+} my_read_info;
+
+static void my_png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
+ my_read_info *mri = (my_read_info *)png_get_io_ptr(png_ptr);
+ if (mri->datalen - mri->pos < length)
+ length = mri->datalen - mri->pos;
+ memmove(data, mri->data + mri->pos, length);
+ mri->pos += length;
+}
+
+ARGB32 *PNGLoader::loadImage(const void *data, int datalen, int *w, int *h, ifc_xmlreaderparams *params) {
+ int w0=0, h0=0;
+
+ ARGB32 *pixels = read_png(data, datalen, &w0, &h0, FALSE);
+
+ if (pixels == NULL) return NULL;
+
+ premultiplyARGB32(pixels, w0 * h0);
+
+ if(w) *w = w0;
+ if(h) *h = h0;
+
+ return pixels;
+}
+
+ARGB32 *PNGLoader::loadImageData(const void *data, int datalen, int *w, int *h, ifc_xmlreaderparams *params)
+{
+ return read_png(data, datalen, w, h, FALSE);
+}
+
+int PNGLoader::getDimensions(const void *data, int datalen, int *w, int *h) {
+ return (read_png(data, datalen, w, h, TRUE) == reinterpret_cast<ARGB32*>(-1));
+}
+
+// From libpng example.c
+ARGB32 *PNGLoader::read_png(const void *data, int datalen, int *w, int *h, int dimensions_only) {
+ png_structp png_ptr;
+ png_infop info_ptr;
+ png_uint_32 width, height;
+ int bit_depth, color_type, interlace_type;
+ my_read_info mri;
+ mri.data = static_cast<const unsigned char *>(data);
+ mri.pos = 0;
+ mri.datalen = datalen;
+
+ /* Create and initialize the png_struct with the desired error handler
+ * functions. If you want to use the default stderr and longjump method,
+ * you can supply NULL for the last three parameters. We also supply the
+ * the compiler header file version, so that we know if the application
+ * was compiled with a compatible version of the library. REQUIRED
+ */
+ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
+ NULL, NULL, NULL);
+
+ if (png_ptr == NULL)
+ {
+ return NULL;
+ }
+
+ /* Allocate/initialize the memory for image information. REQUIRED. */
+ info_ptr = png_create_info_struct(png_ptr);
+ if (info_ptr == NULL)
+ {
+ png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
+ return NULL;
+ }
+
+ /* Set error handling if you are using the setjmp/longjmp method (this is
+ * the normal method of doing things with libpng). REQUIRED unless you
+ * set up your own error handlers in the png_create_read_struct() earlier.
+ */
+ if (setjmp(png_jmpbuf(png_ptr)))
+ {
+ /* Free all of the memory associated with the png_ptr and info_ptr */
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
+ /* If we get here, we had a problem reading the file */
+ return NULL;
+ }
+
+ png_set_read_fn(png_ptr, &mri, my_png_read_data);
+
+ /* The call to png_read_info() gives us all of the information from the
+ * PNG file before the first IDAT (image data chunk). REQUIRED
+ */
+ png_read_info(png_ptr, info_ptr);
+
+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
+ &interlace_type, NULL, NULL);
+
+ if (w) *w = (int)width;
+ if (h) *h = (int)height;
+
+ ARGB32 *retval = 0;
+
+ if (!dimensions_only) {
+
+ /* tell libpng to strip 16 bit/color files down to 8 bits/color */
+ if (bit_depth == 16) png_set_strip_16(png_ptr);
+ if (bit_depth < 8) png_set_packing(png_ptr);
+
+ /* flip the RGB pixels to BGR (or RGBA to BGRA) */
+ png_set_bgr(png_ptr);
+
+ /* Expand paletted colors into true RGB triplets */
+ if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_expand(png_ptr);
+
+ /* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */
+ if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
+ png_set_expand(png_ptr);
+
+ png_set_gray_to_rgb(png_ptr);
+
+ /* Expand paletted or RGB images with transparency to full alpha channels
+ * so the data will be available as RGBA quartets.
+ */
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
+ png_set_expand(png_ptr);
+ }
+
+ /* Add filler (or alpha) byte (before/after each RGB triplet) */
+ png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
+
+ /* Optional call to gamma correct and add the background to the palette
+ * and update info structure. REQUIRED if you are expecting libpng to
+ * update the palette for you (ie you selected such a transform above).
+ */
+ png_read_update_info(png_ptr, info_ptr);
+
+ /* Allocate the memory to hold the image using the fields of info_ptr. */
+
+ /* The easiest way to read the image: */
+ //row_pointers = (png_bytep*)malloc(sizeof(png_bytep*)*height);
+ size_t row_ptr_size = 0;
+ if (SizeTMult(sizeof(png_bytep*), height, &row_ptr_size) == S_OK)
+ {
+ png_bytep *row_pointers = (png_bytep*)alloca(row_ptr_size);
+ size_t image_size=0;
+ if (SizeTMult(width, height, &image_size) == S_OK && SizeTMult(image_size, 4, &image_size)== S_OK)
+ {
+ ARGB32 *bytes = (ARGB32 *)WASABI_API_MEMMGR->sysMalloc(image_size);
+
+ for (unsigned int row = 0; row < height; row++) {
+ row_pointers[row] = ((unsigned char *)bytes) + width * 4 * (row);
+ }
+
+ /* Now it's time to read the image. One of these methods is REQUIRED */
+ png_read_image(png_ptr, row_pointers);
+
+ /* read rest of file, and get additional chunks in info_ptr - REQUIRED */
+ png_read_end(png_ptr, info_ptr);
+
+ retval = bytes;
+ }
+ }
+
+ //free(row_pointers);
+ }
+
+ /* clean up after the read, and free any memory allocated - REQUIRED */
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
+
+ /* that's it */
+ return retval;
+}
+
+#define CBCLASS PNGLoader
+START_DISPATCH;
+ CB(ISMINE, isMine);
+ CB(MIMETYPE, mimeType);
+ CB(TESTDATA, testData);
+ CB(GETHEADERSIZE, getHeaderSize);
+ CB(GETDIMENSIONS, getDimensions);
+ CB(LOADIMAGE, loadImage);
+ CB(LOADIMAGEDATA, loadImageData);
+END_DISPATCH;
+#undef CBCLASS \ No newline at end of file
diff --git a/Src/png/PNGLoader.h b/Src/png/PNGLoader.h
new file mode 100644
index 000000000..0ec6ae6d1
--- /dev/null
+++ b/Src/png/PNGLoader.h
@@ -0,0 +1,27 @@
+#ifndef NULLSOFT_PNG_PNGLOADER_H
+#define NULLSOFT_PNG_PNGLOADER_H
+
+#include <api/service/svcs/svc_imgload.h>
+
+class ifc_xmlreaderparams;
+
+class PNGLoader : public svc_imageLoader
+{
+public:
+ // service
+ static const char *getServiceName() { return "PNG loader"; }
+
+ virtual int isMine(const wchar_t *filename);
+ virtual const wchar_t *mimeType();
+ virtual int getHeaderSize();
+ virtual int testData(const void *data, int datalen);
+ virtual int getDimensions(const void *data, int datalen, int *w, int *h);
+ virtual ARGB32 *loadImage(const void *data, int datalen, int *w, int *h, ifc_xmlreaderparams *params=NULL);
+ virtual ARGB32 *loadImageData(const void *data, int datalen, int *w, int *h, ifc_xmlreaderparams *params=NULL);
+private:
+ ARGB32 *read_png(const void *data, int datalen, int *w, int *h, int dimensions_only);
+
+protected:
+ RECVS_DISPATCH;
+};
+#endif
diff --git a/Src/png/PNGWriter.cpp b/Src/png/PNGWriter.cpp
new file mode 100644
index 000000000..76b01ab30
--- /dev/null
+++ b/Src/png/PNGWriter.cpp
@@ -0,0 +1,193 @@
+#include "PNGWriter.h"
+#include "api__png.h"
+#include <png.h>
+#include <wchar.h>
+#include <bfc/platform/strcmp.h>
+
+
+// valid items include "quality" for jpeg files with value "0" to "100"
+// return value is 1 if the config item is supported, 0 if it is not.
+int PNGWriter::setConfig(const wchar_t * item, const wchar_t * value) {
+ return 0; // no config yet
+}
+
+// valid items include "quality" for jpeg files with value "0" to "100", "lossless" returns "1" if it is "0" otherwise
+// return value is 1 if the config item is supported, 0 if it is not.
+int PNGWriter::getConfig(const wchar_t * item, wchar_t * value, int valuelen) {
+ if(!_wcsicmp(item,L"lossless")) lstrcpynW(value,L"1",valuelen);
+ else return 0;
+ return 1;
+}
+
+typedef struct {
+ BYTE * data;
+ unsigned int len;
+ unsigned int alloc;
+} pngWrite;
+
+extern "C" static void PNGAPI png_write(png_structp png_ptr, png_bytep data, png_size_t len) {
+ pngWrite * p = (pngWrite *)png_get_io_ptr(png_ptr);
+ while (len + p->len > p->alloc) { // allocate more memory
+ int d = ((p->alloc / 4) & 0xffffff00) + 0x100;
+ if(d < 4096) d = 4096;
+ p->alloc+=d;
+ p->data = (BYTE*)WASABI_API_MEMMGR->sysRealloc(p->data,p->alloc);
+ }
+ memcpy(p->data+p->len,data,len);
+ p->len += int(len);
+}
+
+extern "C" static void PNGAPI png_flush(png_structp png_ptr) {}
+
+// returns 1 if the bit depth is supported (eg 32 for ARGB32, 24 for RGB24)
+// ARGB32 MUST be supported
+int PNGWriter::bitDepthSupported(int depth) {
+ if(depth == 32 || depth == 24) return 1;
+ return 0;
+}
+
+// returns the image in our format, free the returned buffer with api_memmgr::sysFree()
+void * PNGWriter::convert(const void *pixels0, int bitDepth, int w, int h, int *length) {
+ if(bitDepth != 32 && bitDepth != 24) return 0;
+ BYTE * pixels = (BYTE*)pixels0;
+ png_structp png_ptr;
+ png_infop info_ptr;
+
+
+ /* Create and initialize the png_struct with the desired error handler
+ * functions. If you want to use the default stderr and longjump method,
+ * you can supply NULL for the last three parameters. We also check that
+ * the library version is compatible with the one used at compile time,
+ * in case we are using dynamically linked libraries. REQUIRED.
+ */
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
+ (png_voidp*)NULL, NULL, NULL);
+
+ if (png_ptr == NULL)
+ return 0;
+
+ /* Allocate/initialize the image information data. REQUIRED */
+ info_ptr = png_create_info_struct(png_ptr);
+ if (info_ptr == NULL)
+ {
+ png_destroy_write_struct(&png_ptr, NULL);
+ return 0;
+ }
+ pngWrite writer={0};
+
+ /* Set error handling. REQUIRED if you aren't supplying your own
+ * error handling functions in the png_create_write_struct() call.
+ */
+ if (setjmp(png_jmpbuf(png_ptr)))
+ {
+ /* If we get here, we had a problem reading the file */
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ if(writer.data) WASABI_API_MEMMGR->sysFree(writer.data);
+ return 0;
+ }
+
+ writer.alloc = (int(double(w*h)*1.25) & 0xffffff00) + 0x100;
+ if (writer.alloc < 4096) writer.alloc = 4096;
+ writer.data = (BYTE*)WASABI_API_MEMMGR->sysMalloc(writer.alloc);
+
+ /* If you are using replacement read functions, instead of calling
+ * png_init_io() here you would call */
+ png_set_write_fn(png_ptr, (void *)&writer, png_write,
+ png_flush);
+
+ /* Set the image information here. Width and height are up to 2^31,
+ * bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
+ * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
+ * PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
+ * or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or
+ * PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST
+ * currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED
+ */
+ int colortype = (bitDepth == 32) ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB;
+ png_set_IHDR(png_ptr, info_ptr, w, h, 8, colortype,
+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+ /* optional significant bit chunk */
+ png_color_8 sig_bit;
+ /* if we are dealing with a grayscale image then */
+ sig_bit.gray = 8;
+ /* otherwise, if we are dealing with a color image then */
+ sig_bit.red = 8;
+ sig_bit.green = 8;
+ sig_bit.blue = 8;
+ /* if the image has an alpha channel then */
+ sig_bit.alpha = (bitDepth==32)?8:0;
+ png_set_sBIT(png_ptr, info_ptr, &sig_bit);
+
+ /* Write the file header information. REQUIRED */
+ png_write_info(png_ptr, info_ptr);
+
+ /* set up the transformations you want. Note that these are
+ * all optional. Only call them if you want them.
+ */
+
+ /* invert monochrome pixels */
+ png_set_invert_mono(png_ptr);
+
+ /* Shift the pixels up to a legal bit depth and fill in
+ * as appropriate to correctly scale the image.
+ */
+ png_set_shift(png_ptr, &sig_bit);
+
+ /* pack pixels into bytes */
+ png_set_packing(png_ptr);
+
+ /* flip BGR pixels to RGB */
+ png_set_bgr(png_ptr);
+
+ /* swap bytes of 16-bit files to most significant byte first */
+ png_set_swap(png_ptr);
+
+ /* swap bits of 1, 2, 4 bit packed pixel formats */
+ png_set_packswap(png_ptr);
+
+ /*if (interlacing)
+ number_passes = png_set_interlace_handling(png_ptr);
+ else*/
+ png_uint_32 number_passes = 1;
+
+ /* The easiest way to write the image (you may have a different memory
+ * layout, however, so choose what fits your needs best). You need to
+ * use the first method if you aren't handling interlacing yourself.
+ */
+ int bytes_per_pixel = bitDepth / 8;
+
+ /* The number of passes is either 1 for non-interlaced images,
+ * or 7 for interlaced images.
+ */
+ for (png_uint_32 pass = 0; pass < number_passes; pass++)
+ {
+ BYTE * row = pixels; // + (h*w*bytes_per_pixel);
+ for (int y = 0; y < h; y++) {
+ //row -= w*bytes_per_pixel;
+ png_write_rows(png_ptr, &row, 1);
+ row += w*bytes_per_pixel;
+ }
+ }
+
+ /* It is REQUIRED to call this to finish writing the rest of the file */
+ png_write_end(png_ptr, info_ptr);
+
+ /* clean up after the write, and free any memory allocated */
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+
+ /* that's it */
+ if(length) *length = writer.len;
+ return writer.data;
+}
+
+#define CBCLASS PNGWriter
+START_DISPATCH;
+ CB(GETIMAGETYPENAME, getImageTypeName);
+ CB(GETEXTENSIONS, getExtensions);
+ CB(SETCONFIG, setConfig);
+ CB(GETCONFIG, getConfig);
+ CB(BITDEPTHSUPPORTED, bitDepthSupported);
+ CB(CONVERT, convert);
+END_DISPATCH;
+#undef CBCLASS \ No newline at end of file
diff --git a/Src/png/PNGWriter.h b/Src/png/PNGWriter.h
new file mode 100644
index 000000000..998c99100
--- /dev/null
+++ b/Src/png/PNGWriter.h
@@ -0,0 +1,21 @@
+#ifndef NULLSOFT_PNG_PNGLOADER_H
+#define NULLSOFT_PNG_PNGLOADER_H
+
+#include <api/service/svcs/svc_imgwrite.h>
+
+class ifc_xmlreaderparams;
+
+class PNGWriter : public svc_imageWriter
+{
+public:
+ static const char *getServiceName() { return "PNG writer"; }
+ const wchar_t * getImageTypeName() { return L"PNG"; }
+ const wchar_t * getExtensions() { return L"png"; }
+ int setConfig(const wchar_t * item, const wchar_t * value);
+ int getConfig(const wchar_t * item, wchar_t * value, int valuelen);
+ int bitDepthSupported(int depth);
+ void * convert(const void *pixels, int bitDepth, int w, int h, int *length);
+protected:
+ RECVS_DISPATCH;
+};
+#endif
diff --git a/Src/png/api__png.h b/Src/png/api__png.h
new file mode 100644
index 000000000..76b8a9049
--- /dev/null
+++ b/Src/png/api__png.h
@@ -0,0 +1,12 @@
+#ifndef NULLSOFT_APIH
+#define NULLSOFT_APIH
+#include <api/service/api_service.h>
+
+extern api_service *serviceManager;
+#define WASABI_API_SVC serviceManager
+
+#include <api/memmgr/api_memmgr.h>
+extern api_memmgr *memoryManager;
+#define WASABI_API_MEMMGR memoryManager
+
+#endif \ No newline at end of file
diff --git a/Src/png/factory_png.cpp b/Src/png/factory_png.cpp
new file mode 100644
index 000000000..3837918b9
--- /dev/null
+++ b/Src/png/factory_png.cpp
@@ -0,0 +1,71 @@
+#include "api__png.h"
+#include "factory_png.h"
+#include "PNGLoader.h"
+
+FOURCC PNGFactory::GetServiceType()
+{
+ return PNGLoader::getServiceType();
+}
+
+const char *PNGFactory::GetServiceName()
+{
+ return PNGLoader::getServiceName();
+}
+
+
+// {5E04FB28-53F5-4032-BD29-032B87EC3725}
+static const GUID pngGUID =
+{ 0x5e04fb28, 0x53f5, 0x4032, { 0xbd, 0x29, 0x3, 0x2b, 0x87, 0xec, 0x37, 0x25 } };
+
+GUID PNGFactory::GetGUID()
+{
+ return pngGUID;
+}
+
+void *PNGFactory::GetInterface(int global_lock)
+{
+ svc_imageLoader *ifc=new PNGLoader;
+// if (global_lock)
+// WASABI_API_SVC->service_lock(this, (void *)ifc);
+ return ifc;
+}
+
+int PNGFactory::SupportNonLockingInterface()
+{
+ return 1;
+}
+
+int PNGFactory::ReleaseInterface(void *ifc)
+{
+ //WASABI_API_SVC->service_unlock(ifc);
+ svc_imageLoader *png = static_cast<svc_imageLoader *>(ifc);
+ PNGLoader *pngloader = static_cast<PNGLoader *>(png);
+ delete pngloader;
+ return 1;
+}
+
+const char *PNGFactory::GetTestString()
+{
+ return 0;
+}
+
+int PNGFactory::ServiceNotify(int msg, int param1, int param2)
+{
+ return 1;
+}
+
+#ifdef CBCLASS
+#undef CBCLASS
+#endif
+
+#define CBCLASS PNGFactory
+START_DISPATCH;
+CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
+CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
+CB(WASERVICEFACTORY_GETGUID, GetGUID)
+CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
+CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
+CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
+CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
+CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
+END_DISPATCH;
diff --git a/Src/png/factory_png.h b/Src/png/factory_png.h
new file mode 100644
index 000000000..a8e280aef
--- /dev/null
+++ b/Src/png/factory_png.h
@@ -0,0 +1,25 @@
+#ifndef NULLSOFT_FACTORY_PNG_H
+#define NULLSOFT_FACTORY_PNG_H
+
+#include "api__png.h"
+#include <api/service/waservicefactory.h>
+#include <api/service/services.h>
+
+class PNGFactory : public waServiceFactory
+{
+public:
+ FOURCC GetServiceType();
+ const char *GetServiceName();
+ GUID GetGUID();
+ void *GetInterface(int global_lock);
+ int SupportNonLockingInterface();
+ int ReleaseInterface(void *ifc);
+ const char *GetTestString();
+ int ServiceNotify(int msg, int param1, int param2);
+
+protected:
+ RECVS_DISPATCH;
+};
+
+
+#endif \ No newline at end of file
diff --git a/Src/png/factory_pngwrite.cpp b/Src/png/factory_pngwrite.cpp
new file mode 100644
index 000000000..24c2360d5
--- /dev/null
+++ b/Src/png/factory_pngwrite.cpp
@@ -0,0 +1,71 @@
+#include "api__png.h"
+#include "factory_pngwrite.h"
+#include "PNGWriter.h"
+
+FOURCC PNGWriteFactory::GetServiceType()
+{
+ return PNGWriter::getServiceType();
+}
+
+const char *PNGWriteFactory::GetServiceName()
+{
+ return PNGWriter::getServiceName();
+}
+
+// {D089F671-283E-4999-A5C8-FE3DD851F3F1}
+static const GUID pngWriteGUID =
+{ 0xd089f671, 0x283e, 0x4999, { 0xa5, 0xc8, 0xfe, 0x3d, 0xd8, 0x51, 0xf3, 0xf1 } };
+
+
+GUID PNGWriteFactory::GetGUID()
+{
+ return pngWriteGUID;
+}
+
+void *PNGWriteFactory::GetInterface(int global_lock)
+{
+ svc_imageWriter *ifc=new PNGWriter;
+// if (global_lock)
+// WASABI_API_SVC->service_lock(this, (void *)ifc);
+ return ifc;
+}
+
+int PNGWriteFactory::SupportNonLockingInterface()
+{
+ return 1;
+}
+
+int PNGWriteFactory::ReleaseInterface(void *ifc)
+{
+ //WASABI_API_SVC->service_unlock(ifc);
+ svc_imageWriter *png = static_cast<svc_imageWriter *>(ifc);
+ PNGWriter *pngWriter = static_cast<PNGWriter *>(png);
+ delete pngWriter;
+ return 1;
+}
+
+const char *PNGWriteFactory::GetTestString()
+{
+ return 0;
+}
+
+int PNGWriteFactory::ServiceNotify(int msg, int param1, int param2)
+{
+ return 1;
+}
+
+#ifdef CBCLASS
+#undef CBCLASS
+#endif
+
+#define CBCLASS PNGWriteFactory
+START_DISPATCH;
+CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
+CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
+CB(WASERVICEFACTORY_GETGUID, GetGUID)
+CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
+CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
+CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
+CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
+CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
+END_DISPATCH;
diff --git a/Src/png/factory_pngwrite.h b/Src/png/factory_pngwrite.h
new file mode 100644
index 000000000..538e7e3a3
--- /dev/null
+++ b/Src/png/factory_pngwrite.h
@@ -0,0 +1,25 @@
+#ifndef NULLSOFT_FACTORY_PNGWRITE_H
+#define NULLSOFT_FACTORY_PNGWRITE_H
+
+#include "api__png.h"
+#include <api/service/waservicefactory.h>
+#include <api/service/services.h>
+
+class PNGWriteFactory : public waServiceFactory
+{
+public:
+ FOURCC GetServiceType();
+ const char *GetServiceName();
+ GUID GetGUID();
+ void *GetInterface(int global_lock);
+ int SupportNonLockingInterface();
+ int ReleaseInterface(void *ifc);
+ const char *GetTestString();
+ int ServiceNotify(int msg, int param1, int param2);
+
+protected:
+ RECVS_DISPATCH;
+};
+
+
+#endif \ No newline at end of file
diff --git a/Src/png/png.rc b/Src/png/png.rc
new file mode 100644
index 000000000..fcff77115
--- /dev/null
+++ b/Src/png/png.rc
@@ -0,0 +1,76 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "#include ""version.rc2""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#include "version.rc2"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Src/png/png.sln b/Src/png/png.sln
new file mode 100644
index 000000000..17e71e2cf
--- /dev/null
+++ b/Src/png/png.sln
@@ -0,0 +1,54 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29424.173
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "png", "png.vcxproj", "{EBA98B5E-F516-47AD-9D97-F5923283C6D8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {053B7CED-1A95-4473-8A58-409E93531692} = {053B7CED-1A95-4473-8A58-409E93531692}
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A} = {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\replicant\zlib\zlib.vcxproj", "{0F9730E4-45DA-4BD2-A50A-403A4BC9751A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "..\external_dependencies\libpng\libpng.vcxproj", "{053B7CED-1A95-4473-8A58-409E93531692}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Debug|Win32.Build.0 = Debug|Win32
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Debug|x64.ActiveCfg = Debug|x64
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Debug|x64.Build.0 = Debug|x64
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Release|Win32.ActiveCfg = Release|Win32
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Release|Win32.Build.0 = Release|Win32
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Release|x64.ActiveCfg = Release|x64
+ {EBA98B5E-F516-47AD-9D97-F5923283C6D8}.Release|x64.Build.0 = Release|x64
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Debug|Win32.Build.0 = Debug|Win32
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Debug|x64.ActiveCfg = Debug|x64
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Debug|x64.Build.0 = Debug|x64
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Release|Win32.ActiveCfg = Release|Win32
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Release|Win32.Build.0 = Release|Win32
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Release|x64.ActiveCfg = Release|x64
+ {0F9730E4-45DA-4BD2-A50A-403A4BC9751A}.Release|x64.Build.0 = Release|x64
+ {053B7CED-1A95-4473-8A58-409E93531692}.Debug|Win32.ActiveCfg = Debug|Win32
+ {053B7CED-1A95-4473-8A58-409E93531692}.Debug|Win32.Build.0 = Debug|Win32
+ {053B7CED-1A95-4473-8A58-409E93531692}.Debug|x64.ActiveCfg = Debug|x64
+ {053B7CED-1A95-4473-8A58-409E93531692}.Debug|x64.Build.0 = Debug|x64
+ {053B7CED-1A95-4473-8A58-409E93531692}.Release|Win32.ActiveCfg = Release|Win32
+ {053B7CED-1A95-4473-8A58-409E93531692}.Release|Win32.Build.0 = Release|Win32
+ {053B7CED-1A95-4473-8A58-409E93531692}.Release|x64.ActiveCfg = Release|x64
+ {053B7CED-1A95-4473-8A58-409E93531692}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {53DC21EA-006C-47DD-B627-07A1FAD457FF}
+ EndGlobalSection
+EndGlobal
diff --git a/Src/png/png.vcxproj b/Src/png/png.vcxproj
new file mode 100644
index 000000000..c6aabdb89
--- /dev/null
+++ b/Src/png/png.vcxproj
@@ -0,0 +1,302 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{EBA98B5E-F516-47AD-9D97-F5923283C6D8}</ProjectGuid>
+ <RootNamespace>png</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ <TargetExt>.w5s</TargetExt>
+ <IncludePath>$(IncludePath)</IncludePath>
+ <LibraryPath>$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ <TargetExt>.w5s</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ <TargetExt>.w5s</TargetExt>
+ <IncludePath>$(IncludePath)</IncludePath>
+ <LibraryPath>$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ <TargetExt>.w5s</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg">
+ <VcpkgEnableManifest>false</VcpkgEnableManifest>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <VcpkgInstalledDir>
+ </VcpkgInstalledDir>
+ <VcpkgUseStatic>false</VcpkgUseStatic>
+ <VcpkgConfiguration>Debug</VcpkgConfiguration>
+ <VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <VcpkgInstalledDir>
+ </VcpkgInstalledDir>
+ <VcpkgUseStatic>false</VcpkgUseStatic>
+ <VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <VcpkgInstalledDir>
+ </VcpkgInstalledDir>
+ <VcpkgUseStatic>false</VcpkgUseStatic>
+ <VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
+ <VcpkgConfiguration>Debug</VcpkgConfiguration>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <VcpkgInstalledDir>
+ </VcpkgInstalledDir>
+ <VcpkgUseStatic>false</VcpkgUseStatic>
+ <VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Wasabi;..\replicant\lib;..\replicant;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PNG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(ProjectDir)x86_Debug\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\
+xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Wasabi;..\replicant\lib;..\replicant;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;PNG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(ProjectDir)x64_Debug\$(ProjectName).lib</ImportLibrary>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <ProfileGuidedDatabase>$(ProjectDir)x64_Debug\$(TargetName).pgd</ProfileGuidedDatabase>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\
+xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>..\Wasabi;..\replicant\lib;..\replicant;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
+ <ImportLibrary>$(ProjectDir)x86_Release\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <ProfileGuidedDatabase>$(ProjectDir)x86_Release\$(TargetName).pgd</ProfileGuidedDatabase>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <PreventDllBinding>
+ </PreventDllBinding>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
+ </PostBuildEvent>
+ <ProjectReference>
+ <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
+ </ProjectReference>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>..\Wasabi;..\replicant\lib;..\replicant;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
+ <ImportLibrary>$(ProjectDir)x64_Release\$(ProjectName).lib</ImportLibrary>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <ManifestFile>$(ProjectDir)x64_Release\$(TargetName)$(TargetExt).intermediate.manifest</ManifestFile>
+ <ProfileGuidedDatabase>$(ProjectDir)x64_Release\$(TargetName).pgd</ProfileGuidedDatabase>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <PreventDllBinding>
+ </PreventDllBinding>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
+ </PostBuildEvent>
+ <ProjectReference>
+ <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
+ </ProjectReference>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Wasabi\api\service\svcs\svc_imgload.h" />
+ <ClInclude Include="..\Wasabi\api\service\svcs\svc_imgwrite.h" />
+ <ClInclude Include="api__png.h" />
+ <ClInclude Include="factory_png.h" />
+ <ClInclude Include="factory_pngwrite.h" />
+ <ClInclude Include="PNGLoader.h" />
+ <ClInclude Include="PNGWriter.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="wa5_png.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="factory_png.cpp" />
+ <ClCompile Include="factory_pngwrite.cpp" />
+ <ClCompile Include="PNGLoader.cpp" />
+ <ClCompile Include="PNGWriter.cpp" />
+ <ClCompile Include="wa5_png.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="png.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Wasabi\Wasabi.vcxproj">
+ <Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/Src/png/png.vcxproj.filters b/Src/png/png.vcxproj.filters
new file mode 100644
index 000000000..1258ac384
--- /dev/null
+++ b/Src/png/png.vcxproj.filters
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <ClCompile Include="factory_png.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="factory_pngwrite.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PNGLoader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PNGWriter.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wa5_png.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="api__png.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="factory_png.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="factory_pngwrite.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PNGLoader.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PNGWriter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Wasabi\api\service\svcs\svc_imgload.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Wasabi\api\service\svcs\svc_imgwrite.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="wa5_png.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{874758cc-4d81-4ce1-8262-d6dfa887afb9}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{896fe89d-d39f-4f83-88cb-247297c29b70}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Ressource Files">
+ <UniqueIdentifier>{93eb4c7b-8769-431d-b04e-b725039eaa2a}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="png.rc">
+ <Filter>Ressource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/Src/png/png.xcodeproj/project.pbxproj b/Src/png/png.xcodeproj/project.pbxproj
new file mode 100644
index 000000000..6b8fbe0ad
--- /dev/null
+++ b/Src/png/png.xcodeproj/project.pbxproj
@@ -0,0 +1,278 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 0C5820060BC0A0F800469162 /* PNG.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C581FFA0BC0A0F800469162 /* PNG.C */; };
+ 0C5820070BC0A0F800469162 /* PNG.H in Headers */ = {isa = PBXBuildFile; fileRef = 0C581FFB0BC0A0F800469162 /* PNG.H */; };
+ 0C5820080BC0A0F800469162 /* PNGCONF.H in Headers */ = {isa = PBXBuildFile; fileRef = 0C581FFC0BC0A0F800469162 /* PNGCONF.H */; };
+ 0C5820090BC0A0F800469162 /* PNGERROR.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C581FFD0BC0A0F800469162 /* PNGERROR.C */; };
+ 0C58200A0BC0A0F800469162 /* PNGGET.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C581FFE0BC0A0F800469162 /* PNGGET.C */; };
+ 0C58200B0BC0A0F800469162 /* PNGMEM.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C581FFF0BC0A0F800469162 /* PNGMEM.C */; };
+ 0C58200C0BC0A0F800469162 /* PNGREAD.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C5820000BC0A0F800469162 /* PNGREAD.C */; };
+ 0C58200D0BC0A0F800469162 /* PNGRIO.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C5820010BC0A0F800469162 /* PNGRIO.C */; };
+ 0C58200E0BC0A0F800469162 /* PNGRTRAN.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C5820020BC0A0F800469162 /* PNGRTRAN.C */; };
+ 0C58200F0BC0A0F800469162 /* PNGRUTIL.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C5820030BC0A0F800469162 /* PNGRUTIL.C */; };
+ 0C5820100BC0A0F800469162 /* PNGSET.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C5820040BC0A0F800469162 /* PNGSET.C */; };
+ 0C5820110BC0A0F800469162 /* PNGTRANS.C in Sources */ = {isa = PBXBuildFile; fileRef = 0C5820050BC0A0F800469162 /* PNGTRANS.C */; };
+ 0C5820160BC0A15000469162 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5820150BC0A15000469162 /* libz.dylib */; };
+ 0C5820190BC0A18400469162 /* api.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5820180BC0A18400469162 /* api.h */; };
+ 0C5820200BC0A19500469162 /* factory_png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C58201A0BC0A19500469162 /* factory_png.cpp */; };
+ 0C5820210BC0A19500469162 /* factory_png.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C58201B0BC0A19500469162 /* factory_png.h */; };
+ 0C5820220BC0A19500469162 /* PNGLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C58201C0BC0A19500469162 /* PNGLoader.cpp */; };
+ 0C5820230BC0A19500469162 /* PNGLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C58201D0BC0A19500469162 /* PNGLoader.h */; };
+ 0C5820240BC0A19500469162 /* wa5_png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C58201E0BC0A19500469162 /* wa5_png.cpp */; };
+ 0C5820250BC0A19500469162 /* wa5_png.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C58201F0BC0A19500469162 /* wa5_png.h */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 0C581FFA0BC0A0F800469162 /* PNG.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNG.C; path = pnglib/PNG.C; sourceTree = "<group>"; };
+ 0C581FFB0BC0A0F800469162 /* PNG.H */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = PNG.H; path = pnglib/PNG.H; sourceTree = "<group>"; };
+ 0C581FFC0BC0A0F800469162 /* PNGCONF.H */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = PNGCONF.H; path = pnglib/PNGCONF.H; sourceTree = "<group>"; };
+ 0C581FFD0BC0A0F800469162 /* PNGERROR.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGERROR.C; path = pnglib/PNGERROR.C; sourceTree = "<group>"; };
+ 0C581FFE0BC0A0F800469162 /* PNGGET.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGGET.C; path = pnglib/PNGGET.C; sourceTree = "<group>"; };
+ 0C581FFF0BC0A0F800469162 /* PNGMEM.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGMEM.C; path = pnglib/PNGMEM.C; sourceTree = "<group>"; };
+ 0C5820000BC0A0F800469162 /* PNGREAD.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGREAD.C; path = pnglib/PNGREAD.C; sourceTree = "<group>"; };
+ 0C5820010BC0A0F800469162 /* PNGRIO.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGRIO.C; path = pnglib/PNGRIO.C; sourceTree = "<group>"; };
+ 0C5820020BC0A0F800469162 /* PNGRTRAN.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGRTRAN.C; path = pnglib/PNGRTRAN.C; sourceTree = "<group>"; };
+ 0C5820030BC0A0F800469162 /* PNGRUTIL.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGRUTIL.C; path = pnglib/PNGRUTIL.C; sourceTree = "<group>"; };
+ 0C5820040BC0A0F800469162 /* PNGSET.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGSET.C; path = pnglib/PNGSET.C; sourceTree = "<group>"; };
+ 0C5820050BC0A0F800469162 /* PNGTRANS.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PNGTRANS.C; path = pnglib/PNGTRANS.C; sourceTree = "<group>"; };
+ 0C5820150BC0A15000469162 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
+ 0C5820180BC0A18400469162 /* api.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = api.h; sourceTree = "<group>"; };
+ 0C58201A0BC0A19500469162 /* factory_png.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = factory_png.cpp; sourceTree = "<group>"; };
+ 0C58201B0BC0A19500469162 /* factory_png.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = factory_png.h; sourceTree = "<group>"; };
+ 0C58201C0BC0A19500469162 /* PNGLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PNGLoader.cpp; sourceTree = "<group>"; };
+ 0C58201D0BC0A19500469162 /* PNGLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PNGLoader.h; sourceTree = "<group>"; };
+ 0C58201E0BC0A19500469162 /* wa5_png.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = wa5_png.cpp; sourceTree = "<group>"; };
+ 0C58201F0BC0A19500469162 /* wa5_png.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = wa5_png.h; sourceTree = "<group>"; };
+ D2AAC0630554660B00DB518D /* libpng.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libpng.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D289988505E68E00004EDB86 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0C5820160BC0A15000469162 /* libz.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* png */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB7795FE84155DC02AAC07 /* Source */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ name = png;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ 0C58201A0BC0A19500469162 /* factory_png.cpp */,
+ 0C58201B0BC0A19500469162 /* factory_png.h */,
+ 0C58201C0BC0A19500469162 /* PNGLoader.cpp */,
+ 0C58201D0BC0A19500469162 /* PNGLoader.h */,
+ 0C58201E0BC0A19500469162 /* wa5_png.cpp */,
+ 0C58201F0BC0A19500469162 /* wa5_png.h */,
+ 0C5820180BC0A18400469162 /* api.h */,
+ 0C5820150BC0A15000469162 /* libz.dylib */,
+ 0C581FF70BC0A0E400469162 /* libpng */,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ 0C581FF70BC0A0E400469162 /* libpng */ = {
+ isa = PBXGroup;
+ children = (
+ 0C581FFA0BC0A0F800469162 /* PNG.C */,
+ 0C581FFB0BC0A0F800469162 /* PNG.H */,
+ 0C581FFC0BC0A0F800469162 /* PNGCONF.H */,
+ 0C581FFD0BC0A0F800469162 /* PNGERROR.C */,
+ 0C581FFE0BC0A0F800469162 /* PNGGET.C */,
+ 0C581FFF0BC0A0F800469162 /* PNGMEM.C */,
+ 0C5820000BC0A0F800469162 /* PNGREAD.C */,
+ 0C5820010BC0A0F800469162 /* PNGRIO.C */,
+ 0C5820020BC0A0F800469162 /* PNGRTRAN.C */,
+ 0C5820030BC0A0F800469162 /* PNGRUTIL.C */,
+ 0C5820040BC0A0F800469162 /* PNGSET.C */,
+ 0C5820050BC0A0F800469162 /* PNGTRANS.C */,
+ );
+ name = libpng;
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D2AAC0630554660B00DB518D /* libpng.dylib */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D2AAC0600554660B00DB518D /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0C5820070BC0A0F800469162 /* PNG.H in Headers */,
+ 0C5820080BC0A0F800469162 /* PNGCONF.H in Headers */,
+ 0C5820190BC0A18400469162 /* api.h in Headers */,
+ 0C5820210BC0A19500469162 /* factory_png.h in Headers */,
+ 0C5820230BC0A19500469162 /* PNGLoader.h in Headers */,
+ 0C5820250BC0A19500469162 /* wa5_png.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D2AAC0620554660B00DB518D /* png */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "png" */;
+ buildPhases = (
+ D2AAC0600554660B00DB518D /* Headers */,
+ D2AAC0610554660B00DB518D /* Sources */,
+ D289988505E68E00004EDB86 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = png;
+ productName = png;
+ productReference = D2AAC0630554660B00DB518D /* libpng.dylib */;
+ productType = "com.apple.product-type.library.dynamic";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "png" */;
+ compatibilityVersion = "Xcode 2.4";
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* png */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D2AAC0620554660B00DB518D /* png */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D2AAC0610554660B00DB518D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0C5820060BC0A0F800469162 /* PNG.C in Sources */,
+ 0C5820090BC0A0F800469162 /* PNGERROR.C in Sources */,
+ 0C58200A0BC0A0F800469162 /* PNGGET.C in Sources */,
+ 0C58200B0BC0A0F800469162 /* PNGMEM.C in Sources */,
+ 0C58200C0BC0A0F800469162 /* PNGREAD.C in Sources */,
+ 0C58200D0BC0A0F800469162 /* PNGRIO.C in Sources */,
+ 0C58200E0BC0A0F800469162 /* PNGRTRAN.C in Sources */,
+ 0C58200F0BC0A0F800469162 /* PNGRUTIL.C in Sources */,
+ 0C5820100BC0A0F800469162 /* PNGSET.C in Sources */,
+ 0C5820110BC0A0F800469162 /* PNGTRANS.C in Sources */,
+ 0C5820200BC0A19500469162 /* factory_png.cpp in Sources */,
+ 0C5820220BC0A19500469162 /* PNGLoader.cpp in Sources */,
+ 0C5820240BC0A19500469162 /* wa5_png.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB914B08733D8E0010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ EXECUTABLE_EXTENSION = w5s;
+ EXECUTABLE_PREFIX = "";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ HEADER_SEARCH_PATHS = ../Wasabi;
+ INSTALL_PATH = /usr/local/lib;
+ PRODUCT_NAME = png;
+ ZERO_LINK = YES;
+ };
+ name = Debug;
+ };
+ 1DEB914C08733D8E0010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ ppc64,
+ x86_64,
+ );
+ EXECUTABLE_PREFIX = lib;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ INSTALL_PATH = /usr/local/lib;
+ PRODUCT_NAME = png;
+ };
+ name = Release;
+ };
+ 1DEB914F08733D8E0010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Debug;
+ };
+ 1DEB915008733D8E0010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = ../Wasabi;
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "png" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB914B08733D8E0010E9CD /* Debug */,
+ 1DEB914C08733D8E0010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "png" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB914F08733D8E0010E9CD /* Debug */,
+ 1DEB915008733D8E0010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/Src/png/resource.h b/Src/png/resource.h
new file mode 100644
index 000000000..28aec56dd
--- /dev/null
+++ b/Src/png/resource.h
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by png.rc
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/Src/png/version.rc2 b/Src/png/version.rc2
new file mode 100644
index 000000000..14b447fd9
--- /dev/null
+++ b/Src/png/version.rc2
@@ -0,0 +1,39 @@
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+#include "../Winamp/buildType.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION WINAMP_PRODUCTVER
+ PRODUCTVERSION WINAMP_PRODUCTVER
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Winamp SA"
+ VALUE "FileDescription", "Winamp 5.x System Component"
+ VALUE "FileVersion", STR_WINAMP_PRODUCTVER
+ VALUE "InternalName", "png.w5s"
+ VALUE "LegalCopyright", "Copyright © 2005-2023 Winamp SA"
+ VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
+ VALUE "OriginalFilename", "png.w5s"
+ VALUE "ProductName", "Winamp PNG Image Service"
+ VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/Src/png/wa5_png.cpp b/Src/png/wa5_png.cpp
new file mode 100644
index 000000000..5751f23c4
--- /dev/null
+++ b/Src/png/wa5_png.cpp
@@ -0,0 +1,54 @@
+#include "api__png.h"
+#include "wa5_png.h"
+#include "factory_png.h"
+#include "factory_pngwrite.h"
+#include <bfc/platform/export.h>
+
+WA5_PNG wa5_png;
+PNGFactory pngFactory;
+PNGWriteFactory pngWriteFactory;
+
+api_service *serviceManager=0;
+api_memmgr *memoryManager=0;
+
+void WA5_PNG::RegisterServices(api_service *service)
+{
+ WASABI_API_SVC = service;
+
+ // get memory manager
+ waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(memMgrApiServiceGuid);
+ if (sf) memoryManager = reinterpret_cast<api_memmgr *>(sf->getInterface());
+
+ WASABI_API_SVC->service_register(&pngFactory);
+ WASABI_API_SVC->service_register(&pngWriteFactory);
+}
+
+int WA5_PNG::RegisterServicesSafeModeOk()
+{
+ return 1;
+}
+
+void WA5_PNG::DeregisterServices(api_service *service)
+{
+ service->service_deregister(&pngWriteFactory);
+ service->service_deregister(&pngFactory);
+
+ waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(memMgrApiServiceGuid);
+ if (sf) sf->releaseInterface(memoryManager);
+}
+
+extern "C" DLLEXPORT ifc_wa5component *GetWinamp5SystemComponent()
+{
+ return &wa5_png;
+}
+
+#ifdef CBCLASS
+#undef CBCLASS
+#endif
+
+#define CBCLASS WA5_PNG
+START_DISPATCH;
+VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
+CB(15, RegisterServicesSafeModeOk)
+VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
+END_DISPATCH; \ No newline at end of file
diff --git a/Src/png/wa5_png.h b/Src/png/wa5_png.h
new file mode 100644
index 000000000..118e7602f
--- /dev/null
+++ b/Src/png/wa5_png.h
@@ -0,0 +1,15 @@
+#ifndef __WASABI_WA5_XML_H
+#define __WASABI_WA5_XML_H
+
+#include "../Agave/Component/ifc_wa5component.h"
+
+class WA5_PNG : public ifc_wa5component
+{
+public:
+ void RegisterServices(api_service *service);
+ int RegisterServicesSafeModeOk();
+ void DeregisterServices(api_service *service);
+protected:
+ RECVS_DISPATCH;
+};
+#endif \ No newline at end of file
diff --git a/Src/png/zlib.cpp b/Src/png/zlib.cpp
new file mode 100644
index 000000000..3dd9bdf62
--- /dev/null
+++ b/Src/png/zlib.cpp
@@ -0,0 +1,59 @@
+#include "api.h"
+
+extern "C"
+{
+
+extern "C" {
+ int inflateReset(void *strm)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->inflateReset(strm);
+ return -4;
+ }
+ int inflateInit_(void *strm,const char *version, int stream_size)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->inflateInit_(strm,version,stream_size);
+ return -4;
+ }
+ int inflate(void *strm, int flush)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->inflate(strm,flush);
+ return -4;
+
+ }
+ int inflateEnd(void *strm)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->inflateEnd(strm);
+ return -2;
+ }
+ unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->crc32(crc,buf,len);
+ return 0;
+ }
+
+ int deflateReset(void * strm)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->deflateReset(strm);
+ return -4;
+ }
+
+ int deflateInit2_(void * strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size);
+ return -4;
+ }
+
+ int deflate(void * strm, int flush)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->deflate(strm, flush);
+ return -2;
+ }
+
+ int deflateEnd(void * strm)
+ {
+ if (WASABI_API_INFLATE) return WASABI_API_INFLATE->deflateEnd(strm);
+ return -4;
+ }
+};
+
+} \ No newline at end of file