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
cfgas_geshading.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 XFA_FGAS_GRAPHICS_CFGAS_GESHADING_H_
8#define XFA_FGAS_GRAPHICS_CFGAS_GESHADING_H_
9
10#include <stddef.h>
11
12#include "core/fxcrt/fx_coordinates.h"
13#include "core/fxge/dib/fx_dib.h"
14
15class CFGAS_GEShading final {
16 public:
17 enum class Type { kAxial = 1, kRadial };
18
19 static constexpr size_t kSteps = 256;
20
21 // Axial shading.
22 CFGAS_GEShading(const CFX_PointF& beginPoint,
23 const CFX_PointF& endPoint,
24 bool isExtendedBegin,
25 bool isExtendedEnd,
26 FX_ARGB beginArgb,
27 FX_ARGB endArgb);
28
29 // Radial shading.
30 CFGAS_GEShading(const CFX_PointF& beginPoint,
31 const CFX_PointF& endPoint,
32 float beginRadius,
33 float endRadius,
34 bool isExtendedBegin,
35 bool isExtendedEnd,
36 FX_ARGB beginArgb,
37 FX_ARGB endArgb);
38
40
41 Type GetType() const { return m_type; }
42 CFX_PointF GetBeginPoint() const { return m_beginPoint; }
43 CFX_PointF GetEndPoint() const { return m_endPoint; }
44 float GetBeginRadius() const { return m_beginRadius; }
45 float GetEndRadius() const { return m_endRadius; }
46 bool IsExtendedBegin() const { return m_isExtendedBegin; }
47 bool IsExtendedEnd() const { return m_isExtendedEnd; }
48 FX_ARGB GetArgb(size_t index) const { return m_argbArray[index]; }
49
50 private:
51 void InitArgbArray(FX_ARGB beginArgb, FX_ARGB endArgb);
52
53 const Type m_type;
54 const CFX_PointF m_beginPoint;
55 const CFX_PointF m_endPoint;
56 const float m_beginRadius;
57 const float m_endRadius;
58 const bool m_isExtendedBegin;
59 const bool m_isExtendedEnd;
60 FX_ARGB m_argbArray[kSteps];
61};
62
63#endif // XFA_FGAS_GRAPHICS_CFGAS_GESHADING_H_
StateRestorer(CFGAS_GEGraphics *graphics)
void FillPath(const CFGAS_GEPath &path, CFX_FillRenderOptions::FillType fill_type, const CFX_Matrix &matrix)
void SetLineDash(float dashPhase, pdfium::span< const float > dashArray)
void SetLineWidth(float lineWidth)
CFX_RenderDevice * GetRenderDevice()
CFGAS_GEGraphics(CFX_RenderDevice *renderDevice)
void SetClipRect(const CFX_RectF &rect)
void SetStrokeColor(const CFGAS_GEColor &color)
void ConcatMatrix(const CFX_Matrix &matrix)
const CFX_Matrix * GetMatrix() const
CFX_RectF GetClipRect() const
void SetLineCap(CFX_GraphStateData::LineCap lineCap)
void SetFillColor(const CFGAS_GEColor &color)
void StrokePath(const CFGAS_GEPath &path, const CFX_Matrix &matrix)
const CFX_Path & GetPath() const
CFGAS_GEPattern(HatchStyle hatchStyle, FX_ARGB foreArgb, FX_ARGB backArgb)
FX_ARGB GetForeArgb() const
FX_ARGB GetBackArgb() const
HatchStyle GetHatchStyle() const
bool IsExtendedEnd() const
Type GetType() const
FX_ARGB GetArgb(size_t index) const
CFGAS_GEShading(const CFX_PointF &beginPoint, const CFX_PointF &endPoint, bool isExtendedBegin, bool isExtendedEnd, FX_ARGB beginArgb, FX_ARGB endArgb)
CFGAS_GEShading(const CFX_PointF &beginPoint, const CFX_PointF &endPoint, float beginRadius, float endRadius, bool isExtendedBegin, bool isExtendedEnd, FX_ARGB beginArgb, FX_ARGB endArgb)
CFX_PointF GetEndPoint() const
float GetBeginRadius() const
float GetEndRadius() const
CFX_PointF GetBeginPoint() const
bool IsExtendedBegin() const
static constexpr size_t kSteps
bool Attach(RetainPtr< CFX_DIBitmap > pBitmap)
FX_RECT ToRoundedFxRect() const
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
bool IsIdentity() const
void Concat(const CFX_Matrix &right)
CFX_Matrix()=default
CFX_FloatRect GetBoundingBox() const
Definition cfx_path.cpp:322
constexpr CFX_RectF(float dst_left, float dst_top, float dst_width, float dst_height)
FXDIB_Format
Definition fx_dib.h:19
#define CHECK(cvref)
constexpr CFX_FillRenderOptions(FillType fill_type)
int Height() const
int32_t bottom
int32_t right
int Width() const
int32_t top
int32_t left