1999-12-15 22:38:02 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/imagpng.h
|
1999-12-15 22:38:02 +00:00
|
|
|
// Purpose: wxImage PNG handler
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-12-15 22:38:02 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_IMAGPNG_H_
|
|
|
|
#define _WX_IMAGPNG_H_
|
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#include "wx/defs.h"
|
1999-12-15 22:38:02 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxPNGHandler
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#if wxUSE_LIBPNG
|
2005-02-27 15:24:50 +00:00
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#include "wx/image.h"
|
2010-11-25 00:53:44 +00:00
|
|
|
#include "wx/versioninfo.h"
|
2005-03-16 16:18:31 +00:00
|
|
|
|
2005-02-27 15:24:50 +00:00
|
|
|
#define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat")
|
|
|
|
#define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth")
|
2009-01-14 17:54:38 +00:00
|
|
|
#define wxIMAGE_OPTION_PNG_FILTER wxT("PngF")
|
|
|
|
#define wxIMAGE_OPTION_PNG_COMPRESSION_LEVEL wxT("PngZL")
|
|
|
|
#define wxIMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL wxT("PngZM")
|
|
|
|
#define wxIMAGE_OPTION_PNG_COMPRESSION_STRATEGY wxT("PngZS")
|
|
|
|
#define wxIMAGE_OPTION_PNG_COMPRESSION_BUFFER_SIZE wxT("PngZB")
|
2005-02-27 15:24:50 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxPNG_TYPE_COLOUR = 0,
|
|
|
|
wxPNG_TYPE_GREY = 2,
|
2011-01-03 22:22:16 +00:00
|
|
|
wxPNG_TYPE_GREY_RED = 3,
|
|
|
|
wxPNG_TYPE_PALETTE = 4
|
2005-02-27 15:24:50 +00:00
|
|
|
};
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPNGHandler: public wxImageHandler
|
1999-12-15 22:38:02 +00:00
|
|
|
{
|
|
|
|
public:
|
2002-12-04 14:11:26 +00:00
|
|
|
inline wxPNGHandler()
|
|
|
|
{
|
|
|
|
m_name = wxT("PNG file");
|
|
|
|
m_extension = wxT("png");
|
|
|
|
m_type = wxBITMAP_TYPE_PNG;
|
|
|
|
m_mime = wxT("image/png");
|
|
|
|
}
|
1999-12-15 22:38:02 +00:00
|
|
|
|
2010-11-25 00:53:44 +00:00
|
|
|
static wxVersionInfo GetLibraryVersionInfo();
|
|
|
|
|
1999-12-15 22:38:02 +00:00
|
|
|
#if wxUSE_STREAMS
|
2004-09-16 18:13:32 +00:00
|
|
|
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
|
|
|
|
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
|
2006-02-08 21:47:09 +00:00
|
|
|
protected:
|
2002-12-04 14:11:26 +00:00
|
|
|
virtual bool DoCanRead( wxInputStream& stream );
|
1999-12-15 22:38:02 +00:00
|
|
|
#endif
|
2002-12-04 14:11:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
|
1999-12-15 22:38:02 +00:00
|
|
|
};
|
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#endif
|
|
|
|
// wxUSE_LIBPNG
|
1999-12-15 22:38:02 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_IMAGPNG_H_
|
|
|
|
|