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
icc_transform.h
Go to the documentation of this file.
1// Copyright 2016 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// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCODEC_ICC_ICC_TRANSFORM_H_
8#define CORE_FXCODEC_ICC_ICC_TRANSFORM_H_
9
10#include <stdint.h>
11
12#include <memory>
13
14#include "core/fxcodec/fx_codec_def.h"
15#include "third_party/base/containers/span.h"
16
17#if defined(USE_SYSTEM_LCMS2)
18#include <lcms2.h>
19#else
20#include "third_party/lcms/include/lcms2.h"
21#endif
22
23namespace fxcodec {
24
26 public:
28 pdfium::span<const uint8_t> span);
29
30 ~IccTransform();
31
32 void Translate(pdfium::span<const float> pSrcValues,
33 pdfium::span<float> pDestValues);
34 void TranslateScanline(pdfium::span<uint8_t> pDest,
35 pdfium::span<const uint8_t> pSrc,
36 int pixels);
37
38 int components() const { return m_nSrcComponents; }
39 bool IsNormal() const { return m_bNormal; }
40
41 static bool IsValidIccComponents(int components);
42
43 private:
44 IccTransform(cmsHTRANSFORM transform,
45 int srcComponents,
46 bool bIsLab,
47 bool bNormal);
48
49 const cmsHTRANSFORM m_hTransform;
50 const int m_nSrcComponents;
51 const bool m_bLab;
52 const bool m_bNormal;
53};
54
55} // namespace fxcodec
56
57#endif // CORE_FXCODEC_ICC_ICC_TRANSFORM_H_
bool IsEmpty() const
Definition cpdf_array.h:40
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)
virtual bool GetRGB(pdfium::span< const float > pBuf, float *R, float *G, float *B) const =0
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)
bool HasSameArray(const CPDF_Object *pObj) const
void SetComponentsForStockCS(uint32_t nComponents)
static RetainPtr< CPDF_ColorSpace > GetStockCS(Family family)
uint32_t CountComponents() const
virtual void GetDefaultValue(int iComponent, float *value, float *min, float *max) const
~CPDF_DeviceCS() 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
bool GetRGB(pdfium::span< const float > pBuf, float *R, float *G, float *B) const override
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
absl::optional< uint32_t > Call(pdfium::span< const float > inputs, pdfium::span< float > results) const
uint32_t CountOutputs() const
float GetDomain(int i) const
virtual bool v_Init(const CPDF_Object *pObj, VisitedSet *pVisited)=0
uint32_t CountInputs() 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
bool GetRGB(pdfium::span< const float > pBuf, float *R, float *G, float *B) const override
uint32_t v_Load(CPDF_Document *pDoc, const CPDF_Array *pArray, std::set< const CPDF_Object * > *pVisited) override
~CPDF_IndexedCS() 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)
void Translate(pdfium::span< const float > pSrcValues, pdfium::span< float > pDestValues)
static std::unique_ptr< IccTransform > CreateTransformSRGB(pdfium::span< const uint8_t > span)
void TranslateScanline(pdfium::span< uint8_t > pDest, pdfium::span< const uint8_t > pSrc, int pixels)
bool operator==(const char *ptr) const
constexpr uint32_t FXBSTR_ID(uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4)
Definition fx_string.h:19
int FXSYS_roundf(float f)
Definition fx_system.cpp:92
void ReverseRGB(uint8_t *pDestBuf, const uint8_t *pSrcBuf, int pixels)
Definition fx_codec.cpp:21
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224