24-bit PCX decoding. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

24-bit PCX decoding.

I'm writing a program in TMT-Pascal to decode and display

24-bit Bitmaps. I'm having a bit of trouble interpreting the

layout of the pic. The ZSoft DOC I have on it doesn't make it

clear whether it does bitplanes at a time (i.e. 1 line red, 2 line

red, 3... 1 line blue, 2 line blue, etc.), or alternating lines.

Anyone know? I can get it to decode right, but can't get the data

to work correctly because of this.


URL:http://acheronx.resnet.tamu.edu

Comments

  • : I'm writing a program in TMT-Pascal to decode and display

    : 24-bit Bitmaps. I'm having a bit of trouble interpreting the

    : layout of the pic. The ZSoft DOC I have on it doesn't make it

    : clear whether it does bitplanes at a time (i.e. 1 line red, 2 line

    : red, 3... 1 line blue, 2 line blue, etc.), or alternating lines.

    : Anyone know? I can get it to decode right, but can't get the data

    : to work correctly because of this.


    After looking at a 24bit file quickly (assuming Neopaint saved it according to spec) it looks like it is a RGB,RGB,RGB for each pixel, not a line. Also it seems to encode runs based on the entire 24bit color and not encode just the red, just the green, then just the blue.

    I don't have the spec, but that's what it looks like. The only problem is if neopaint is saving in a screwy pcx format, which seems possible since the color depth and bytesPerLine values in the header didn't look correct to me.

    Hope that helps.


    Rock




  • i found out 24 bit pcx is stored like this :

    RRRRRRRGGGGGGGBBBBBBB


    and that is encoded as usual with the >192 and stuff


    so take one scanline at a time, decode until you

    have 3*width number of pixels (you should put those

    in an array)


    then just say something like :


    for (int i=0; i
    r = temptab[i];

    g = temptab[i+width];

    b = temptab[i+(2*width)];

    }


    hope this helps


    ile / aardbei


Sign In or Register to comment.