OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FXGE_FX_DIB_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_DIB_H_ |
8 #define CORE_INCLUDE_FXGE_FX_DIB_H_ | 8 #define CORE_INCLUDE_FXGE_FX_DIB_H_ |
9 | 9 |
10 #include "../fxcrt/fx_basic.h" | 10 #include "../fxcrt/fx_basic.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 int dest_bpp, | 189 int dest_bpp, |
190 int dest_width, | 190 int dest_width, |
191 FX_BOOL bFlipX, | 191 FX_BOOL bFlipX, |
192 int clip_left, | 192 int clip_left, |
193 int clip_width) const = 0; | 193 int clip_width) const = 0; |
194 | 194 |
195 virtual void SetDownSampleSize(int width, int height) const {} | 195 virtual void SetDownSampleSize(int width, int height) const {} |
196 | 196 |
197 int GetBPP() const { return m_bpp; } | 197 int GetBPP() const { return m_bpp; } |
198 | 198 |
199 FX_BOOL IsAlphaMask() const { return m_AlphaFlag == 1; } | 199 FX_BOOL IsAlphaMask() const { return m_AlphaFlag == 1; } |
Tom Sepez
2015/10/15 17:08:31
This one feels wrong. If its a mask, all bits sho
Lei Zhang
2015/10/19 08:56:18
I looked at this briefly and added comments. With
| |
200 | 200 |
201 FX_BOOL HasAlpha() const { return m_AlphaFlag & 2 ? TRUE : FALSE; } | 201 FX_BOOL HasAlpha() const { return m_AlphaFlag & 2; } |
Tom Sepez
2015/10/15 17:08:31
Actually, what you want is { return !!(m_AlphaFlag
Lei Zhang
2015/10/19 08:56:18
Done.
| |
202 | 202 |
203 FX_BOOL IsOpaqueImage() const { return !(m_AlphaFlag & 3); } | 203 FX_BOOL IsOpaqueImage() const { return !(m_AlphaFlag & 3); } |
204 | 204 |
205 FX_BOOL IsCmykImage() const { return m_AlphaFlag & 4 ? TRUE : FALSE; } | 205 FX_BOOL IsCmykImage() const { return m_AlphaFlag & 4; } |
206 | 206 |
207 int GetPaletteSize() const { | 207 int GetPaletteSize() const { |
208 return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0)); | 208 return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0)); |
209 } | 209 } |
210 | 210 |
211 FX_DWORD GetPaletteEntry(int index) const; | 211 FX_DWORD GetPaletteEntry(int index) const; |
212 | 212 |
213 void SetPaletteEntry(int index, FX_DWORD color); | 213 void SetPaletteEntry(int index, FX_DWORD color); |
214 FX_DWORD GetPaletteArgb(int index) const { return GetPaletteEntry(index); } | 214 FX_DWORD GetPaletteArgb(int index) const { return GetPaletteEntry(index); } |
215 void SetPaletteArgb(int index, FX_DWORD color) { | 215 void SetPaletteArgb(int index, FX_DWORD color) { |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 int m_Status; | 685 int m_Status; |
686 FX_RECT m_ClipBox; | 686 FX_RECT m_ClipBox; |
687 FX_DWORD m_Flags; | 687 FX_DWORD m_Flags; |
688 int m_AlphaFlag; | 688 int m_AlphaFlag; |
689 void* m_pIccTransform; | 689 void* m_pIccTransform; |
690 FX_BOOL m_bRgbByteOrder; | 690 FX_BOOL m_bRgbByteOrder; |
691 int m_BlendType; | 691 int m_BlendType; |
692 }; | 692 }; |
693 | 693 |
694 #endif // CORE_INCLUDE_FXGE_FX_DIB_H_ | 694 #endif // CORE_INCLUDE_FXGE_FX_DIB_H_ |
OLD | NEW |