-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.h
More file actions
52 lines (47 loc) · 1.15 KB
/
Copy pathImage.h
File metadata and controls
52 lines (47 loc) · 1.15 KB
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
43
44
45
46
47
48
49
50
51
52
//
// Created by Jiang Kairong on 3/11/18.
//
#ifndef PROG03_INLINEBOOL_IMAGE_H
#define PROG03_INLINEBOOL_IMAGE_H
#include <vector>
#include "Color.h"
//template<typename T>
//class Image {
// explicit Image(unsigned long width, unsigned long height);
//
// T *getRawData();
//
// const T &operator()(int i, int j) const;
//
// T &operator()(int i, int j);
//
//protected:
// std::vector<T> data;
// unsigned long width, height;
//};
//
//template<typename T>
//Image<T>::Image(unsigned long width, unsigned long height) : width(width), height(height){
// data = std::vector<T>(width * height);
//}
//
//template<typename T>
//T *Image<T>::getRawData() {
// return data.data();
//}
//
//template<typename T>
//const T &Image<T>::operator()(int i, int j) const {
// if (i >= height || j >= width || i < 0 || j < 0) {
// throw std::out_of_range("index out of bounds");
// }
// return data[i * width + j];
//}
//
//template<typename T>
//T &Image<T>::operator()(int i, int j) {
// return const_cast<T &>((*static_cast<const Image<T> *>(this))(i, j));
//}
using Image32f = Matrix<ColorRGB32f>;
using Image8i = Matrix<ColorRGB8i>;
#endif //PROG03_INLINEBOOL_IMAGE_H