> Hey guys, i need to display a RAW image using JAVA .... i m using JAI
> API...but styll i m unable to display any raw image....pls help me with
> coding in this regards..
>
> I have some remote sensing satellite data in my RAW file ... its
> extension is .raw
> > Hey guys, i need to display a RAW image using JAVA .... i m using JAI
> > API...but styll i m unable to display any raw image....pls help me with
[quoted text clipped - 11 lines]
>
> Alun Harford
Hi Alun, Thanks for taking out time to reply .... i m generating the
raw data through this C program, it just generates a file with 12-bit
short values...i need to display it using JAVA
[C Code]
//----CODE STARTS-----//
#include <stdio.h>
#include <stdlib.h>
#include <alloc.h>
int main(void)
{
int i,numpix;
short *buf1, *buf2, *buf3, *buf4, *buf5, *buf6, *buf7, *buf8;
FILE *b1, *b2, *b3, *b4, *b5, *b6, *b7, *b8;
numpix = 3000;
buf1 = (short *) calloc(numpix, sizeof(short));
buf2 = (short *) calloc(numpix, sizeof(short));
buf3 = (short *) calloc(numpix, sizeof(short));
buf4 = (short *) calloc(numpix, sizeof(short));
buf5 = (short *) calloc(numpix, sizeof(short));
buf6 = (short *) calloc(numpix, sizeof(short));
buf7 = (short *) calloc(numpix, sizeof(short));
buf8 = (short *) calloc(numpix, sizeof(short));
b1 = fopen("b1.raw","wb");
b2 = fopen("b2.raw","wb");
b3 = fopen("b3.raw","wb");
b4 = fopen("b4.raw","wb");
b5 = fopen("b5.raw","wb");
b6 = fopen("b6.raw","wb");
b7 = fopen("b7.raw","wb");
b8 = fopen("b8.raw","wb");
for(i=0;i<numpix;i++){
buf1[i]=0;
buf2[i]=500;
buf3[i]=1000;
buf4[i]=1500;
buf5[i]=2000;
buf6[i]=2500;
buf7[i]=3000;
buf8[i]=3500;
}
for(i=0;i<=2000;i++){
fwrite(buf1,sizeof(short),numpix,b1);
fwrite(buf2,sizeof(short),numpix,b2);
fwrite(buf3,sizeof(short),numpix,b3);
fwrite(buf4,sizeof(short),numpix,b4);
fwrite(buf5,sizeof(short),numpix,b5);
fwrite(buf6,sizeof(short),numpix,b6);
fwrite(buf7,sizeof(short),numpix,b7);
fwrite(buf8,sizeof(short),numpix,b8);
}
fclose(b1);
fclose(b2);
fclose(b3);
fclose(b4);
fclose(b5);
fclose(b6);
fclose(b7);
fclose(b8);
free(buf1);
free(buf2);
free(buf3);
free(buf4);
free(buf5);
free(buf6);
free(buf7);
free(buf8);
return (0);
}
//----ENDS---//
i m writing 8 files with different values...their resolution is 3000 x
2000
Thanx and Regards
hussain