-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (25 loc) · 681 Bytes
/
Copy pathmain.cpp
File metadata and controls
28 lines (25 loc) · 681 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
#include "texto/utils.h"
#include <iostream>
#include <memory>
#include <opencv2/core/mat.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/opencv.hpp>
#include <texto/image.h>
#include <texmath/mat.h>
#include <texto/utils.h>
#include <sys/ioctl.h>
using namespace texto;
int main() {
image im = read_image("../examples/euler.jpg");
struct winsize w{};
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
im.resize(w.ws_col, w.ws_row);
std::shared_ptr<array2d_string> str = im.to_ascii();
for (const auto& ele : *(str.get())) {
for (const auto& ele2 : ele) {
std::cout << ele2;
}
std::cout << "\n";
}
return 0;
}