// Copyright 1996-1998 Omni Development, Inc.  All rights reserved.
//
// This software may only be used and reproduced according to the
// terms in the file OmniSourceLicense.html, which should be
// distributed with this project and can also be found at
// http://www.omnigroup.com/DeveloperResources/OmniSourceLicense.html.
//
// $Header: /Network/Developer/Source/CVS/OmniGroup/OmniComponents/ImageProcessors/gif/OIGifImageProcessor.h,v 1.6 1998/12/10 21:21:42 kc Exp $

#import <OIF/OIImageProcessor.h>

@class NSMutableData;
@class OWDataStream, OWObjectStream;
@class OIGifColorTable;
@class OIAnimationFrame;
@class OIAnimation;

typedef enum {
   GIF87A, GIF89A
} GifVersion;

typedef enum {
   GDMNothing = 0x00,
   GDMLeaveAsIs = 0x01,
   GDMPreviousImage = 0x02,
   GDMBackground = 0x04,
} GifDisposalMethod;

@interface OIGifImageProcessor : OWDataStreamProcessor
{
    float gamma;

    // GIF global data
    GifVersion gifVersion;
    short int screenWidth;
    short int screenHeight;
    BOOL isGlobalColorTableSorted;
    byte colorResolution;
    BOOL hasGlobalColorTable;
    byte backgroundColor;
    double aspectRatio;
    unsigned int globalBitsPerPixel;

    OIGifColorTable *globalColorTable;

    // GIF image data
    short int left, top, width, height;
    BOOL isLocalColorTableSorted;
    BOOL isInterlaced;
    BOOL hasLocalColorTable;
    unsigned int localBitsPerPixel;

    OIGifColorTable *localColorTable;

    // Graphics control extension data
    BOOL hasTransparency;
    byte transparentIndex;
    BOOL wantsUserInput;
    GifDisposalMethod disposalMethod;
    unsigned short delayTime;
    
    // Netscape extension block
    BOOL shouldLoop;
    unsigned short int loopCount;

    // output
    OIAnimationFrame *animationFrame;
    OIAnimation *animation;
    NSMutableData *savedImageData;

    // current image
    BOOL needUpdate;
    NSTimeInterval lastDrawTimeInterval;
    NSTimeInterval drawInterval;
}

@end
