Thread: Animated GIF Encoding Library

  1. #1
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

    Animated GIF Encoding Library

    Before I go and storm through the gif89a docs to create an animated gif encoder, is there an available C or C++ interface for turning a set of images into frames for an animated gif? I have heard of a mythical GIF89.DLL for the creation of GIF's but I have not found documentation. It only exports these

    DllCanUnloadNow
    DllGetClassObject
    DllGetClassObject
    DllUnregisterServer

    I just want to create some animated GIF's now that the patent has expired!

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    330
    Those exported functions mean this is a COM Dll. It will probably contain structures and interfaces for manipulating gif's.

    I suggest downloading lccwin32.
    It comes with a tool for importing typelibraries. Open the gif dll with it and lccwin32 will generate a C header from all the types and interfaces in the dll. That should get you started.

    Download:
    http://www.cs.virginia.edu/~lcc-win32/

    COM support explanation:
    http://www.q-software-solutions.de/p...-support.shtml

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Code:
    #ifndef __Gif89_h_
    #define __Gif89_h_
    
    
    #ifndef __RPC_H__
    #include "rpc.h"
    #endif
    #ifndef __RPCNDR_H__
    #include "rpcndr.h"
    #endif
    #include <ole2.h>
    #ifndef __unknwn_h__
    #include "unknwn.h"
    #endif
    #ifndef __objidl_h__
    #include "objidl.h"
    #endif
    #ifndef __oaidl_h__
    #include "oaidl.h"
    #endif
    #ifndef __ocidl_h__
    #include "ocidl.h"
    #endif
    
    DEFINE_GUID(LIBID_Gif89, 0x28d47522,0xcf84,0x11d1,0x83, 0x4c, 0x0, 0xa0, 0x24, 0x9f, 0xc, 0x28);
    /*
    Gif89 1.0
    */
    
    /* forward declares */
    struct IGif89a;
    
    
    
    
    
    DEFINE_GUID(CLSID_Gif89a, 0x28d47530,0xcf84,0x11d1,0x83, 0x4c, 0x0, 0xa0, 0x24, 0x9f, 0xc, 0x28);
    
    #ifndef LCC_IGif89a_DEFINED
    #define LCC_IGif89a_DEFINED
    
    DEFINE_GUID(IID_IGif89a, 0x28d4752f,0xcf84,0x11d1,0x83, 0x4c, 0x0, 0xa0, 0x24, 0x9f, 0xc, 0x28);
    
    typedef interface IGif89a IGif89a;
    
    #undef INTERFACE
    #define INTERFACE IGif89a
    
    DECLARE_INTERFACE_(INTERFACE, IDispatch)
    {
    	HRESULT (STDMETHODCALLTYPE *QueryInterface)(IGif89a *This, GUID* riid, void** ppvObj);
    	ULONG (STDMETHODCALLTYPE *AddRef)(IGif89a *This);
    	ULONG (STDMETHODCALLTYPE *Release)(IGif89a *This);
    	HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(IGif89a *This, UINT* pctinfo);
    	HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(IGif89a *This, UINT itinfo, ULONG lcid, void** pptinfo);
    	HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(IGif89a *This, GUID* riid, char** rgszNames, UINT cNames, ULONG lcid, LONG* rgdispid);
    	HRESULT (STDMETHODCALLTYPE *Invoke)(IGif89a *This, LONG dispidMember, GUID* riid, ULONG lcid, USHORT wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
    	HRESULT (STDMETHODCALLTYPE *put_Enabled)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_Enabled)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *get_Window)(IGif89a *This, LONG *);
    	HRESULT (STDMETHODCALLTYPE *Play)(IGif89a *This);
    	HRESULT (STDMETHODCALLTYPE *Stop)(IGif89a *This);
    	HRESULT (STDMETHODCALLTYPE *get_AutoStart)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *put_AutoStart)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_Speed)(IGif89a *This, LONG *);
    	HRESULT (STDMETHODCALLTYPE *put_Speed)(IGif89a *This, LONG);
    	HRESULT (STDMETHODCALLTYPE *get_Glass)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *put_Glass)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *put_AutoSize)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_AutoSize)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *get_Embed)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *put_Embed)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_FileName)(IGif89a *This, BSTR *);
    	HRESULT (STDMETHODCALLTYPE *put_FileName)(IGif89a *This, BSTR);
    	HRESULT (STDMETHODCALLTYPE *AboutBox)(IGif89a *This);
    };
    
    #define IGif89a_QueryInterface(ip, p1, p2) (ip)->lpVtbl->QueryInterface(ip, p1, p2)
    #define IGif89a_AddRef(ip, p1) (ip)->lpVtbl->AddRef(ip, p1)
    #define IGif89a_Release(ip, p1) (ip)->lpVtbl->Release(ip, p1)
    #define IGif89a_GetTypeInfoCount(ip, p1) (ip)->lpVtbl->GetTypeInfoCount(ip, p1)
    #define IGif89a_GetTypeInfo(ip, p1, p2, p3) (ip)->lpVtbl->GetTypeInfo(ip, p1, p2, p3)
    #define IGif89a_GetIDsOfNames(ip, p1, p2, p3, p4, p5) (ip)->lpVtbl->GetIDsOfNames(ip, p1, p2, p3, p4, p5)
    #define IGif89a_Invoke(ip, p1, p2, p3, p4, p5, p6, p7, p8) (ip)->lpVtbl->Invoke(ip, p1, p2, p3, p4, p5, p6, p7, p8)
    #define IGif89a_put_Enabled(ip, p1) (ip)->lpVtbl->put_Enabled(ip, p1)
    #define IGif89a_get_Enabled(ip, p1) (ip)->lpVtbl->get_Enabled(ip, p1)
    #define IGif89a_get_Window(ip, p1) (ip)->lpVtbl->get_Window(ip, p1)
    #define IGif89a_Play(ip) (ip)->lpVtbl->Play(ip)
    #define IGif89a_Stop(ip) (ip)->lpVtbl->Stop(ip)
    #define IGif89a_get_AutoStart(ip, p1) (ip)->lpVtbl->get_AutoStart(ip, p1)
    #define IGif89a_put_AutoStart(ip, p1) (ip)->lpVtbl->put_AutoStart(ip, p1)
    #define IGif89a_get_Speed(ip, p1) (ip)->lpVtbl->get_Speed(ip, p1)
    #define IGif89a_put_Speed(ip, p1) (ip)->lpVtbl->put_Speed(ip, p1)
    #define IGif89a_get_Glass(ip, p1) (ip)->lpVtbl->get_Glass(ip, p1)
    #define IGif89a_put_Glass(ip, p1) (ip)->lpVtbl->put_Glass(ip, p1)
    #define IGif89a_put_AutoSize(ip, p1) (ip)->lpVtbl->put_AutoSize(ip, p1)
    #define IGif89a_get_AutoSize(ip, p1) (ip)->lpVtbl->get_AutoSize(ip, p1)
    #define IGif89a_get_Embed(ip, p1) (ip)->lpVtbl->get_Embed(ip, p1)
    #define IGif89a_put_Embed(ip, p1) (ip)->lpVtbl->put_Embed(ip, p1)
    #define IGif89a_get_FileName(ip, p1) (ip)->lpVtbl->get_FileName(ip, p1)
    #define IGif89a_put_FileName(ip, p1) (ip)->lpVtbl->put_FileName(ip, p1)
    #define IGif89a_AboutBox(ip) (ip)->lpVtbl->AboutBox(ip)
    
    #endif // LCC_IGif89a_DEFINED
    
    
    
    
    #endif // Gif89_h_

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    I don't think that I should push the GIF89.DLL too much, I doubbt that they would allow me to encode the GIFs using the then-patented technology (89 does mean '89)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Property Set Library (PSL) - Announcement
    By vultur_gryphus in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 05-29-2008, 06:04 AM
  2. Makefile for a library
    By sirmoreno in forum Linux Programming
    Replies: 5
    Last Post: 06-04-2006, 04:52 AM
  3. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  4. Animated Gif to a new level - short film
    By blueCheese in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 04-22-2004, 09:02 PM
  5. animated gif problem
    By Aran in forum Tech Board
    Replies: 1
    Last Post: 08-16-2002, 10:27 PM