A pure C++ program(can be used as library), that "converts" images to math graphs
grapher makes grayscale mode image from input, makes monochrome image. After program will work only with monochrome image. grapher searches for diagonal, horizontal, vertical "sections", individual pixels(pixels not included in sections) on image. It converts sections and invidual pixels coordinates to math expressions. Next, it exports expressions for Desmos
Just build with any C++ compiler, for sure, it maybe should be not older than 5 years old :)
- Remove CRT_SECURE_NO_WARNINGS if you are not on Windows based machine
- Works only with BMP format, but all bit widthes.
- Searching for diagonals takes a lot of time
- Check Utils.h, BMP.h, all functions are described here
- Include Utils.h header
- Define pointsize and offset variables(like in main.cpp), they are external.
- Create BMP object, set it's filename variable.
- Use bmp.open, check Docs section and main.cpp
- Compile
- Open using Prog FILEIN FILEOUT POINTSIZE OFFSET | FILEIN - filename of image, FILEOUT - filename of file to return math expressions, POINTSIZE - point size of individual pixels(recomendated 0.3), OFFSET - offset by 0 0.
https://www.desmos.com/calculator/wzx2pkdtfy
Good luck
discord: xfx1337#9278