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_FX_DIB_H_ | 7 #ifndef CORE_FXGE_FX_DIB_H_ |
8 #define CORE_FXGE_FX_DIB_H_ | 8 #define CORE_FXGE_FX_DIB_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 uint32_t GetPaletteEntry(int index) const; | 208 uint32_t GetPaletteEntry(int index) const; |
209 | 209 |
210 void SetPaletteEntry(int index, uint32_t color); | 210 void SetPaletteEntry(int index, uint32_t color); |
211 uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); } | 211 uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); } |
212 void SetPaletteArgb(int index, uint32_t color) { | 212 void SetPaletteArgb(int index, uint32_t color) { |
213 SetPaletteEntry(index, color); | 213 SetPaletteEntry(index, color); |
214 } | 214 } |
215 | 215 |
216 void CopyPalette(const uint32_t* pSrcPal); | 216 void CopyPalette(const uint32_t* pSrcPal); |
217 | 217 |
218 CFX_DIBitmap* Clone(const FX_RECT* pClip = nullptr) const; | 218 std::unique_ptr<CFX_DIBitmap> Clone(const FX_RECT* pClip = nullptr) const; |
219 CFX_DIBitmap* CloneConvert(FXDIB_Format format) const; | 219 std::unique_ptr<CFX_DIBitmap> CloneConvert(FXDIB_Format format) const; |
220 | 220 |
221 CFX_DIBitmap* StretchTo(int dest_width, | 221 std::unique_ptr<CFX_DIBitmap> StretchTo(int dest_width, |
222 int dest_height, | 222 int dest_height, |
223 uint32_t flags = 0, | 223 uint32_t flags = 0, |
224 const FX_RECT* pClip = nullptr) const; | 224 const FX_RECT* pClip = nullptr) const; |
225 CFX_DIBitmap* TransformTo(const CFX_Matrix* pMatrix, | 225 std::unique_ptr<CFX_DIBitmap> TransformTo( |
226 int& left, | 226 const CFX_Matrix* pMatrix, |
227 int& top, | 227 int& left, |
228 uint32_t flags = 0, | 228 int& top, |
229 const FX_RECT* pClip = nullptr) const; | 229 uint32_t flags = 0, |
| 230 const FX_RECT* pClip = nullptr) const; |
230 | 231 |
231 CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = nullptr) const; | 232 CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = nullptr) const; |
232 bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, | 233 bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, |
233 const FX_RECT* pClip = nullptr); | 234 const FX_RECT* pClip = nullptr); |
234 | 235 |
235 CFX_DIBitmap* SwapXY(bool bXFlip, | 236 CFX_DIBitmap* SwapXY(bool bXFlip, |
236 bool bYFlip, | 237 bool bYFlip, |
237 const FX_RECT* pClip = nullptr) const; | 238 const FX_RECT* pClip = nullptr) const; |
238 | 239 |
239 CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const; | 240 CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 301 |
301 bool ConvertFormat(FXDIB_Format format); | 302 bool ConvertFormat(FXDIB_Format format); |
302 | 303 |
303 void Clear(uint32_t color); | 304 void Clear(uint32_t color); |
304 | 305 |
305 uint32_t GetPixel(int x, int y) const; | 306 uint32_t GetPixel(int x, int y) const; |
306 | 307 |
307 void SetPixel(int x, int y, uint32_t color); | 308 void SetPixel(int x, int y, uint32_t color); |
308 | 309 |
309 bool LoadChannel(FXDIB_Channel destChannel, | 310 bool LoadChannel(FXDIB_Channel destChannel, |
310 const CFX_DIBSource* pSrcBitmap, | 311 CFX_DIBSource* pSrcBitmap, |
311 FXDIB_Channel srcChannel); | 312 FXDIB_Channel srcChannel); |
312 | 313 |
313 bool LoadChannel(FXDIB_Channel destChannel, int value); | 314 bool LoadChannel(FXDIB_Channel destChannel, int value); |
314 | 315 |
315 bool MultiplyAlpha(int alpha); | 316 bool MultiplyAlpha(int alpha); |
316 | 317 |
317 bool MultiplyAlpha(const CFX_DIBSource* pAlphaMask); | 318 bool MultiplyAlpha(CFX_DIBSource* pAlphaMask); |
318 | 319 |
319 bool TransferBitmap(int dest_left, | 320 bool TransferBitmap(int dest_left, |
320 int dest_top, | 321 int dest_top, |
321 int width, | 322 int width, |
322 int height, | 323 int height, |
323 const CFX_DIBSource* pSrcBitmap, | 324 const CFX_DIBSource* pSrcBitmap, |
324 int src_left, | 325 int src_left, |
325 int src_top); | 326 int src_top); |
326 | 327 |
327 bool CompositeBitmap(int dest_left, | 328 bool CompositeBitmap(int dest_left, |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 int m_Status; | 686 int m_Status; |
686 FX_RECT m_ClipBox; | 687 FX_RECT m_ClipBox; |
687 uint32_t m_Flags; | 688 uint32_t m_Flags; |
688 int m_AlphaFlag; | 689 int m_AlphaFlag; |
689 void* m_pIccTransform; | 690 void* m_pIccTransform; |
690 bool m_bRgbByteOrder; | 691 bool m_bRgbByteOrder; |
691 int m_BlendType; | 692 int m_BlendType; |
692 }; | 693 }; |
693 | 694 |
694 #endif // CORE_FXGE_FX_DIB_H_ | 695 #endif // CORE_FXGE_FX_DIB_H_ |
OLD | NEW |