I've been finding a free jpeg decoding library for several weeks but just
jpeglib is available. Of course, it is ideal to get the library from
Konstantin (http://www.absoluteword.com/jpglib/). That is wonderful with
high speed decoding,

However, if speed is not a concern and time is available to study, jpeglib
may be ok.

I can successfully decode and display a jpeg file with 65536 colors in VFS
on my Zire71 just yesterday. Decoding and display of jpeg in memory is more
or less the same with the following steps in mind:

1. Create data handle
2. Create decoding options
3. Set options if necessary, like scale (1, 1/2, 1/4, 1/8), destination
(memory handle or bitmap variable)
4. Start decoding

The corresponding commands are: e.g.

// JpegLibData data;
// JpegLlibDecodeOptions decodeOptions;
// MemHandle yourMemHandle;

1. JpegLibCreateDataHandle( jpegLibRef, &data, &yourMemHandle );
2. JpegLibCreateDecOptions( jpegLibRef, &decodeOptions );
3a. JpegLibSetDecOptDestHandle( jpegLibRef, &decodeOptions );
    or
    JpegLibSetDecOptDestBitmap( jpegLibRef, &decodeOptions );
3b. JpegLibSetDecOptScale( jpegLibRef, &decodeOptions, 2 ); // 1/2 size
4. error = JpegLibRead( jpegLibRef, &data, &decodeOptions, &width, &height,
&NoOfComponents, (void**) &pTarget );
    or
    error = JpegLibRead( jpegLibRef, &data, &decodeOptions, &width, &height,
&NoOfComponents, (void**) &pBitmap );


It is just a brief summary extracted from the example bundle with the
JpegLib. You can get more details by going throught the example file.

I'm still studying the library and pleased to share my experience. Welcome
to any comment and advice if there is something wrong with the summary
above!


"Devil" <[EMAIL PROTECTED]> ??? news:[EMAIL PROTECTED] ???...
> Dear all,
>
> I am currently trying out jpeglib on decoding jpeg data on Palm, does
> any one know which function call I'll need to pass a chuck of memory
> (jpeg header + data) to jpeglib for decoding?  I'd found the one reading
> from VFS, but my data is already loaded onto Palm memory (just like read
> the whole bytes from file to the memory).  Any sugguestion about that?
>
> Beside jpeglib, is there any one free jpeg decoding library available
> for Plam? Thanks.
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to