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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 551 |
552 class CFX_BitmapStorer : public IFX_ScanlineComposer { | 552 class CFX_BitmapStorer : public IFX_ScanlineComposer { |
553 public: | 553 public: |
554 CFX_BitmapStorer(); | 554 CFX_BitmapStorer(); |
555 ~CFX_BitmapStorer() override; | 555 ~CFX_BitmapStorer() override; |
556 | 556 |
557 // IFX_ScanlineComposer | 557 // IFX_ScanlineComposer |
558 void ComposeScanline(int line, | 558 void ComposeScanline(int line, |
559 const uint8_t* scanline, | 559 const uint8_t* scanline, |
560 const uint8_t* scan_extra_alpha) override; | 560 const uint8_t* scan_extra_alpha) override; |
561 | |
562 FX_BOOL SetInfo(int width, | 561 FX_BOOL SetInfo(int width, |
563 int height, | 562 int height, |
564 FXDIB_Format src_format, | 563 FXDIB_Format src_format, |
565 uint32_t* pSrcPalette) override; | 564 uint32_t* pSrcPalette) override; |
566 | 565 |
567 CFX_DIBitmap* GetBitmap() { return m_pBitmap; } | 566 CFX_DIBitmap* GetBitmap() { return m_pBitmap.get(); } |
568 | 567 std::unique_ptr<CFX_DIBitmap> Detach(); |
569 CFX_DIBitmap* Detach(); | 568 void Replace(std::unique_ptr<CFX_DIBitmap> pBitmap); |
570 | |
571 void Replace(CFX_DIBitmap* pBitmap); | |
572 | 569 |
573 private: | 570 private: |
574 CFX_DIBitmap* m_pBitmap; | 571 std::unique_ptr<CFX_DIBitmap> m_pBitmap; |
575 }; | 572 }; |
576 | 573 |
577 class CFX_ImageStretcher { | 574 class CFX_ImageStretcher { |
578 public: | 575 public: |
579 CFX_ImageStretcher(IFX_ScanlineComposer* pDest, | 576 CFX_ImageStretcher(IFX_ScanlineComposer* pDest, |
580 const CFX_DIBSource* pSource, | 577 const CFX_DIBSource* pSource, |
581 int dest_width, | 578 int dest_width, |
582 int dest_height, | 579 int dest_height, |
583 const FX_RECT& bitmap_rect, | 580 const FX_RECT& bitmap_rect, |
584 uint32_t flags); | 581 uint32_t flags); |
(...skipping 21 matching lines...) Expand all Loading... |
606 int m_DestWidth; | 603 int m_DestWidth; |
607 int m_DestHeight; | 604 int m_DestHeight; |
608 FX_RECT m_ClipRect; | 605 FX_RECT m_ClipRect; |
609 const FXDIB_Format m_DestFormat; | 606 const FXDIB_Format m_DestFormat; |
610 const int m_DestBPP; | 607 const int m_DestBPP; |
611 int m_LineIndex; | 608 int m_LineIndex; |
612 }; | 609 }; |
613 | 610 |
614 class CFX_ImageTransformer { | 611 class CFX_ImageTransformer { |
615 public: | 612 public: |
616 CFX_ImageTransformer(); | 613 CFX_ImageTransformer(const CFX_DIBSource* pSrc, |
| 614 const CFX_Matrix* pMatrix, |
| 615 int flags, |
| 616 const FX_RECT* pClip); |
617 ~CFX_ImageTransformer(); | 617 ~CFX_ImageTransformer(); |
618 | 618 |
619 FX_BOOL Start(const CFX_DIBSource* pSrc, | 619 FX_BOOL Start(); |
620 const CFX_Matrix* pMatrix, | |
621 int flags, | |
622 const FX_RECT* pClip); | |
623 | |
624 FX_BOOL Continue(IFX_Pause* pPause); | 620 FX_BOOL Continue(IFX_Pause* pPause); |
625 | 621 |
626 CFX_Matrix* m_pMatrix; | 622 const FX_RECT& result() const { return m_result; } |
| 623 std::unique_ptr<CFX_DIBitmap> DetachBitmap(); |
| 624 |
| 625 private: |
| 626 const CFX_DIBSource* const m_pSrc; |
| 627 const CFX_Matrix* const m_pMatrix; |
| 628 const FX_RECT* const m_pClip; |
627 FX_RECT m_StretchClip; | 629 FX_RECT m_StretchClip; |
628 int m_ResultLeft; | 630 FX_RECT m_result; |
629 int m_ResultTop; | |
630 int m_ResultWidth; | |
631 int m_ResultHeight; | |
632 CFX_Matrix m_dest2stretch; | 631 CFX_Matrix m_dest2stretch; |
633 std::unique_ptr<CFX_ImageStretcher> m_Stretcher; | 632 std::unique_ptr<CFX_ImageStretcher> m_Stretcher; |
634 CFX_BitmapStorer m_Storer; | 633 CFX_BitmapStorer m_Storer; |
635 uint32_t m_Flags; | 634 const uint32_t m_Flags; |
636 int m_Status; | 635 int m_Status; |
637 }; | 636 }; |
638 | 637 |
639 class CFX_ImageRenderer { | 638 class CFX_ImageRenderer { |
640 public: | 639 public: |
641 CFX_ImageRenderer(); | 640 CFX_ImageRenderer(); |
642 ~CFX_ImageRenderer(); | 641 ~CFX_ImageRenderer(); |
643 | 642 |
644 FX_BOOL Start(CFX_DIBitmap* pDevice, | 643 FX_BOOL Start(CFX_DIBitmap* pDevice, |
645 const CFX_ClipRgn* pClipRgn, | 644 const CFX_ClipRgn* pClipRgn, |
(...skipping 21 matching lines...) Expand all Loading... |
667 int m_Status; | 666 int m_Status; |
668 FX_RECT m_ClipBox; | 667 FX_RECT m_ClipBox; |
669 uint32_t m_Flags; | 668 uint32_t m_Flags; |
670 int m_AlphaFlag; | 669 int m_AlphaFlag; |
671 void* m_pIccTransform; | 670 void* m_pIccTransform; |
672 FX_BOOL m_bRgbByteOrder; | 671 FX_BOOL m_bRgbByteOrder; |
673 int m_BlendType; | 672 int m_BlendType; |
674 }; | 673 }; |
675 | 674 |
676 #endif // CORE_FXGE_INCLUDE_FX_DIB_H_ | 675 #endif // CORE_FXGE_INCLUDE_FX_DIB_H_ |
OLD | NEW |