Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_indexedcs.h
Go to the documentation of this file.
1// Copyright 2022 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CORE_FPDFAPI_PAGE_CPDF_INDEXEDCS_H_
6#define CORE_FPDFAPI_PAGE_CPDF_INDEXEDCS_H_
7
8#include <stdint.h>
9
10#include <set>
11
12#include "core/fpdfapi/page/cpdf_basedcs.h"
13#include "core/fxcrt/data_vector.h"
14#include "core/fxcrt/fx_memory_wrappers.h"
15#include "core/fxcrt/retain_ptr.h"
16
17class CPDF_Document;
18
20 float min;
21 float max;
22};
24
25class CPDF_IndexedCS final : public CPDF_BasedCS {
26 public:
28 ~CPDF_IndexedCS() override;
29
30 // CPDF_ColorSpace:
31 std::optional<FX_RGB_STRUCT<float>> GetRGB(
32 pdfium::span<const float> pBuf) const override;
33 const CPDF_IndexedCS* AsIndexedCS() const override;
34 uint32_t v_Load(CPDF_Document* pDoc,
35 const CPDF_Array* pArray,
36 std::set<const CPDF_Object*>* pVisited) override;
37
38 int GetMaxIndex() const { return max_index_; }
39
40 private:
41 CPDF_IndexedCS();
42
43 int max_index_ = 0;
44 DataVector<uint8_t> lookup_table_;
45 DataVector<IndexedColorMinMax> component_min_max_;
46};
47
48#endif // CORE_FPDFAPI_PAGE_CPDF_INDEXEDCS_H_
fxcrt::ByteString ByteString
Definition bytestring.h:180
#define DCHECK
Definition check.h:33
#define DCHECK_LT(x, y)
Definition check_op.h:19
bool IsEmpty() const
Definition cpdf_array.h:40
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
Definition cpdf_array.h:29
CPDF_BasedCS(Family family)
virtual const CPDF_IndexedCS * AsIndexedCS() const
static void InitializeGlobals()
Family GetFamily() const
~CPDF_ColorSpace() override
static void DestroyGlobals()
virtual const CPDF_PatternCS * AsPatternCS() const
virtual bool IsNormal() const
virtual void EnableStdConversion(bool bEnabled)
std::vector< float > CreateBufAndSetDefaultColor() const
CPDF_ColorSpace(Family family)
static uint32_t ComponentsForFamily(Family family)
virtual void TranslateImageLine(pdfium::span< uint8_t > dest_span, pdfium::span< const uint8_t > src_span, int pixels, int image_width, int image_height, bool bTransMask) const
static RetainPtr< CPDF_ColorSpace > GetStockCSForName(const ByteString &name)
uint32_t ComponentCount() const
bool HasSameArray(const CPDF_Object *pObj) const
void SetComponentsForStockCS(uint32_t nComponents)
static RetainPtr< CPDF_ColorSpace > GetStockCS(Family family)
virtual void GetDefaultValue(int iComponent, float *value, float *min, float *max) const
~CPDF_DeviceCS() override
std::optional< FX_RGB_STRUCT< float > > GetRGB(pdfium::span< const float > pBuf) const override
void TranslateImageLine(pdfium::span< uint8_t > dest_span, pdfium::span< const uint8_t > src_span, int pixels, int image_width, int image_height, bool bTransMask) const override
uint32_t v_Load(CPDF_Document *pDoc, const CPDF_Array *pArray, std::set< const CPDF_Object * > *pVisited) override
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
uint32_t InputCount() const
uint32_t m_nOutputs
uint32_t m_nInputs
virtual bool v_Call(pdfium::span< const float > inputs, pdfium::span< float > results) const =0
std::vector< float > m_Ranges
virtual ~CPDF_Function()
static std::unique_ptr< CPDF_Function > Load(RetainPtr< const CPDF_Object > pFuncObj, VisitedSet *pVisited)
float GetRange(int i) const
bool Init(const CPDF_Object *pObj, VisitedSet *pVisited)
CPDF_Function(Type type)
const Type m_Type
std::vector< float > m_Domains
float GetDomain(int i) const
std::optional< uint32_t > Call(pdfium::span< const float > inputs, pdfium::span< float > results) const
virtual bool v_Init(const CPDF_Object *pObj, VisitedSet *pVisited)=0
uint32_t OutputCount() const
static std::unique_ptr< CPDF_Function > Load(RetainPtr< const CPDF_Object > pFuncObj)
float Interpolate(float x, float xmin, float xmax, float ymin, float ymax) const
bool IsNormal() const
void TranslateScanline(pdfium::span< uint8_t > pDest, pdfium::span< const uint8_t > pSrc, int pixels)
bool IsSRGB() const
void Translate(pdfium::span< const float > pSrcValues, pdfium::span< float > pDestValues)
uint32_t GetComponents() const
~CPDF_IccProfile() override
bool IsSupported() const
bool IsValid() const
const CPDF_IndexedCS * AsIndexedCS() const override
int GetMaxIndex() const
uint32_t v_Load(CPDF_Document *pDoc, const CPDF_Array *pArray, std::set< const CPDF_Object * > *pVisited) override
~CPDF_IndexedCS() override
std::optional< FX_RGB_STRUCT< float > > GetRGB(pdfium::span< const float > pBuf) const override
virtual ByteString GetString() const
bool IsName() const
const CPDF_Array * AsArray() const
const CPDF_Stream * AsStream() const
void SetComps(pdfium::span< const float > comps)
PatternValue(const PatternValue &that)
static bool IsValidIccComponents(int components)
bool operator==(const char *ptr) const
#define UNSAFE_TODO(...)
#define FX_DATA_PARTITION_EXCEPTION(T)
pdfium::CheckedNumeric< int32_t > FX_SAFE_INT32
constexpr uint32_t FXBSTR_ID(uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4)
Definition fx_string.h:19
void ReverseRGB(pdfium::span< uint8_t > pDestBuf, pdfium::span< const uint8_t > pSrcBuf, int pixels)
Definition fx_codec.cpp:23
#define NOTREACHED_NORETURN()
Definition notreached.h:22
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:222
fxcrt::ByteStringView ByteStringView