00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __PNGSCANLINEENCODER_H__
00020 #define __PNGSCANLINEENCODER_H__
00021
00022 #include "PNGCodec.h"
00023 #include "ImageUtils.h"
00024
00025
00026
00027
00028
00029
00030 const TInt KPngScanlineFilterTypeLength = 1;
00031
00032
00033
00034
00035
00036 const TInt KPngDepth1PixelsPerByte = 8;
00037 const TInt KPngDepth1RoundUpValue = 7;
00038 const TInt KPngDepth1ShiftValue = 1;
00039
00040 class CBitDepth1Encoder : public CPngWriteSubCodec
00041 {
00042 private:
00043 virtual void DoConstructL();
00044 virtual TInt ScanlineBufferSize(TInt aPixelLength);
00045 virtual void DoEncode(const CFbsBitmap* aSource, const TInt aScanline,
00046 TUint8* aDataPtr, const TUint8* aDataPtrLimit);
00047 };
00048
00049
00050
00051
00052
00053 const TInt KPngDepth2PixelsPerByte = 4;
00054 const TInt KPngDepth2RoundUpValue = 3;
00055 const TInt KPngDepth2ShiftValue = 2;
00056 class CBitDepth2Encoder : public CPngWriteSubCodec
00057 {
00058 private:
00059 virtual void DoConstructL();
00060 virtual TInt ScanlineBufferSize(TInt aPixelLength);
00061 virtual void DoEncode(const CFbsBitmap* aSource, const TInt aScanline,
00062 TUint8* aDataPtr, const TUint8* aDataPtrLimit);
00063 };
00064
00065
00066
00067
00068
00069 const TInt KPngDepth4PixelsPerByte = 2;
00070 const TInt KPngDepth4RoundUpValue = 1;
00071 const TInt KPngDepth4ShiftValue = 4;
00072 class CBitDepth4Encoder : public CPngWriteSubCodec
00073 {
00074 private:
00075 virtual void DoConstructL();
00076 virtual TInt ScanlineBufferSize(TInt aPixelLength);
00077 virtual void DoEncode(const CFbsBitmap* aSource, const TInt aScanline,
00078 TUint8* aDataPtr, const TUint8* aDataPtrLimit);
00079 };
00080
00081
00082
00083
00084 const TInt KPngDepth8RgbBytesPerPixel = 3;
00085 class CBitDepth8ColorType2Encoder : public CPngWriteSubCodec
00086 {
00087 private:
00088 virtual TInt ScanlineBufferSize(TInt aPixelLength);
00089 virtual void DoEncode(const CFbsBitmap* aSource, const TInt aScanline,
00090 TUint8* aDataPtr, const TUint8* aDataPtrLimit);
00091 };
00092
00093
00094
00095
00096
00097 const TInt KPngDepth8PixelsPerByte = 1;
00098 const TInt KPngDepth8ShiftValue = 0;
00099 class CBitDepth8Encoder : public CPngWriteSubCodec
00100 {
00101 private:
00102 virtual void DoConstructL();
00103 virtual TInt ScanlineBufferSize(TInt aPixelLength);
00104 virtual void DoEncode(const CFbsBitmap* aSource, const TInt aScanline,
00105 TUint8* aDataPtr, const TUint8* aDataPtrLimit);
00106 };
00107
00108 #endif // __PNGSCANLINEENCODER_H__