Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Displaying a RAW file..pls help!

Thread view: 
hussainak@gmail.com - 07 Feb 2006 13:43 GMT
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
Alun Harford - 07 Feb 2006 14:11 GMT
> 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
hussainak@gmail.com - 07 Feb 2006 19:59 GMT
> > 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.