Hello, I'm a C++ beginner stuck on something I think may be easy.
I'm trying to write a program that uses a button to open a folder, displays the files inside that folder(which happen to be jpegs) and then allows you to select the files inside the folder. Then I want it to extract the RGB components of the jpegs. I have no idea how to extract the RGB component of a picture and none of the examples I've looked up have helped. Do any of you know of a way I could do this without downloading anything? I'm using visual C++ by the way. Thanks
Decompressing jpeg files is very complex, and trying to do it without a library is a little ridiculous.
That's not to say it can't be done. It can certainly be done and it might even be a good experimental/education project. But it won't be easy.
If you're serious about it, google around for a technical doc that outlines the .jpeg file format. Get ready for some very dense reading.
Or if you don't really care about how jpegs are stored and just want your program to be able to read them -- do yourself a favor and just use an existing library. There are dozens available. One I know of is called "SOIL" but I've only heard of it being used with OpenGL.
Do any of you know of a way I could do this without downloading anything?
... Yes... read mountains of technical documents so that you get your JPEG decoder right.
I didn't call it JPEG "loader" because that would imply you simply load chunks of data and be done with it -- this isn't the case.
I suggest you try to use a pre-made library, unless of course implementing your own JPEG decoder is a project goal itself.