7#ifndef CORE_FXGE_DIB_CFX_DIBBASE_H_
8#define CORE_FXGE_DIB_CFX_DIBBASE_H_
12#include "build/build_config.h"
13#include "core/fxcrt/data_vector.h"
14#include "core/fxcrt/retain_ptr.h"
15#include "core/fxge/dib/fx_dib.h"
16#include "third_party/base/containers/span.h"
18#if defined(PDF_USE_SKIA)
19#include "third_party/skia/include/core/SkRefCnt.h"
28#if defined(PDF_USE_SKIA)
35#if BUILDFLAG(IS_APPLE)
44 virtual pdfium::span<
const uint8_t>
GetScanline(
int line)
const = 0;
47#if BUILDFLAG(IS_WIN) || defined(PDF_USE_SKIA)
69 void SetPalette(pdfium::span<
const uint32_t> src_palette);
99#if defined(PDF_USE_SKIA)
114 pdfium::span<uint8_t> dest_buf,
122#if defined(PDF_USE_SKIA)
int FindPalette(uint32_t color) const
static constexpr FXDIB_Format kPlatformRGBFormat
virtual size_t GetEstimatedImageMemoryBurden() const
RetainPtr< CFX_DIBitmap > ClipTo(const FX_RECT &rect) const
RetainPtr< CFX_DIBitmap > Realize() const
RetainPtr< CFX_DIBitmap > SwapXY(bool bXFlip, bool bYFlip) const
void TakePalette(DataVector< uint32_t > src_palette)
virtual pdfium::span< const uint8_t > GetScanline(int line) const =0
virtual bool SkipToScanline(int line, PauseIndicatorIface *pPause) const
RetainPtr< CFX_DIBitmap > CloneAlphaMask() const
void SetPalette(pdfium::span< const uint32_t > src_palette)
FXDIB_Format GetFormat() const
bool GetOverlapRect(int &dest_left, int &dest_top, int &width, int &height, int src_width, int src_height, int &src_left, int &src_top, const CFX_ClipRgn *pClipRgn) const
bool IsAlphaFormat() const
RetainPtr< CFX_DIBitmap > TransformTo(const CFX_Matrix &mtDest, int *left, int *top) const
bool IsOpaqueImage() const
DataVector< uint32_t > m_palette
void SetPaletteArgb(int index, uint32_t color)
uint32_t GetPitch() const
RetainPtr< CFX_DIBitmap > ClipToInternal(const FX_RECT *pClip) const
RetainPtr< CFX_DIBitmap > ConvertTo(FXDIB_Format format) const
RetainPtr< CFX_DIBitmap > StretchTo(int dest_width, int dest_height, const FXDIB_ResampleOptions &options, const FX_RECT *pClip) const
static constexpr uint32_t kPaletteSize
size_t GetRequiredPaletteSize() const
bool IsMaskFormat() const
pdfium::span< const uint32_t > GetPaletteSpan() const
static DataVector< uint32_t > ConvertBuffer(FXDIB_Format dest_format, pdfium::span< uint8_t > dest_buf, int dest_pitch, int width, int height, const RetainPtr< const CFX_DIBBase > &pSrcBitmap, int src_left, int src_top)
RetainPtr< CFX_DIBitmap > FlipImage(bool bXFlip, bool bYFlip) const
uint32_t GetPaletteArgb(int index) const
bool TransferBitmap(int dest_left, int dest_top, int width, int height, RetainPtr< const CFX_DIBBase > source, int src_left, int src_top)
bool SetAlphaFromBitmap(RetainPtr< const CFX_DIBBase > source)
bool SetUniformOpaqueAlpha()
bool Create(int width, int height, FXDIB_Format format)
pdfium::span< const uint8_t > GetBuffer() const
static absl::optional< PitchAndSize > CalculatePitchAndSize(int width, int height, FXDIB_Format format, uint32_t pitch)
bool CompositeMask(int dest_left, int dest_top, int width, int height, const RetainPtr< const CFX_DIBBase > &pMask, uint32_t color, int src_left, int src_top, BlendMode blend_type, const CFX_ClipRgn *pClipRgn, bool bRgbByteOrder)
bool SetRedFromBitmap(RetainPtr< const CFX_DIBBase > source)
bool MultiplyAlphaMask(RetainPtr< const CFX_DIBBase > source)
pdfium::span< uint8_t > GetWritableScanline(int line)
bool CompositeBitmap(int dest_left, int dest_top, int width, int height, RetainPtr< const CFX_DIBBase > source, int src_left, int src_top, BlendMode blend_type, const CFX_ClipRgn *pClipRgn, bool bRgbByteOrder)
bool ConvertColorScale(uint32_t forecolor, uint32_t backcolor)
bool ConvertFormat(FXDIB_Format format)
bool CompositeRect(int dest_left, int dest_top, int width, int height, uint32_t color)
pdfium::span< const uint8_t > GetScanline(int line) const override
size_t GetEstimatedImageMemoryBurden() const override
bool MultiplyAlpha(float alpha)
pdfium::span< uint8_t > GetWritableBuffer()
bool Create(int width, int height, FXDIB_Format format, uint8_t *pBuffer, uint32_t pitch)
void TakeOver(RetainPtr< CFX_DIBitmap > &&pSrcBitmap)
void Clear(uint32_t color)
bool Copy(RetainPtr< const CFX_DIBBase > source)
void CompositeOneBPPMask(int dest_left, int dest_top, int width, int height, RetainPtr< const CFX_DIBBase > source, int src_left, int src_top)
FX_RECT ToRoundedFxRect() const
CFX_FloatRect(const FX_RECT &rect)
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
const CFX_Matrix & matrix() const
static float TextUnitToGlyphUnit(float fTextUnit)
void Transform(CPDF_Font::FormIface *pForm, const CFX_Matrix &matrix)
void InitializeFromStreamData(bool bColored, pdfium::span< const float > pData)
RetainPtr< CFX_DIBitmap > GetBitmap()
static void TextUnitRectToGlyphUnitRect(CFX_FloatRect *pRect)
const FX_RECT & bbox() const
const CPDF_Font::FormIface * form() const
bool LoadBitmapFromSoleImageOfForm()
void SetForm(std::unique_ptr< CPDF_Font::FormIface > pForm)
MaybeOwned(OwnedType ptr)
MaybeOwned & operator=(const MaybeOwned &that)=delete
void Reset(T *ptr=nullptr)
MaybeOwned & operator=(const UnownedType &ptr)
bool operator==(const OwnedType &ptr) const
MaybeOwned & operator=(MaybeOwned &&that) noexcept=default
MaybeOwned(const MaybeOwned &that)=delete
bool operator==(const MaybeOwned &that) const
bool operator!=(const MaybeOwned &that) const
bool operator!=(T *ptr) const
MaybeOwned & operator=(T *ptr)
bool operator!=(const OwnedType ptr) const
OwnedType ReleaseAndClear()
MaybeOwned & operator=(OwnedType ptr)
MaybeOwned(MaybeOwned &&that) noexcept=default
MaybeOwned(const UnownedType &ptr)
void Reset(OwnedType ptr)
bool operator==(T *ptr) const
bool GetIsMaskFromFormat(FXDIB_Format format)
int GetBppFromFormat(FXDIB_Format format)
#define CONSTRUCT_VIA_MAKE_RETAIN
FX_RECT & operator=(const FX_RECT &that)=default