-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.h
More file actions
42 lines (36 loc) · 856 Bytes
/
Image.h
File metadata and controls
42 lines (36 loc) · 856 Bytes
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
41
42
#ifndef IMAGE_H
#define IMAGE_H
#include <iostream>
#include <vector>
#include "rgb.h"
using namespace std;
typedef uint32_t u32;
typedef uint8_t u8;
typedef uint16_t u16;
typedef int32_t s32;
typedef int8_t s8;
typedef int16_t s16;
class Image : rgb
{
public:
u32 width;
u32 height;
u8 channels;
rgb *data;
public:
Image(u32 w, u32 h);
Image(const char *a);
Image(const Image &source); //copy constructor
Image& operator = (const Image &source);
~Image();
void fill(rgb c);
void pixel(u32 x, u32 y, rgb c);
rgb get_pixel(int x, int y);
Image convolution(vector<double> *kernel);
Image blur(int size);
void line(u32 x1, u32 y1, u32 x2, u32 y2, rgb c);
void rect(u32 x, u32 y, u32 w, u32 h, rgb c);
void point(u32 x, u32 y, rgb c);
void save_as(const char *s);
};
#endif