I have GIF library available. Works on any Palm OS3.5 or later. ARM support.
Here comes the h file.
gifLibrary.h:
#ifndef __GIFLIBRARY_H__
#define __GIFLIBRARY_H__
typedef struct GIF_INFO {
// image info
unsigned short width; // width
unsigned short height; // height
unsigned short totalFrames; // amount of frames
unsigned short repeatCount; // loop count
// last frame info
unsigned short x; // top left
unsigned short y; // top left
unsigned short w; // width
unsigned short h; // height
unsigned long delay; // milliseconds to wait
short t_color; // transaparent color if != -1
short disposal; // what to do after the draw
} GIF_INFO;
#define DISPOSAL_NOTHING 0
#define DISPOSAL_LEAVE 1
#define DISPOSAL_RESTORE_BACK 2
#define DISPOSAL_RESTORE_IMAGE 3
typedef void* GIF_HANDLE;
#define gifErrNoMemory 1
#define gifErrWrongFormat 2
// ------------------------------ gif functions
GIF_HANDLE gif_Open(void *image);
void gif_Close(GIF_HANDLE);
unsigned short gif_GetInfo(GIF_HANDLE gifHandle,GIF_INFO *gifP);
void gif_Animate(void* data, short X, short Y); // play the whole gif once
BitmapPtr gif_GetBitmap(GIF_HANDLE gifHandle, unsigned short frame,GIF_INFO
*gifP,unsigned short *errorP); // get specific frame
void gif_PreDraw(GIF_HANDLE *gifHandle, short X,short Y); // refresh screen
between frames before next frame
#endif // #ifndef __GIFLIBRARY_H__
The usage is
- get GIF_HANDLE via gif_Open
- request info through gif_GetInfo
- unpack any specific frame by BitmapPtr gif_GetBitmap and do whatever you
want with bitmap
- close GIF_HANDLE via gif_Close
or just call
void gif_Animate(void* data, short X, short Y); // play the whole gif
once
to have full cycle of animation at (X,Y);
I have not decided about the terms how to distribiute the library. Probably
it will be a part of Jpeg decompression library available at
http://www.absoluteword.com/jpglib/. The page is out of date currently and
will be updated pretty soon to reflect last news:
- support for progressive jpegs
- support for gif (sinle frame/animation loop)
The demo linked from the page is to be updated as well. Currently it
supports only baseline jpes and no gifs at all.
--
Konstantin
"Chris Mitra" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm trying to locate a GIF decoder library for PalmOS. I've tried
searching
> on Google and various newsgroups, but was surprised to not find one. Does
> anyone know if either a shared library, or source code, exists to decode a
> GIF image (as a stream or buffer in memory) into a BitmapPtr?
>
> thanks,
> Chris
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/