mmplugins/imagingplugins/codecs/PNGCodec/PNGConvert.h
branchRCL_3
changeset 50 948c7f65f6d4
parent 0 40261b775718
equal deleted inserted replaced
49:735348f59235 50:948c7f65f6d4
       
     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 //
       
    15 
       
    16 #ifndef __PNGCONVERT_H__
       
    17 #define __PNGCONVERT_H__
       
    18 
       
    19 #include <icl/imageplugin.h>
       
    20 #include "PNGCodec.h"
       
    21 
       
    22 /** @file
       
    23 	@internalComponent */
       
    24 
       
    25 class MPngDecoder 
       
    26 	{
       
    27 public:
       
    28 	virtual void GoToProcessDataState()=0;
       
    29 	};
       
    30 
       
    31 // Decoder.
       
    32 class CPngReadCodec;
       
    33 class CPngDecoder : public CImageDecoderPlugin, public MPngDecoder
       
    34 	{
       
    35 public:
       
    36 	enum TDecodeState
       
    37 		{
       
    38 		EStateStart,
       
    39 		EStateNormalProcess,
       
    40 		EStateDataProcess
       
    41 		};
       
    42 public:
       
    43 	CPngDecoder();
       
    44 
       
    45  	static CPngDecoder* NewL();
       
    46 	virtual ~CPngDecoder();
       
    47 
       
    48 	virtual void ImageType(TInt aFrameNumber, TUid& aImageType, TUid& aImageSubType) const;
       
    49 	CFrameInfoStrings* FrameInfoStringsL(RFs& aFs, TInt aFrameNumber);
       
    50 
       
    51 	void GoToProcessDataState();
       
    52 
       
    53 private:
       
    54 	// From CImageDecoderPlugin
       
    55 	void ReadFormatL();
       
    56 	void ScanDataL();
       
    57 	void DoConvert();
       
    58 	void InitConvertL();
       
    59 	void NotifyComplete();
       
    60 
       
    61 	TDecodeState iState;
       
    62 	};
       
    63 
       
    64 // CPngEncoder
       
    65 class CPngEncoder : public CImageEncoderPlugin
       
    66 	{
       
    67 private:
       
    68 	enum TEncodeState
       
    69 		{
       
    70 		EStateNormalProcess,
       
    71 		EStateDataProcess
       
    72 		};
       
    73 public:
       
    74 	static CPngEncoder* NewL();
       
    75 	virtual ~CPngEncoder();
       
    76 	void GoToProcessDataState();
       
    77 protected:
       
    78 	// from CImageEncoderPlugin
       
    79 	void PrepareEncoderL(const CFrameImageData* aFrameImageData);
       
    80 	void DoConvert();
       
    81 	void UpdateHeaderL();
       
    82 	void InitConvertL();
       
    83 	void NotifyComplete();
       
    84 private:
       
    85 	CPngEncoder();
       
    86 private:
       
    87 	TEncodeState iState;
       
    88 	};
       
    89 #endif // __PNGCONVERT_H__