Re: using libjpeg



oswald.harry@xxxxxxxxx schrieb:
hi
I have a char* imgnames[] that contain full path names of jpg files
(ie like "F:\myimgs\jpg\one.jpg",... etc) .I wish to read each
corresponding .jpg file and extract info into a struct ..and thus
create an array of structures.in each struct i would like to store
imgname,width,height,and value of each pixel(as a long?).

Pretty sure you´ll want to use int´s and not long´s. The typiclly used ARGB consists of 32bits.
may be like

struct myjpgfile{
char* imgfile;
int wdth;
int hgt;
long[] pixels;//as a 1 dimensional array
}

.I am told that cygwin has libjpeg library that can do this task..i
went thru the jpeglib.h file but couldn't make out which method should
be used..can someone help?

Dont know if using c++ is a option for you. The image module from SDL has exactly this, it`s called IMG_Load. Even if not, looking at that function`s, or more specificly IMG_LoadJPG_RW`s, source code should provide you with answers, since its linked against libjpeg.
thanx
oharry
.



Relevant Pages

  • Re: using libjpeg
    ... I have a char* imgnamesthat contain full path names of jpg files ... create an array of structures.in each struct i would like to store ... jpeg image. ...
    (comp.unix.programmer)
  • using libjpeg
    ... I have a char* imgnamesthat contain full path names of jpg files ... create an array of structures.in each struct i would like to store ...
    (comp.unix.programmer)