summaryrefslogtreecommitdiffstats
path: root/thk04/png_layer.h
diff options
context:
space:
mode:
Diffstat (limited to 'thk04/png_layer.h')
-rw-r--r--thk04/png_layer.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/thk04/png_layer.h b/thk04/png_layer.h
new file mode 100644
index 0000000..49620ae
--- /dev/null
+++ b/thk04/png_layer.h
@@ -0,0 +1,60 @@
+/* FreeJ
+ * (c) Copyright 2001 Denis Roio aka jaromil <jaromil@dyne.org>
+ *
+ * This source code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * This source code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * Please refer to the GNU Public License for more details.
+ *
+ * You should have received a copy of the GNU Public License along with
+ * this source code; if not, write to:
+ * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __png_h__
+#define __png_h__
+
+#include <stdio.h>
+#include <SDL/SDL.h>
+
+#include <png.h>
+#include <layer.h>
+
+class PngLayer: public Layer {
+private:
+ /* core internal structure */
+ png_structp core;
+
+ /* png image informations */
+ png_infop info;
+
+ /* file signature to check for validation */
+ unsigned char sig[8];
+
+ /* image buffer */
+ png_bytep buf;
+
+ /* row pointers */
+ png_bytep *row_pointers;
+
+ FILE *fp;
+
+public:
+ PngLayer();
+ ~PngLayer();
+
+ bool init(Context *screen);
+ bool open(char *file);
+ void *feed();
+
+ void close();
+
+ bool keypress(SDL_keysym *keysym) { return false; };
+};
+
+#endif