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
fx_dib.h File Reference

(0ccf980226462398d5097987466bcffd8236e1e9)

#include <stdint.h>
#include <utility>
#include "core/fxcrt/compiler_specific.h"
Include dependency graph for fx_dib.h:

Go to the source code of this file.

Classes

struct  FX_RGB_STRUCT< T >
struct  FX_BGR_STRUCT< T >
struct  FX_ARGB_STRUCT< T >
struct  FX_ABGR_STRUCT< T >
struct  FX_RGBA_STRUCT< T >
struct  FX_BGRA_STRUCT< T >
struct  FX_CMYK_STRUCT< T >
struct  FX_LAB_STRUCT< T >
struct  FXDIB_ResampleOptions

Macros

#define FXARGB_A(argb)
#define FXARGB_R(argb)
#define FXARGB_G(argb)
#define FXARGB_B(argb)
#define FXARGB_MUL_ALPHA(argb, alpha)
#define FXRGB2GRAY(r, g, b)
#define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha)
#define FXCMYK_TODIB(cmyk)
#define FXARGB_TOBGRORDERDIB(argb)

Typedefs

using FX_ARGB = uint32_t
using FX_CMYK = uint32_t
using FX_COLORREF = uint32_t

Enumerations

enum class  FXDIB_Format : uint16_t {
  kInvalid = 0 , k1bppRgb = 0x001 , k8bppRgb = 0x008 , kBgr = 0x018 ,
  kBgrx = 0x020 , k1bppMask = 0x101 , k8bppMask = 0x108 , kBgra = 0x220
}
enum class  BlendMode {
  kNormal = 0 , kMultiply , kScreen , kOverlay ,
  kDarken , kLighten , kColorDodge , kColorBurn ,
  kHardLight , kSoftLight , kDifference , kExclusion ,
  kHue , kSaturation , kColor , kLuminosity ,
  kLast = kLuminosity
}

Functions

constexpr uint32_t FXSYS_BGR (uint8_t b, uint8_t g, uint8_t r)
constexpr uint8_t FXSYS_GetRValue (uint32_t bgr)
constexpr uint8_t FXSYS_GetGValue (uint32_t bgr)
constexpr uint8_t FXSYS_GetBValue (uint32_t bgr)
constexpr unsigned int FXSYS_GetUnsignedAlpha (float alpha)
int GetBppFromFormat (FXDIB_Format format)
int GetCompsFromFormat (FXDIB_Format format)
bool GetIsMaskFromFormat (FXDIB_Format format)
bool GetIsAlphaFromFormat (FXDIB_Format format)
FX_BGRA_STRUCT< uint8_t > ArgbToBGRAStruct (FX_ARGB argb)
FX_BGR_STRUCT< uint8_t > ArgbToBGRStruct (FX_ARGB argb)
std::pair< uint8_t, FX_COLORREFArgbToAlphaAndColorRef (FX_ARGB argb)
FX_COLORREF ArgbToColorRef (FX_ARGB argb)
FX_ARGB AlphaAndColorRefToArgb (int a, FX_COLORREF colorref)
constexpr FX_ARGB ArgbEncode (uint32_t a, uint32_t r, uint32_t g, uint32_t b)
constexpr FX_CMYK CmykEncode (uint32_t c, uint32_t m, uint32_t y, uint32_t k)
UNSAFE_BUFFER_USAGE FX_ARGB FXARGB_GetDIB (const uint8_t *p)
UNSAFE_BUFFER_USAGE void FXARGB_SetDIB (uint8_t *p, uint32_t argb)
UNSAFE_BUFFER_USAGE void FXARGB_SetRGBOrderDIB (uint8_t *p, uint32_t argb)
UNSAFE_BUFFER_USAGE void ReverseCopy3Bytes (uint8_t *dest, const uint8_t *src)

Macro Definition Documentation

◆ FXARGB_A

#define FXARGB_A ( argb)
Value:
((uint8_t)((argb) >> 24))

Definition at line 196 of file fx_dib.h.

◆ FXARGB_B

#define FXARGB_B ( argb)
Value:
((uint8_t)(argb))

Definition at line 199 of file fx_dib.h.

◆ FXARGB_G

#define FXARGB_G ( argb)
Value:
((uint8_t)((argb) >> 8))

Definition at line 198 of file fx_dib.h.

◆ FXARGB_MUL_ALPHA

