OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef IMAGE_CODEC_BMPDECODERHELPER_H__ | 10 #ifndef IMAGE_CODEC_BMPDECODERHELPER_H__ |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 private: | 66 private: |
67 DISALLOW_EVIL_CONSTRUCTORS(BmpDecoderCallback); | 67 DISALLOW_EVIL_CONSTRUCTORS(BmpDecoderCallback); |
68 }; | 68 }; |
69 | 69 |
70 class BmpDecoderHelper { | 70 class BmpDecoderHelper { |
71 public: | 71 public: |
72 BmpDecoderHelper() { } | 72 BmpDecoderHelper() { } |
73 ~BmpDecoderHelper() { } | 73 ~BmpDecoderHelper() { } |
74 bool DecodeImage(const char* data, | 74 bool DecodeImage(const char* data, |
75 int len, | 75 size_t len, |
76 int max_pixels, | 76 int max_pixels, |
77 BmpDecoderCallback* callback); | 77 BmpDecoderCallback* callback); |
78 | 78 |
79 private: | 79 private: |
80 DISALLOW_EVIL_CONSTRUCTORS(BmpDecoderHelper); | 80 DISALLOW_EVIL_CONSTRUCTORS(BmpDecoderHelper); |
81 | 81 |
82 void DoRLEDecode(); | 82 void DoRLEDecode(); |
83 void DoStandardDecode(); | 83 void DoStandardDecode(); |
84 void PutPixel(int x, int y, uint8 col); | 84 void PutPixel(int x, int y, uint8 col); |
85 | 85 |
86 int GetInt(); | 86 int GetInt(); |
87 int GetShort(); | 87 int GetShort(); |
88 uint8 GetByte(); | 88 uint8 GetByte(); |
89 int CalcShiftRight(uint32 mask); | 89 int CalcShiftRight(uint32 mask); |
90 int CalcShiftLeft(uint32 mask); | 90 int CalcShiftLeft(uint32 mask); |
91 | 91 |
92 const uint8* data_; | 92 const uint8* data_; |
93 int pos_; | 93 size_t pos_; |
94 int len_; | 94 size_t len_; |
95 int width_; | 95 int width_; |
96 int height_; | 96 int height_; |
97 int bpp_; | 97 int bpp_; |
98 int pixelPad_; | 98 int pixelPad_; |
99 int rowPad_; | 99 int rowPad_; |
100 scoped_array<uint8> colTab_; | 100 scoped_array<uint8> colTab_; |
101 uint32 redBits_; | 101 uint32 redBits_; |
102 uint32 greenBits_; | 102 uint32 greenBits_; |
103 uint32 blueBits_; | 103 uint32 blueBits_; |
104 int redShiftRight_; | 104 int redShiftRight_; |
105 int greenShiftRight_; | 105 int greenShiftRight_; |
106 int blueShiftRight_; | 106 int blueShiftRight_; |
107 int redShiftLeft_; | 107 int redShiftLeft_; |
108 int greenShiftLeft_; | 108 int greenShiftLeft_; |
109 int blueShiftLeft_; | 109 int blueShiftLeft_; |
110 uint8* output_; | 110 uint8* output_; |
111 bool inverted_; | 111 bool inverted_; |
112 }; | 112 }; |
113 | 113 |
114 } // namespace | 114 } // namespace |
115 | 115 |
116 #endif | 116 #endif |
OLD | NEW |