YavorGIvanov / sam.cpp

MIT License
1.26k stars 52 forks source link

added functionality to handle RGBA, i.e. 4 channels and related modif… #20

Closed bhavuk2002 closed 12 months ago

bhavuk2002 commented 1 year ago

12

thanks. im new to open source, first i read about image channels and got the understanding what they are, here basically we have to add ALPHA in loading image, we are currently missing that, thats why errors are getting generaated. I read documentation for stbi_load and have modified the code base accordingly and handled error accordingly.

Can someone test it?

bhavuk2002 commented 1 year ago

oh ya i was thinking of editing sam_image_u8 but neglected it. will do surely, and update sam_image_u8.

bhavuk2002 commented 1 year ago

one more thing apart from that logic for load_image_from_file is fine?

bhavuk2002 commented 1 year ago

image in the code base here at line number 340 we are resizing the mask. Do we need to use 4 channels here or 3 are enough for 4 channels too? Apart from this function in main.cpp / examples, there is no hard coding of number of channels left.

bhavuk2002 commented 1 year ago

can you please elaborate, how can i work forward on this?

YavorGIvanov commented 1 year ago

Load a png image with alpha channel and test that the sample works. I will try to do that today or tomorrow and look more carefully through your change.

bhavuk2002 commented 1 year ago

uhm png image doesnt support alpha channel.

YavorGIvanov commented 1 year ago

https://www.w3.org/TR/PNG-DataRep.html Section 2.4

bhavuk2002 commented 1 year ago

Okay i was wrong, now what changes should i make and where?

bhavuk2002 commented 1 year ago

any info or update?

bhavuk2002 commented 1 year ago

any update?