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_FXGE_INCLUDE_FX_DIB_H_ | 7 #ifndef CORE_FXGE_INCLUDE_FX_DIB_H_ |
8 #define CORE_FXGE_INCLUDE_FX_DIB_H_ | 8 #define CORE_FXGE_INCLUDE_FX_DIB_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 int m_bpp; | 249 int m_bpp; |
250 uint32_t m_AlphaFlag; | 250 uint32_t m_AlphaFlag; |
251 uint32_t m_Pitch; | 251 uint32_t m_Pitch; |
252 uint32_t* m_pPalette; | 252 uint32_t* m_pPalette; |
253 | 253 |
254 void BuildPalette(); | 254 void BuildPalette(); |
255 FX_BOOL BuildAlphaMask(); | 255 FX_BOOL BuildAlphaMask(); |
256 int FindPalette(uint32_t color) const; | 256 int FindPalette(uint32_t color) const; |
257 void GetPalette(uint32_t* pal, int alpha) const; | 257 void GetPalette(uint32_t* pal, int alpha) const; |
258 }; | 258 }; |
| 259 |
259 class CFX_DIBitmap : public CFX_DIBSource { | 260 class CFX_DIBitmap : public CFX_DIBSource { |
260 public: | 261 public: |
261 CFX_DIBitmap(); | 262 CFX_DIBitmap(); |
262 explicit CFX_DIBitmap(const CFX_DIBitmap& src); | 263 explicit CFX_DIBitmap(const CFX_DIBitmap& src); |
263 ~CFX_DIBitmap() override; | 264 ~CFX_DIBitmap() override; |
264 | 265 |
265 FX_BOOL Create(int width, | 266 FX_BOOL Create(int width, |
266 int height, | 267 int height, |
267 FXDIB_Format format, | 268 FXDIB_Format format, |
268 uint8_t* pBuffer = NULL, | 269 uint8_t* pBuffer = NULL, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 FX_BOOL CompositeRect(int dest_left, | 351 FX_BOOL CompositeRect(int dest_left, |
351 int dest_top, | 352 int dest_top, |
352 int width, | 353 int width, |
353 int height, | 354 int height, |
354 uint32_t color, | 355 uint32_t color, |
355 int alpha_flag = 0, | 356 int alpha_flag = 0, |
356 void* pIccTransform = NULL); | 357 void* pIccTransform = NULL); |
357 | 358 |
358 FX_BOOL ConvertColorScale(uint32_t forecolor, uint32_t backcolor); | 359 FX_BOOL ConvertColorScale(uint32_t forecolor, uint32_t backcolor); |
359 | 360 |
360 FX_BOOL DitherFS(const uint32_t* pPalette, | 361 protected: |
361 int pal_size, | 362 FX_BOOL GetGrayData(void* pIccTransform = NULL); |
362 const FX_RECT* pRect = NULL); | |
363 | 363 |
364 protected: | |
365 uint8_t* m_pBuffer; | 364 uint8_t* m_pBuffer; |
| 365 FX_BOOL m_bExtBuf; |
| 366 }; |
366 | 367 |
367 FX_BOOL m_bExtBuf; | |
368 | |
369 FX_BOOL GetGrayData(void* pIccTransform = NULL); | |
370 }; | |
371 class CFX_DIBExtractor { | 368 class CFX_DIBExtractor { |
372 public: | 369 public: |
373 CFX_DIBExtractor(const CFX_DIBSource* pSrc); | 370 CFX_DIBExtractor(const CFX_DIBSource* pSrc); |
374 | 371 |
375 ~CFX_DIBExtractor(); | 372 ~CFX_DIBExtractor(); |
376 | 373 |
377 operator CFX_DIBitmap*() { return m_pBitmap; } | 374 operator CFX_DIBitmap*() { return m_pBitmap; } |
378 | 375 |
379 private: | 376 private: |
380 CFX_DIBitmap* m_pBitmap; | 377 CFX_DIBitmap* m_pBitmap; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 int m_Status; | 659 int m_Status; |
663 FX_RECT m_ClipBox; | 660 FX_RECT m_ClipBox; |
664 uint32_t m_Flags; | 661 uint32_t m_Flags; |
665 int m_AlphaFlag; | 662 int m_AlphaFlag; |
666 void* m_pIccTransform; | 663 void* m_pIccTransform; |
667 FX_BOOL m_bRgbByteOrder; | 664 FX_BOOL m_bRgbByteOrder; |
668 int m_BlendType; | 665 int m_BlendType; |
669 }; | 666 }; |
670 | 667 |
671 #endif // CORE_FXGE_INCLUDE_FX_DIB_H_ | 668 #endif // CORE_FXGE_INCLUDE_FX_DIB_H_ |
OLD | NEW |