Displaying a RAW file..pls help!

Discussion in 'Java' started by hussainak@gmail.com, Feb 7, 2006.

  1. Guest

    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
    , Feb 7, 2006
    #1
    1. Advertising

  2. Alun Harford Guest

    <> wrote in message
    news:...
    > 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
    Alun Harford, Feb 7, 2006
    #2
    1. Advertising

  3. Guest

    Alun Harford wrote:

    > <> wrote in message
    > news:...
    > > 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


    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
    , Feb 7, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesse Liberty

    Displaying XML (raw) from an ASP.NET Document

    Jesse Liberty, Aug 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    534
    Jesse Liberty
    Aug 22, 2004
  2. jty202
    Replies:
    4
    Views:
    379
    Cor Ligthert
    Jan 18, 2005
  3. Replies:
    1
    Views:
    3,205
    lordy
    Jun 29, 2006
  4. bob

    asp displaying long raw field

    bob, Mar 6, 2005, in forum: ASP General
    Replies:
    1
    Views:
    184
    Bob Barrows [MVP]
    Mar 6, 2005
  5. Bob Bob

    asp displaying long raw field

    Bob Bob, Mar 6, 2005, in forum: ASP General
    Replies:
    3
    Views:
    119
    Adrienne
    Mar 6, 2005
Loading...

Share This Page