JPEG/TIFF routines?

U

usao

Does anyone know where I can find C subroutines to read JPEG and/or
TIFF files into 2-dimensional C arrays?
 
C

Charles Harrison Caudill

usao said:
Does anyone know where I can find C subroutines to read JPEG and/or
TIFF files into 2-dimensional C arrays?

This post is pretty off topic. This newsgroup is about ansi c.

As for what you're looking for, I personally like to use GTK, but I'm sure QT
has stuff for that as well. GTK is cross-platform, pretty, and well
organized. Check out gdkpixbufs and gtk-canvas widgets.

hth
 
J

Joona I Palaste

This post is pretty off topic. This newsgroup is about ansi c.
As for what you're looking for, I personally like to use GTK, but I'm sure QT
has stuff for that as well. GTK is cross-platform, pretty, and well
organized. Check out gdkpixbufs and gtk-canvas widgets.

I must have missed the part where the OP said anything about
*displaying* the *pictures* contained in those JPEG or TIFF files.
Reading them into 2-dimensional arrays can be done with 100% ISO C
code. How, don't ask me. But it can be done. What to do with those
arrays is anyone's guess.
 
M

Malcolm

usao said:
Does anyone know where I can find C subroutines to read JPEG
and/or TIFF files into 2-dimensional C arrays?
You can only use a 2d array if you know the image dimensions at compile
time. Even here it will be a nuisance - the image[y][x] notation looks
tempting, but to use it all the functions that work on the image will have
to have the dimensions hardcoded in.
Much better to use malloc() and pass width and height around internally.
As for a JPEG codec, try a websearch for JPEG and "codec" (just searching
for "JPEG" brings up nothing but porn sites).
 
C

Charles Harrison Caudill

I must have missed the part where the OP said anything about
*displaying* the *pictures* contained in those JPEG or TIFF files.

true, but once you read an image into a gdk pixbuf, you can actually get an
array of data from it. That's how I manipulate STM images. Also, Matlab is
good for doing this:

img = imread('myImg.tiff');
figure;
imagesrc(img);

you can then tie your matlab code in w/ ansi c code; but don't ask me how.

hth
 
P

Peter Ammon

usao said:
Does anyone know where I can find C subroutines to read JPEG and/or
TIFF files into 2-dimensional C arrays?

IJG has a very nice open source library for reading in or writing out
JPEG files. If it's not written in ANSI C, it's extraordinarily close
to it (which is why I feel justified in mentioning it). Start at
<http://www.ijg.org/>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top