I want to know how to read image files in C.. what are the headers
that i should include?
C doesn't directly support any particular image format (although one might
make out a case for XPM), but it's easy enough to open a file using fopen.
Then comes the fun part - working out which bit of the file means what.
--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
I want to know how to read image files in C.. what are the headers
that i should include? is there any tutorials regarding this ?
You can open files with fopen. You can read their data with various
functions, for example, fgetc, fread.
The headers that should be included depend on the functions you are
going to use.
Any decent C book will help you with all these.
I recommend K&R2.
pls inform me.
pls? Don't you mean please? Type the whole word, please.
In article <5aa017f4-d1df-4926-802a-81f8a87abd79@c2 2g2000prc.googl egroups.com>,
<vimal3271@gmai l.comwrote:
>I want to know how to read image files in C.. what are the headers
>that i should include? is there any tutorials regarding this ? pls
>inform me.
You probably don't want to write this yourself. There are free
libraries available for the common formats like JPEG and TIFF, and
they should be fairly portable. Obviously displaying an image is
system-dependent, but just reading in the data is much less so.
Start by Googling for libjpeg, libtiff, libpng...
-- Richard
--
Please remember to mention me / in tapes you leave behind.
>I want to know how to read image files in C.. what are the headers
>that i should include? is there any tutorials regarding this ?
>
You can open files with fopen. You can read their data with various
functions, for example, fgetc, fread.
The headers that should be included depend on the functions you are
going to use.
Any decent C book will help you with all these.
I recommend K&R2.
Perhaps you could remind me which section of K&R2 deals with image formats?
--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
On Oct 6, 6:20 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
vipps...@gmail. com said:
>
On Oct 6, 4:18 pm, vimal3...@gmail .com wrote:
I want to know how to read image files in C.. what are the headers
that i should include? is there any tutorials regarding this ?
>
You can open files with fopen. You can read their data with various
functions, for example, fgetc, fread.
The headers that should be included depend on the functions you are
going to use.
Any decent C book will help you with all these.
I recommend K&R2.
>
Perhaps you could remind me which section of K&R2 deals with image formats?
OP mentioned image files, image files are just files.
On Oct 6, 6:20 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
>vipps...@gmail .com said:
>>
On Oct 6, 4:18 pm, vimal3...@gmail .com wrote:
>I want to know how to read image files in C.. what are the headers
>that i should include? is there any tutorials regarding this ?
>>
You can open files with fopen. You can read their data with various
functions, for example, fgetc, fread.
The headers that should be included depend on the functions you are
going to use.
Any decent C book will help you with all these.
I recommend K&R2.
>>
>Perhaps you could remind me which section of K&R2 deals with image
>formats?
>
OP mentioned image files, image files are just files.
On one level, yes, that's true - but if he just meant arbitrary files, he'd
have said so. He specifically mentioned image files, and it doesn't
require a genius to deduce that he wishes to do some kind of image
processing (even if it's only display), which means he's going to need to
be able to decode image formats. He realises this. I realise this. And I
suspect you realise this too. To pretend otherwise is disingenuous.
--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
vippstar@gmail. com said:
On one level, yes, that's true - but if he just meant arbitrary files, he'd
have said so. He specifically mentioned image files, and it doesn't
require a genius to deduce that he wishes to do some kind of image
processing (even if it's only display), which means he's going to need to
be able to decode image formats. He realises this. I realise this. And I
suspect you realise this too. To pretend otherwise is disingenuous.
Not so much fun when it's someone else playing the
deliberate-misunderstandin g game, is it?
On Oct 6, 7:29 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
vipps...@gmail. com said:
>
>
>
On Oct 6, 6:20 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
vipps...@gmail. com said:
>
On Oct 6, 4:18 pm, vimal3...@gmail .com wrote:
I want to know how to read image files in C.. what are the headers
that i should include? is there any tutorials regarding this ?
>
You can open files with fopen. You can read their data with various
functions, for example, fgetc, fread.
The headers that should be included depend on the functions you are
going to use.
Any decent C book will help you with all these.
I recommend K&R2.
>
Perhaps you could remind me which section of K&R2 deals with image
formats?
>
OP mentioned image files, image files are just files.
>
On one level, yes, that's true - but if he just meant arbitrary files, he'd
have said so. He specifically mentioned image files, and it doesn't
require a genius to deduce that he wishes to do some kind of image
processing (even if it's only display), which means he's going to need to
be able to decode image formats. He realises this. I realise this. And I
suspect you realise this too. To pretend otherwise is disingenuous.
I mentioned what's possible within standard C.
If someone asks for arrays, I'll reply for C arrays; I don't care if
he was obviously asking for something else, ie arrays in computer
science et cetera.
That's for three reasons
1) One who gets replies quite different than what he expected, would
stop and think if he's asking in the right newsgroup. (especially
since someone would suggest that...)
2) One who searches comp.lang.c for arrays won't find replies to CS
arrays; he'll find replies for C arrays.
3) Replying for CS arrays would be off-topic; Telling him to ask in a
CS newsgroup would be misleading to those who search for arrays in
this newsgroup.
>I want to know how to read image files in C.. what are the headers
that i should include? is there any tutorials regarding this ? pls
inform me.
>
Basic Algorithms includes chapters on BMP, GIF and JPEG formats. Code is
free to download. However it is teaching code - the JPEG decoder won't
handle JPEG2 for example.
See website for details.
Comment