// 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/OIGifColorTable.h,v 1.3 1998/12/10 21:21:41 kc Exp $

#import <OmniFoundation/OFObject.h>

@class OWDataStreamCursor;

typedef union {
    struct {
	byte red, green, blue, alpha;
    } components;
    unsigned long int packed;
} OIGifColor;

#define OIGifColorTableMaxEntries 256

@interface OIGifColorTable : OFObject
{
@public
    OIGifColor colorTable[OIGifColorTableMaxEntries];
    unsigned int size;
    short int transparentColorIndex;
    OIGifColor oldTransparentColorValues;
}

- initFromDataStreamCursor:(OWDataStreamCursor *)dataCursor size:(unsigned int)newSize gamma:(float)gamma;

- (unsigned int)size;

- (void)setTransparentColorIndex:(short int)anIndex;
- (short int)transparentColorIndex;

@end

static inline OIGifColor
OIGifColorTableColorAtIndex(OIGifColorTable *gifColorTable, unsigned int colorIndex)
{
    // ASSERT(colorIndex < gifColorTable->size);
    return gifColorTable->colorTable[colorIndex];
}
