karansher / computer-graphics-raster-images

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

Regarding the data vector that we are using #77

Closed woom221 closed 1 year ago

woom221 commented 1 year ago

Hello, for write_ppm.cpp I believe the data vector we are using cannot be used directly (that is, they are not integers). Thus, we need to convert them somehow.

When I cast them directly to the integer, I end up getting all 0, so I believe there have to be more steps to be done.

Could there be a little hint?

Thank you!

abhimadan commented 1 year ago

Casting from unsigned char to int is all that needs to be done, so you likely have some other issue.

OneAutumnRain commented 1 year ago

Have the same issue. Debugger shows cast from unsigned char to int went through, but still only 0 written.

woom221 commented 1 year ago

I fixed it by changing rgba to rgb function. Hope this helps xD