Displaying a RAW file..pls help!

H

hussainak

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
 
A

Alun Harford

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
What the extension happens to be doesn't tell you anything about the file
content.
If you tell us what type of file it is (or likely even just how it was
generated) then we might be able to help you.
Based on my knowledge of "raw" files on digi cams, no two manufacturers use
the same standard.

Alun Harford
 
H

hussainak

Alun said:
What the extension happens to be doesn't tell you anything about the file
content.
If you tell us what type of file it is (or likely even just how it was
generated) then we might be able to help you.
Based on my knowledge of "raw" files on digi cams, no two manufacturers use
the same standard.

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=0;

buf2=500;

buf3=1000;

buf4=1500;

buf5=2000;

buf6=2500;

buf7=3000;

buf8=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
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top