TweeZcodeCompiler / twee_zcode_compiler

compiler project at FU Berlin
MIT License
3 stars 0 forks source link

Images #114

Open ottne opened 9 years ago

ottne commented 9 years ago

Added code to the project itself so that the compiler can generate ASCII art without any runtime-dependencies. Instead, two new compile-time dependencies are now added: aalib (for rendering images to ASCII) and libjpeg (for reading jpeg data).

This can only read JPEG images for now. Reading PNG would be a nice addition.

This is not integrated into the pipeline yet.

Usage is fairly straightforward:

AsciiConverter converter;
std::cout << converter.convertJpgToAscii("somefile.jpg", 130);

The second parameter is the maximum character width. The method takes care of scaling the image appropriately by itself.

Let me know what you think!

tobiasschuelke commented 9 years ago

Cannot use it because CLion says: Error:Could not find AA

ottne commented 9 years ago

You need to install libaa. With apt-get it's apt-get install libaa1-dev. Don't forget libjpeg-dev as well!

tobiasschuelke commented 9 years ago

Clion cannot find AAlibTest.h:

Twee Compiler/twee_zcode_compiler/code/TweeZcodeCompiler/main/main.cpp:10:23: fatal error: AALibTest.h: No such file or directory

After deleting AAlibTest reference it works, but it is printed 4 times on console. We need to get a string as a return value from convertJpgToAscii() method to pass it through in the pipeline.

ottne commented 9 years ago

Yes, that was a residue from former testing. Probably didn't check it in properly...