mmplugins/imagingplugins/codecs/GifCodec/GIFConvert.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Licensed under US Patent No 4,558,302 and foreign counterparts
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef GIFCONVERT_H
       
    19 #define GIFCONVERT_H
       
    20 
       
    21 #include <icl/imageplugin.h>
       
    22 #include "GIFcodec.h"
       
    23 #include "GIFFormat.h"
       
    24 
       
    25 class CGifReadCodec;
       
    26 class TGifImageInformation;
       
    27 class CGifDecoder : public CImageDecoderPlugin
       
    28 	{
       
    29 public:
       
    30 	static CGifDecoder* NewL();
       
    31 	~CGifDecoder();
       
    32 
       
    33 	// From CImageDecoder
       
    34 	void ImageType(TInt aFrameNumber, TUid& aImageType, TUid& aImageSubType) const;
       
    35 	TInt NumberOfImageComments() const;
       
    36 	HBufC* ImageCommentL(TInt aCommentNumber) const;
       
    37 
       
    38 protected:
       
    39 	// From CImageDecoder
       
    40 	CFrameInfoStrings* FrameInfoStringsL(RFs& aFs, TInt aFrameNumber);
       
    41 
       
    42 private:
       
    43 	CGifDecoder();
       
    44 	void ReadFormatL();
       
    45 	// From CImageDecoderPlugin
       
    46 	void ScanDataL();
       
    47 private:
       
    48 	TInt iReadBlockLength;
       
    49 	TGifFileInformation iFileInfo;
       
    50 	TInt iGlobalPaletteEntries;
       
    51 	TRgb iGlobalPalette[KGifColorTableMaxEntries];
       
    52 	TBool iLoadingFrame;
       
    53 	};
       
    54 
       
    55 
       
    56 // CGifEncoder
       
    57 class CGifScaler;
       
    58 class CGifWriteCodec;
       
    59 class CGifEncoder : public CImageEncoderPlugin
       
    60 	{
       
    61 public:
       
    62 	static CGifEncoder* NewL();
       
    63 	virtual ~CGifEncoder();
       
    64 	
       
    65 	const CPalette* Palette() const;
       
    66 protected:
       
    67 	//from CImageEncoderPlugin
       
    68 	void PrepareEncoderL(const CFrameImageData* aFrameImageData);
       
    69 	void UpdateHeaderL();
       
    70 	void WriteExifDataL(TRequestStatus*& aScaleCompletionStatus);
       
    71 private:
       
    72 	void ConstructL();
       
    73 	CGifEncoder();
       
    74 private:
       
    75 	CPalette* iPalette;
       
    76 	CFbsBitmap* iDest;
       
    77 	CGifScaler* iGifScaler;
       
    78 	};
       
    79 
       
    80 #endif // GIFCONVERT_H