libjpeg 32-bit output format

Giganews Newsgroups
Subject: libjpeg 32-bit output format
Posted by:  Noob (ro…@
Date: Fri, 09 Apr 2010


I'm using libjpeg to decode pictures.

I've requested RGB output, which means 3 consecutive octets
per pixel.

B0 G0 R0 B1 G1 R1 B2 G2 R2 B3 G3 R3
|---------| |---------| |---------|
    word0      word1      word2

I would prefer an output format where pixels are aligned to
32-bit boundaries, even if it means needing larger buffers.

X0 R0 G0 B0 X1 R1 G1 B1 X2 R2 G2 B2
|---------| |---------| |---------|
    word0      word1      word2

This way I can use a single 32-bit word to deal with a
pixel's components all at once.

Is there a way to request 32-bit pixel output from libjpeg?

Perhaps asking for a fake alpha channel?