From fc715c3c1d9c9c623c36ae9fc8b8aac0362e4c22 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Fri, 31 Mar 2017 10:22:11 -0400 Subject: Split fx_dib part 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move CFX_DIBSource to its own file. Also move the classes that inherit from it to their own headers. Their cpp's will be added in followup. Change-Id: Id2b53e124ea5445c558bfcf627bf526870cc92e8 Reviewed-on: https://pdfium-review.googlesource.com/3450 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña --- core/fxge/dib/cfx_filtereddib.h | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 core/fxge/dib/cfx_filtereddib.h (limited to 'core/fxge/dib/cfx_filtereddib.h') diff --git a/core/fxge/dib/cfx_filtereddib.h b/core/fxge/dib/cfx_filtereddib.h new file mode 100644 index 0000000000..3a16bb0750 --- /dev/null +++ b/core/fxge/dib/cfx_filtereddib.h @@ -0,0 +1,50 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXGE_DIB_CFX_FILTEREDDIB_H_ +#define CORE_FXGE_DIB_CFX_FILTEREDDIB_H_ + +#include + +#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxge/dib/cfx_dibsource.h" + +class CFX_FilteredDIB : public CFX_DIBSource { + public: + template + friend CFX_RetainPtr pdfium::MakeRetain(Args&&... args); + + ~CFX_FilteredDIB() override; + + virtual FXDIB_Format GetDestFormat() = 0; + virtual uint32_t* GetDestPalette() = 0; + virtual void TranslateScanline(const uint8_t* src_buf, + std::vector* dest_buf) const = 0; + virtual void TranslateDownSamples(uint8_t* dest_buf, + const uint8_t* src_buf, + int pixels, + int Bpp) const = 0; + + void LoadSrc(const CFX_RetainPtr& pSrc); + + protected: + CFX_FilteredDIB(); + + // CFX_DIBSource + const uint8_t* GetScanline(int line) const override; + void DownSampleScanline(int line, + uint8_t* dest_scan, + int dest_bpp, + int dest_width, + bool bFlipX, + int clip_left, + int clip_width) const override; + + CFX_RetainPtr m_pSrc; + mutable std::vector m_Scanline; +}; + +#endif // CORE_FXGE_DIB_CFX_FILTEREDDIB_H_ -- cgit v1.2.3