Newbie read image help
From: Joe (nospam_at_nospam.com)
Date: 02/04/04
- Next message: lilburne: "Re: Any C/C++ LINT type checking recomendations"
- Previous message: Richard Heathfield: "Re: Any C/C++ LINT type checking recomendations"
- Next in thread: Phlip: "Re: Newbie read image help"
- Reply: Phlip: "Re: Newbie read image help"
- Reply: John Harrison: "Re: Newbie read image help"
- Reply: james: "Re: Newbie read image help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 4 Feb 2004 00:51:46 +0100
Hi all.
I'm writing a program that is supposed to be able to read an image file from
the harddrive and put all image data into a big matrix (or if not possible,
into an array). I obviously don't know the size of the file in advance, only
the file name.
My question is, how do I do this in C++. All newbie examples I have looked
at are with simple ASCII textfiles ending with a null byte and a for loop
reading one byte or one line per loop. But what I want is to read an entire
binary file _at once_, and put all it's content into memory.
I guess this is no more than 2-3 lines of code, but I just can't find it
myself.
Also, is it possible to choose if I want to store the data in a matrix or an
array, that would be great if I could choose.
Also, is there any (free open source) libraries out there that someone can
recommened for reading an image and with functions for fetching the pixel
data at a certain coordinate, for example:
int pixelvalue=image.getPixel(x,y);
Nice features would be if the library could read jpeg images as well.
Any help and any ideas would be really appreciated.
Thanks in advance.
/Joe
- Next message: lilburne: "Re: Any C/C++ LINT type checking recomendations"
- Previous message: Richard Heathfield: "Re: Any C/C++ LINT type checking recomendations"
- Next in thread: Phlip: "Re: Newbie read image help"
- Reply: Phlip: "Re: Newbie read image help"
- Reply: John Harrison: "Re: Newbie read image help"
- Reply: james: "Re: Newbie read image help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|