|
18 | 18 | namespace taichi {
|
19 | 19 |
|
20 | 20 | template <typename T>
|
21 |
| -void Array2D<T>::load_image(const std::string &filename, bool linearize) { |
| 21 | +void ArrayND<2, T>::load_image(const std::string &filename, bool linearize) { |
22 | 22 | int channels;
|
23 | 23 | FILE *f = fopen(filename.c_str(), "rb");
|
24 | 24 | TI_ASSERT_INFO(f != nullptr, "Image file not found: " + filename);
|
@@ -57,7 +57,7 @@ void Array2D<T>::load_image(const std::string &filename, bool linearize) {
|
57 | 57 | }
|
58 | 58 |
|
59 | 59 | template <typename T>
|
60 |
| -void Array2D<T>::write_as_image(const std::string &filename) { |
| 60 | +void ArrayND<2, T>::write_as_image(const std::string &filename) { |
61 | 61 | int comp = 3;
|
62 | 62 | std::vector<unsigned char> data(this->res[0] * this->res[1] * comp);
|
63 | 63 | for (int i = 0; i < this->res[0]; i++) {
|
@@ -97,12 +97,12 @@ std::map<std::string, stbtt_fontinfo> fonts;
|
97 | 97 | std::map<std::string, std::vector<uint8>> font_buffers;
|
98 | 98 |
|
99 | 99 | template <typename T>
|
100 |
| -void Array2D<T>::write_text(const std::string &font_fn, |
101 |
| - const std::string &content_, |
102 |
| - real size, |
103 |
| - int dx, |
104 |
| - int dy, |
105 |
| - T color) { |
| 100 | +void ArrayND<2, T>::write_text(const std::string &font_fn, |
| 101 | + const std::string &content_, |
| 102 | + real size, |
| 103 | + int dx, |
| 104 | + int dy, |
| 105 | + T color) { |
106 | 106 | std::vector<unsigned char> screen_buffer(
|
107 | 107 | (size_t)(this->res[0] * this->res[1]), (unsigned char)0);
|
108 | 108 |
|
|
0 commit comments