gfxconversion/mifconv/inc/mifconv_mbmgenerator_bmtopbm.h
branchRCL_3
changeset 9 1f6339ced17d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gfxconversion/mifconv/inc/mifconv_mbmgenerator_bmtopbm.h	Mon Mar 15 12:42:44 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __MIFCONVMBMGENERATORBMTOPBM_H__
+#define __MIFCONVMBMGENERATORBMTOPBM_H__
+
+#include "mifconv_mbmgenerator.h"
+#include "mifconv.h"
+
+struct TRgbQuad
+    {
+    unsigned char iBlue;
+    unsigned char iGreen;
+    unsigned char iRed;
+    unsigned char iReserved;
+    };
+
+class BitmapLoader
+    {
+public:
+    BitmapLoader();
+    ~BitmapLoader();
+    int LoadBitmap(MifConvSourceFile& aFileName,int aBpp,TBitmapColor aColor,SEpocBitmapHeader*& aPbm);
+private:
+    int DoLoad(const char* aFileName);
+    int DoLoadAlpha(MifConvString& aAlphaFileName);
+    int DoConvert(int aBpp,TBitmapColor aColor,SEpocBitmapHeader*& aPbm);
+    TRgb GetBmpPixel(long aXCoord,long aYCoord);
+    unsigned char GetAlphaPixel(long aXCoord,long aYCoord);
+private:
+    MifConvSourceFile* iSourceFile;
+    TBitmapInfoHeader iBmpHeader;
+    int iNumBmpColors;
+    TRgbQuad* iBmpColors;
+    char* iBmpBits;
+    char* iAlphaBits;
+    };
+
+#endif