1
0

PNGLoader.h 862 B

123456789101112131415161718192021222324252627
  1. #ifndef NULLSOFT_PNG_PNGLOADER_H
  2. #define NULLSOFT_PNG_PNGLOADER_H
  3. #include <api/service/svcs/svc_imgload.h>
  4. class ifc_xmlreaderparams;
  5. class PNGLoader : public svc_imageLoader
  6. {
  7. public:
  8. // service
  9. static const char *getServiceName() { return "PNG loader"; }
  10. virtual int isMine(const wchar_t *filename);
  11. virtual const wchar_t *mimeType();
  12. virtual int getHeaderSize();
  13. virtual int testData(const void *data, int datalen);
  14. virtual int getDimensions(const void *data, int datalen, int *w, int *h);
  15. virtual ARGB32 *loadImage(const void *data, int datalen, int *w, int *h, ifc_xmlreaderparams *params=NULL);
  16. virtual ARGB32 *loadImageData(const void *data, int datalen, int *w, int *h, ifc_xmlreaderparams *params=NULL);
  17. private:
  18. ARGB32 *read_png(const void *data, int datalen, int *w, int *h, int dimensions_only);
  19. protected:
  20. RECVS_DISPATCH;
  21. };
  22. #endif