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