-
Notifications
You must be signed in to change notification settings - Fork 0
/
Image.h
40 lines (32 loc) · 783 Bytes
/
Image.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef IMAGE_H
#define IMAGE_H
#include "png.h"
#include <string>
#include <fstream>
#include <stdexcept>
#include <algorithm>
class Image {
private:
std::string m_fn;
std::ifstream m_file;
unsigned char** m_pixels;
png_structp m_read;
png_infop m_info;
png_uint_32 m_width;
png_uint_32 m_height;
png_uint_32 m_rowbytes;
png_uint_32 m_bitdepth;
png_uint_32 m_channels;
png_uint_32 m_color_type;
void init_png_io();
public:
Image(const std::string fn);
~Image();
void write_image() const;
void read_image() const;
bool is_png() const;
void display_image(const std::string& window_title) const;
void filter(std::string& filter) const;
};
#endif
/* vim: set ts=4 sw=4 tw=79 ft=cpp et :*/