PageRenderTime 404ms CodeModel.GetById 121ms app.highlight 4ms RepoModel.GetById 162ms app.codeStats 56ms

/indra/llimage/llimagebmp.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 64 lines | 28 code | 10 blank | 26 comment | 0 complexity | f6e840439ad4a70c07cbae99c188b808 MD5 | raw file
 1/** 
 2 * @file llimagebmp.h
 3 * @brief Image implementation for BMP.
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLIMAGEBMP_H
28#define LL_LLIMAGEBMP_H
29
30#include "llimage.h"
31
32// This class compresses and decompressed BMP files
33
34class LLImageBMP : public LLImageFormatted
35{
36protected:
37	virtual ~LLImageBMP();
38	
39public:
40	LLImageBMP();
41
42	/*virtual*/ std::string getExtension() { return std::string("bmp"); }
43	/*virtual*/ BOOL updateData();
44	/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
45	/*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
46
47protected:
48	BOOL		decodeColorTable8( U8* dst, U8* src );
49	BOOL		decodeColorMask16( U8* dst, U8* src );
50	BOOL		decodeTruecolor24( U8* dst, U8* src );
51	BOOL		decodeColorMask32( U8* dst, U8* src );
52
53	U32			countTrailingZeros( U32 m );
54
55protected:
56	S32			mColorPaletteColors;
57	U8*			mColorPalette;
58	S32			mBitmapOffset;
59	S32			mBitsPerPixel;
60	U32			mBitfieldMask[4]; // rgba
61	BOOL		mOriginAtTop;
62};
63
64#endif