System.UITypes.TAlphaColorF

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TAlphaColorF = record

C++

struct DECLSPEC_DRECORD TAlphaColorF
{
public:
    #define TAlphaColorF_Epsilon  (1.525900E-05)
private:
    static bool __fastcall SameComponent(const float Value1, const float Value2);
    static float __fastcall ClampComponent(const float Value);
public:
    float R;
    float G;
    float B;
    float A;
    static TAlphaColorF __fastcall Create(const float R, const float G, const float B, const float A = 1.000000E+00f)/* overload */;
    static TAlphaColorF __fastcall Create(const TAlphaColor Color)/* overload */;
    static TAlphaColorF __fastcall _op_Addition(const TAlphaColorF &Color1, const TAlphaColorF &Color2);
    static TAlphaColorF __fastcall _op_Subtraction(const TAlphaColorF &Color1, const TAlphaColorF &Color2);
    static bool __fastcall _op_Equality(const TAlphaColorF &Color1, const TAlphaColorF &Color2);
    static bool __fastcall _op_Inequality(const TAlphaColorF &Color1, const TAlphaColorF &Color2);
    static TAlphaColorF __fastcall _op_UnaryNegation(const TAlphaColorF &Color);
    static TAlphaColorF __fastcall _op_Multiply(const TAlphaColorF &Color1, const TAlphaColorF &Color2);
    static TAlphaColorF __fastcall _op_Multiply(const TAlphaColorF &Color, const float Factor);
    static TAlphaColorF __fastcall _op_Multiply(const float Factor, const TAlphaColorF &Color);
    static TAlphaColorF __fastcall _op_Division(const TAlphaColorF &Color, const float Factor);
    TAlphaColorF __fastcall PremultipliedAlpha();
    TAlphaColorF __fastcall UnpremultipliedAlpha();
    TAlphaColorF __fastcall Clamp();
    TAlphaColor __fastcall ToAlphaColor();
    friend TAlphaColorF operator +(const TAlphaColorF &Color1, const TAlphaColorF &Color2) { return TAlphaColorF::_op_Addition(Color1, Color2); }
    friend TAlphaColorF operator -(const TAlphaColorF &Color1, const TAlphaColorF &Color2) { return TAlphaColorF::_op_Subtraction(Color1, Color2); }
    friend bool operator ==(const TAlphaColorF &Color1, const TAlphaColorF &Color2) { return TAlphaColorF::_op_Equality(Color1, Color2); }
    friend bool operator !=(const TAlphaColorF &Color1, const TAlphaColorF &Color2) { return TAlphaColorF::_op_Inequality(Color1, Color2); }
    TAlphaColorF operator -() { return TAlphaColorF::_op_UnaryNegation(*this); }
    friend TAlphaColorF operator *(const TAlphaColorF &Color1, const TAlphaColorF &Color2) { return TAlphaColorF::_op_Multiply(Color1, Color2); }
    friend TAlphaColorF operator *(const TAlphaColorF &Color, const float Factor) { return TAlphaColorF::_op_Multiply(Color, Factor); }
    friend TAlphaColorF operator *(const float Factor, const TAlphaColorF &Color) { return TAlphaColorF::_op_Multiply(Factor, Color); }
    friend TAlphaColorF operator /(const TAlphaColorF &Color, const float Factor) { return TAlphaColorF::_op_Division(Color, Factor); }
};

Properties

Type Visibility Source Unit Parent
record
struct
public
System.UITypes.pas
System.UITypes.hpp
System.UITypes System.UITypes

Description

TAlphaColorF is a color type that treats each R, G, B, and A component as floats.

TAlphaColorF is used in operations with colors that require high precision, treating each R, G, B, and A component as floats. Overloaded operators allow adding, subtracting, and multiplying colors by using normal operations (such as "FinalColor := (FirstColor + SecondColor) / 2").

Previously, pixel format conversion relied on System.Math.Vectors.TVector3D, which it treated as color, but now pixel format conversion uses the new color types in TVector3D for that purpose.

See Also