dilevin / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
1 stars 7 forks source link

read_rgba_from_png wrong output #52

Open DanielZFLiu opened 11 months ago

DanielZFLiu commented 11 months ago

adding std::cout << rgba.size(); after line 35 in main.cpp yields me 0. Is there something wrong with the function?

DanielZFLiu commented 11 months ago

turns out that the relative paths on line23 - line26 is wrong; maybe (probably) I built the project wrong.

sannat17 commented 11 months ago

Could it be that you are running the code from the root of the project directory i.e. by calling buid/raster (I was doing that before which caused it to not work for me)? Could you try calling ./raster from inside the build directory and see if this issue still persists. Also, make sure that your build directory is located within the root of the project directory and not somewhere else.

wenzhi-guo commented 11 months ago

Yes, it indeed looks like a problem with the path of the input images. In general, the "data" folder should be one level above the raster.exe file for building on windows (see tutorial slides for a potential solution for this).

DanielZFLiu commented 11 months ago

Thank you! I didn't even notice the slides were posted.