rag
graphic 2d engine
ImageLoaderPNG.h
1 #ifndef _IMAGE_LOADER_PNG_H_
2 #define _IMAGE_LOADER_PNG_H_
3 
4 #include <rag/Platform.h>
5 #include <iostream>
6 #include <rag/Image.h>
7 #include <rag/File.h>
8 #include "libpng/png.h"
9 #include "ImageLoader.h"
10 
11 namespace rag
12 {
15  {
16  public:
17 
18  ImageLoaderPNG(const std::string& name, rag::Image* image);
19  ~ImageLoaderPNG();
20 
21  bool loadInfo();
22  bool loadImage();
23 
24  size_t byte;
25  unsigned char* buffer;
26 
27  private:
28 
29  std::string name;
30  rag::Image* image;
31  png_structp png_ptr;
32  png_infop info_ptr;
33 
34  int filesize;
35  };
36 }
37 
38 #endif
Interface to load images.
Definition: ImageLoader.h:8
Definition: Bitmap.h:8
Loader for .png format.
Definition: ImageLoaderPNG.h:14
Image object.
Definition: Image.h:19
bool loadImage()
Load image from a file.
Definition: ImageLoaderPNG.cpp:94
bool loadInfo()
Load header to know image size.
Definition: ImageLoaderPNG.cpp:36