#define FXARGB_MUL_ALPHA ( argb,
alpha )
Value:
(((((argb) >> 24) * (alpha) / 255) << 24) | ((argb)&0xffffff))
GLfloat GLfloat GLfloat alpha
Definition qopenglext.h:418

Definition at line 200 of file fx_dib.h.

◆ FXARGB_R

#define FXARGB_R ( argb)
Value:
((uint8_t)((argb) >> 16))

Definition at line 197 of file fx_dib.h.

◆ FXARGB_TOBGRORDERDIB

#define FXARGB_TOBGRORDERDIB ( argb)
Value:
((uint8_t)(argb >> 16) | ((uint8_t)(argb >> 8)) << 8 | \
((uint8_t)(argb)) << 16 | ((uint8_t)(argb >> 24) << 24))

Definition at line 210 of file fx_dib.h.

◆ FXCMYK_TODIB

#define FXCMYK_TODIB ( cmyk)
Value:
((uint8_t)((cmyk) >> 24) | ((uint8_t)((cmyk) >> 16)) << 8 | \
((uint8_t)((cmyk) >> 8)) << 16 | ((uint8_t)(cmyk) << 24))

Definition at line 207 of file fx_dib.h.

◆ FXDIB_ALPHA_MERGE

#define FXDIB_ALPHA_MERGE ( backdrop,
source,
source_alpha )
Value:
(((backdrop) * (255 - (source_alpha)) + (source) * (source_alpha)) / 255)
GLsizei GLsizei GLchar * source

Definition at line 204 of file fx_dib.h.

◆ FXRGB2GRAY

#define FXRGB2GRAY ( r,
g,
b )
Value:
(((b)*11 + (g)*59 + (r)*30) / 100)
GLboolean GLboolean GLboolean b
GLboolean r
GLboolean GLboolean g

Definition at line 203 of file fx_dib.h.

Typedef Documentation

◆ FX_ARGB

using FX_ARGB = uint32_t

Definition at line 36 of file fx_dib.h.

◆ FX_CMYK

using FX_CMYK = uint32_t

Definition at line 37 of file fx_dib.h.

◆ FX_COLORREF

using FX_COLORREF = uint32_t

Definition at line 42 of file fx_dib.h.

Enumeration Type Documentation

◆ BlendMode

enum class BlendMode
strong
Enumerator
kNormal 
kMultiply 
kScreen 
kOverlay 
kDarken 
kLighten 
kColorDodge 
kColorBurn 
kHardLight 
kSoftLight 
kDifference 
kExclusion 
kHue 
kSaturation 
kColor 
kLuminosity 
kLast 

Definition at line 119 of file fx_dib.h.

◆ FXDIB_Format

enum class FXDIB_Format : uint16_t
strong
Enumerator
kInvalid 
k1bppRgb 
k8bppRgb 
kBgr 
kBgrx 
k1bppMask 
k8bppMask 
kBgra 

Definition at line 21 of file fx_dib.h.

Function Documentation

◆ AlphaAndColorRefToArgb()

FX_ARGB AlphaAndColorRefToArgb ( int a,
FX_COLORREF colorref )

Definition at line 64 of file fx_dib.cpp.

References ArgbEncode(), FXSYS_GetBValue(), FXSYS_GetGValue(), and FXSYS_GetRValue().

Here is the call graph for this function:

◆ ArgbEncode()

◆ ArgbToAlphaAndColorRef()

std::pair< uint8_t, FX_COLORREF > ArgbToAlphaAndColorRef ( FX_ARGB argb)

Definition at line 56 of file fx_dib.cpp.

References ArgbToColorRef().

Here is the call graph for this function:

◆ ArgbToBGRAStruct()

FX_BGRA_STRUCT< uint8_t > ArgbToBGRAStruct ( FX_ARGB argb)

Definition at line 48 of file fx_dib.cpp.

◆ ArgbToBGRStruct()

FX_BGR_STRUCT< uint8_t > ArgbToBGRStruct ( FX_ARGB argb)

Definition at line 52 of file fx_dib.cpp.

◆ ArgbToColorRef()

FX_COLORREF ArgbToColorRef ( FX_ARGB argb)

Definition at line 60 of file fx_dib.cpp.

References FXSYS_BGR().

Referenced by ArgbToAlphaAndColorRef(), CPDFSDK_Widget::GetBorderColor(), and CPDFSDK_Widget::GetFillColor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CmykEncode()

