PageRenderTime 24ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLIMAGEBMP_H
  27. #define LL_LLIMAGEBMP_H
  28. #include "llimage.h"
  29. // This class compresses and decompressed BMP files
  30. class LLImageBMP : public LLImageFormatted
  31. {
  32. protected:
  33. virtual ~LLImageBMP();
  34. public:
  35. LLImageBMP();
  36. /*virtual*/ std::string getExtension() { return std::string("bmp"); }
  37. /*virtual*/ BOOL updateData();
  38. /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
  39. /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
  40. protected:
  41. BOOL decodeColorTable8( U8* dst, U8* src );
  42. BOOL decodeColorMask16( U8* dst, U8* src );
  43. BOOL decodeTruecolor24( U8* dst, U8* src );
  44. BOOL decodeColorMask32( U8* dst, U8* src );
  45. U32 countTrailingZeros( U32 m );
  46. protected:
  47. S32 mColorPaletteColors;
  48. U8* mColorPalette;
  49. S32 mBitmapOffset;
  50. S32 mBitsPerPixel;
  51. U32 mBitfieldMask[4]; // rgba
  52. BOOL mOriginAtTop;
  53. };
  54. #endif