gfxconversion/mifconv/inc/mifconv_mbmgenerator_bmtopbm.h
branchRCL_3
changeset 9 1f6339ced17d
equal deleted inserted replaced
4:23f0e6a5b752 9:1f6339ced17d
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MIFCONVMBMGENERATORBMTOPBM_H__
       
    19 #define __MIFCONVMBMGENERATORBMTOPBM_H__
       
    20 
       
    21 #include "mifconv_mbmgenerator.h"
       
    22 #include "mifconv.h"
       
    23 
       
    24 struct TRgbQuad
       
    25     {
       
    26     unsigned char iBlue;
       
    27     unsigned char iGreen;
       
    28     unsigned char iRed;
       
    29     unsigned char iReserved;
       
    30     };
       
    31 
       
    32 class BitmapLoader
       
    33     {
       
    34 public:
       
    35     BitmapLoader();
       
    36     ~BitmapLoader();
       
    37     int LoadBitmap(MifConvSourceFile& aFileName,int aBpp,TBitmapColor aColor,SEpocBitmapHeader*& aPbm);
       
    38 private:
       
    39     int DoLoad(const char* aFileName);
       
    40     int DoLoadAlpha(MifConvString& aAlphaFileName);
       
    41     int DoConvert(int aBpp,TBitmapColor aColor,SEpocBitmapHeader*& aPbm);
       
    42     TRgb GetBmpPixel(long aXCoord,long aYCoord);
       
    43     unsigned char GetAlphaPixel(long aXCoord,long aYCoord);
       
    44 private:
       
    45     MifConvSourceFile* iSourceFile;
       
    46     TBitmapInfoHeader iBmpHeader;
       
    47     int iNumBmpColors;
       
    48     TRgbQuad* iBmpColors;
       
    49     char* iBmpBits;
       
    50     char* iAlphaBits;
       
    51     };
       
    52 
       
    53 #endif