FX_CMYK CmykEncode ( uint32_t c,
uint32_t m,
uint32_t y,
uint32_t k )
constexpr

Definition at line 192 of file fx_dib.h.

◆ FXARGB_GetDIB()

UNSAFE_BUFFER_USAGE FX_ARGB FXARGB_GetDIB ( const uint8_t * p)
inline

Definition at line 215 of file fx_dib.h.

References ArgbEncode().

Here is the call graph for this function:

◆ FXARGB_SetDIB()

UNSAFE_BUFFER_USAGE void FXARGB_SetDIB ( uint8_t * p,
uint32_t argb )
inline

Definition at line 221 of file fx_dib.h.

Referenced by CFX_DIBitmap::CompositeRect().

Here is the caller graph for this function:

◆ FXARGB_SetRGBOrderDIB()

UNSAFE_BUFFER_USAGE void FXARGB_SetRGBOrderDIB ( uint8_t * p,
uint32_t argb )
inline

Definition at line 229 of file fx_dib.h.

◆ FXSYS_BGR()

uint32_t FXSYS_BGR ( uint8_t b,
uint8_t g,
uint8_t r )
constexpr

Definition at line 139 of file fx_dib.h.

Referenced by ArgbToColorRef(), and CPDF_Color::GetColorRef().

Here is the caller graph for this function:

◆ FXSYS_GetBValue()

uint8_t FXSYS_GetBValue ( uint32_t bgr)
constexpr

Definition at line 151 of file fx_dib.h.

Referenced by AlphaAndColorRefToArgb(), FPDFPageObj_GetFillColor(), FPDFPageObj_GetStrokeColor(), FPDFText_GetFillColor(), and FPDFText_GetStrokeColor().

Here is the caller graph for this function:

◆ FXSYS_GetGValue()

uint8_t FXSYS_GetGValue ( uint32_t bgr)
constexpr

Definition at line 147 of file fx_dib.h.

Referenced by AlphaAndColorRefToArgb(), FPDFPageObj_GetFillColor(), FPDFPageObj_GetStrokeColor(), FPDFText_GetFillColor(), and FPDFText_GetStrokeColor().

Here is the caller graph for this function:

◆ FXSYS_GetRValue()

uint8_t FXSYS_GetRValue ( uint32_t bgr)
constexpr

Definition at line 143 of file fx_dib.h.

Referenced by AlphaAndColorRefToArgb(), FPDFPageObj_GetFillColor(), FPDFPageObj_GetStrokeColor(), FPDFText_GetFillColor(), and FPDFText_GetStrokeColor().

Here is the caller graph for this function:

◆ FXSYS_GetUnsignedAlpha()

unsigned int FXSYS_GetUnsignedAlpha ( float alpha)
constexpr

Definition at line 155 of file fx_dib.h.

Referenced by FPDFPageObj_GetFillColor(), and FPDFPageObj_GetStrokeColor().

Here is the caller graph for this function:

◆ GetBppFromFormat()

int GetBppFromFormat ( FXDIB_Format format)
inline

Definition at line 160 of file fx_dib.h.

Referenced by CStretchEngine::CStretchEngine(), CFX_DIBitmap::CalculatePitchAndSize(), and CFX_DIBBase::GetBPP().

Here is the caller graph for this function:

◆ GetCompsFromFormat()

int GetCompsFromFormat ( FXDIB_Format format)
inline

Definition at line 165 of file fx_dib.h.

Referenced by EmbedderTest::BytesPerPixelForFormat(), CFX_ScanlineCompositor::CompositeBitMaskLine(), and CFX_ScanlineCompositor::CompositeByteMaskLine().

Here is the caller graph for this function:

◆ GetIsAlphaFromFormat()

bool GetIsAlphaFromFormat ( FXDIB_Format format)
inline

Definition at line 173 of file fx_dib.h.

Referenced by CFX_DIBBase::IsAlphaFormat().

Here is the caller graph for this function:

◆ GetIsMaskFromFormat()

bool GetIsMaskFromFormat ( FXDIB_Format format)
inline

Definition at line 169 of file fx_dib.h.

Referenced by CFX_DIBBase::IsMaskFormat().

Here is the caller graph for this function:

◆ ReverseCopy3Bytes()

UNSAFE_BUFFER_USAGE void ReverseCopy3Bytes ( uint8_t * dest,
const uint8_t * src )
inline

Definition at line 238 of file fx_dib.h.