2018-04-16 12:37:38 +00:00
|
|
|
#Topic Color4f
|
2018-05-30 13:21:49 +00:00
|
|
|
#Alias Color4f_Reference ##
|
2018-10-08 18:57:48 +00:00
|
|
|
#Substitute SkColor4f
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Struct SkPM4f
|
|
|
|
##
|
|
|
|
|
|
|
|
#Struct SkRGBA4f
|
|
|
|
|
|
|
|
#Code
|
|
|
|
#Populate
|
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
Each component is stored as a 32-bit single precision floating point float value.
|
|
|
|
All values are allowed, but only the range from zero to one is meaningful.
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Components are independent of the others if defined with kUnpremul_SkAlphaType;
|
|
|
|
fA Alpha is may be greater or smaller than fG green, fB blue, or fR red.
|
|
|
|
SkColor4f is shorthand for Unpremultiplied SkRGBA4f.
|
|
|
|
|
|
|
|
Components are connnected if defined with kPremul_SkAlphaType;
|
|
|
|
fA Alpha is equal to or larger than fG green, fB blue, and fR red. The values
|
|
|
|
stored in fG, fB, and fR combine the color component with the Alpha component.
|
2018-05-17 16:17:28 +00:00
|
|
|
|
|
|
|
Values smaller than zero or larger than one are allowed. Values out of range
|
|
|
|
may be used with Blend_Mode so that the final component is in range.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Member float fR
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # red component ##
|
|
|
|
Single precision float for red ranges from no red (0.0) to full red (1.0).
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
#Member float fG
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # green component ##
|
|
|
|
Single precision float for green ranges from no green (0.0) to full green (1.0).
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
#Member float fB
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # blue component ##
|
|
|
|
Single precision float for blue ranges from no blue (0.0) to full blue (1.0).
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
#Member float fA
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # alpha component ##
|
|
|
|
Single precision float for Alpha ranges from no Alpha (0.0) to full Alpha (1.0).
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
|
2018-04-16 12:37:38 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method bool operator==(const SkRGBA4f& other)_const
|
|
|
|
#Line # compares SkRGBA4f for equality ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Compares SkRGBA4f with other, and returns true if all components are equivalent.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Param other SkRGBA4f to compare ##
|
2018-05-17 16:17:28 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Return true if SkRGBA4f equals other ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
SkColor4f colorRed = { 1, 0, 0, 1 };
|
|
|
|
SkColor4f colorNamedRed = SkColor4f::FromColor(SK_ColorRED);
|
|
|
|
SkDebugf("colorRed %c= colorNamedRed", colorRed == colorNamedRed ? '=' : '!');
|
|
|
|
#StdOut
|
|
|
|
colorRed == colorNamedRed
|
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#SeeAlso operator!=(const SkRGBA4f& other)_const
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method bool operator!=(const SkRGBA4f& other)_const
|
|
|
|
#Line # compares SkRGBA4f for inequality ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Compares SkRGBA4f with other, and returns true if all components are not
|
2018-05-17 16:17:28 +00:00
|
|
|
equivalent.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Param other SkRGBA4f to compare ##
|
2018-05-17 16:17:28 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Return true if SkRGBA4f is not equal to other ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
SkColor4f colorGray = { .5, .5, .5, 1 };
|
|
|
|
SkColor4f colorNamedGray = SkColor4f::FromColor(SK_ColorGRAY);
|
|
|
|
SkDebugf("colorGray %c= colorNamedGray ", colorGray != colorNamedGray ? '!' : '=');
|
|
|
|
#StdOut
|
|
|
|
colorGray != colorNamedGray
|
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#SeeAlso operator==(const SkRGBA4f& other)_const
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
#Method SkRGBA4f operator*(float scale)_const
|
|
|
|
#Line # multiplies components by scale ##
|
|
|
|
|
|
|
|
Multiplies each component by scale. Does not pin the result.
|
|
|
|
|
|
|
|
#Param scale component multiplier ##
|
|
|
|
|
|
|
|
#Return scaled color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso SkBlendMode::kMultiply
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
#Method SkRGBA4f operator*(const SkRGBA4f& scale)_const
|
|
|
|
|
|
|
|
Multiplies each component by scale component. Does not pin the result.
|
|
|
|
|
|
|
|
#Param scale SkRGBA4f component multipliers ##
|
|
|
|
|
|
|
|
#Return scaled color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso SkBlendMode::kMultiply
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Subtopic Property_Functions
|
|
|
|
#Line # member values ##
|
|
|
|
#Subtopic Property_Functions ##
|
|
|
|
|
2018-04-16 12:37:38 +00:00
|
|
|
#Method const float* vec() const
|
2018-10-08 18:57:48 +00:00
|
|
|
#In Property_Functions
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # returns array of components ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Returns SkRGBA4f components as a read-only array.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#Return components as read-only array ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
SkColor4f color = SkColor4f::FromColor(0x884488CC);
|
|
|
|
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color.fR, color.fG, color.fB, color.fA);
|
|
|
|
const float* array = color.vec();
|
|
|
|
SkDebugf("[0]=%g [1]=%g [2]=%g [3]=%g\n", array[0], array[1], array[2], array[3]);
|
|
|
|
#StdOut
|
2018-08-28 18:53:37 +00:00
|
|
|
red=0.266667 green=0.533333 blue=0.8 alpha=0.533333
|
|
|
|
[0]=0.266667 [1]=0.533333 [2]=0.8 [3]=0.533333
|
2018-05-17 16:17:28 +00:00
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#SeeAlso SkColor4f
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#Method float* vec()
|
2018-10-08 18:57:48 +00:00
|
|
|
#In Property_Functions
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # returns array of components ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Returns SkRGBA4f components as a writable array.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#Return components as writable array ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
SkColor4f color = SkColor4f::FromColor(0x884488CC);
|
|
|
|
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color.fR, color.fG, color.fB, color.fA);
|
|
|
|
float* array = color.vec();
|
|
|
|
array[3] = 1;
|
|
|
|
SkDebugf("[0]=%g [1]=%g [2]=%g [3]=%g\n", array[0], array[1], array[2], array[3]);
|
|
|
|
#StdOut
|
2018-08-28 18:53:37 +00:00
|
|
|
red=0.266667 green=0.533333 blue=0.8 alpha=0.533333
|
|
|
|
[0]=0.266667 [1]=0.533333 [2]=0.8 [3]=1
|
2018-05-17 16:17:28 +00:00
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#SeeAlso SkColor4f
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method float operator[](int index)_const
|
|
|
|
#Line # returns component by index ##
|
|
|
|
|
|
|
|
Returns SkRGBA4f component by index, zero through three. index out of range
|
|
|
|
triggers an assert in debug builds.
|
|
|
|
|
|
|
|
#Param index component, zero through three ##
|
|
|
|
#Return component by index ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso vec
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
#Method float& operator[](int index)
|
|
|
|
#Line # returns writable component reference ##
|
|
|
|
|
|
|
|
Returns writable component reference by index, zero through three. index out of range
|
|
|
|
triggers an assert in debug builds.
|
|
|
|
|
|
|
|
#Param index component, zero through three ##
|
|
|
|
#Return writable component reference by index ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso vec
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
2018-04-16 12:37:38 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Subtopic Utility_Functions
|
|
|
|
#Line # less common functions ##
|
|
|
|
#Subtopic Utility_Functions ##
|
|
|
|
|
|
|
|
#Method bool isOpaque() const
|
|
|
|
#In Utility_Functions
|
|
|
|
#Line # returns if Alpha component is at maximum ##
|
|
|
|
|
|
|
|
Returns true if Alpha component is one. Color has no transparency regardless of
|
|
|
|
whether color is Premultiplied or Unpremultiplied. Triggers a debugging assert
|
|
|
|
if Alpha not valid.
|
|
|
|
|
|
|
|
#Return true if Alpha is one ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso vec SkColorGetA
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#Method static SkRGBA4f Pin(float r, float g, float b, float a)
|
|
|
|
#In Utility_Functions
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # sets components to valid range ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Constructs and returns SkRGBA4f with each component pinned from zero to one.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#Param r red component ##
|
|
|
|
#Param g green component ##
|
|
|
|
#Param b blue component ##
|
|
|
|
#Param a Alpha component ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#Return Color4f with valid components ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
#Height 40
|
|
|
|
uint32_t storage[8];
|
|
|
|
SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);
|
|
|
|
SkPixmap pixmap(info, storage, info.minRowBytes());
|
|
|
|
pixmap.erase(SK_ColorWHITE);
|
|
|
|
SkIRect bounds = {0, 0, 1, 1};
|
|
|
|
SkColor4f colors[] = { SkColor4f::Pin(1.5, 0.45f, 0.0, 1),
|
|
|
|
SkColor4f::Pin(1, 0.45f, -0.25, 1),
|
|
|
|
{1.5, 0.45f, 0.0, 1},
|
|
|
|
{1, 0.45f, -0.25, 1},
|
|
|
|
};
|
|
|
|
for (auto color4f : colors) {
|
|
|
|
pixmap.erase(color4f, &bounds);
|
|
|
|
bounds.offset(2, 0);
|
|
|
|
}
|
|
|
|
SkBitmap bitmap;
|
|
|
|
canvas->scale(20, 20);
|
|
|
|
bitmap.installPixels(pixmap);
|
|
|
|
canvas->drawBitmap(bitmap, 0, 0);
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#SeeAlso pin() FromColor
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method SkRGBA4f pin() const
|
|
|
|
#In Utility_Functions
|
|
|
|
#Line # sets components to valid range ##
|
|
|
|
|
|
|
|
Returns SkRGBA4f with all components in the range from zero to one.
|
|
|
|
|
|
|
|
#Return SkRGBA4f with valid components ##
|
|
|
|
|
|
|
|
#Example
|
|
|
|
#Height 40
|
|
|
|
uint32_t storage[8];
|
|
|
|
SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);
|
|
|
|
SkPixmap pixmap(info, storage, info.minRowBytes());
|
|
|
|
pixmap.erase(SK_ColorWHITE);
|
|
|
|
SkIRect bounds = {0, 0, 1, 1};
|
|
|
|
SkColor4f colors[] = { {1.5, 0.45f, 0.0, 1},
|
|
|
|
{1, 0.45f, -0.25, 1},
|
|
|
|
};
|
|
|
|
for (auto color4f : colors) {
|
|
|
|
pixmap.erase(color4f, &bounds);
|
|
|
|
bounds.offset(2, 0);
|
|
|
|
pixmap.erase(color4f.pin(), &bounds);
|
|
|
|
bounds.offset(2, 0);
|
|
|
|
}
|
|
|
|
SkBitmap bitmap;
|
|
|
|
canvas->scale(20, 20);
|
|
|
|
bitmap.installPixels(pixmap);
|
|
|
|
canvas->drawBitmap(bitmap, 0, 0);
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso Pin
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#Method static SkRGBA4f FromColor(SkColor)
|
|
|
|
#In Utility_Functions
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # sets components from Color ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Converts to closest SkRGBA4f.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#Param SkColor Color with Alpha, red, blue, and green components ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Return SkRGBA4f equivalent ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
uint8_t red = 77, green = 101, blue = 153, alpha = 43;
|
|
|
|
SkColor argb = SkColorSetARGB(alpha, red, green, blue);
|
|
|
|
SkColor4f color4f = SkColor4f::FromColor(argb);
|
|
|
|
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color4f.fR, color4f.fG, color4f.fB, color4f.fA);
|
|
|
|
SkColor fromColor4f = color4f.toSkColor();
|
|
|
|
SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(fromColor4f),
|
|
|
|
SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));
|
|
|
|
#StdOut
|
2018-08-28 18:53:37 +00:00
|
|
|
red=0.301961 green=0.396078 blue=0.6 alpha=0.168627
|
2018-05-17 16:17:28 +00:00
|
|
|
red=77 green=101 blue=153 alpha=43
|
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#SeeAlso toSkColor
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#Method SkColor toSkColor() const
|
2018-10-08 18:57:48 +00:00
|
|
|
#In Utility_Functions
|
2018-05-17 16:17:28 +00:00
|
|
|
#Line # returns closest Color ##
|
|
|
|
|
|
|
|
Converts to closest SkColor.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#Return closest Color ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Example
|
2018-05-17 16:17:28 +00:00
|
|
|
float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;
|
|
|
|
SkColor4f color4f = { red, green, blue, alpha };
|
|
|
|
SkColor argb = color4f.toSkColor();
|
|
|
|
SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(argb),
|
|
|
|
SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));
|
|
|
|
SkColor4f fromSkColor = SkColor4f::FromColor(argb);
|
|
|
|
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", fromSkColor.fR, fromSkColor.fG,
|
|
|
|
fromSkColor.fB, fromSkColor.fA);
|
|
|
|
#StdOut
|
2018-08-28 18:53:37 +00:00
|
|
|
red=18 green=33 blue=82 alpha=43
|
|
|
|
red=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627
|
2018-05-17 16:17:28 +00:00
|
|
|
##
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-05-17 16:17:28 +00:00
|
|
|
#SeeAlso FromColor
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method static SkRGBA4f FromPMColor(SkPMColor)
|
|
|
|
#In Utility_Functions
|
|
|
|
#Line # converts from Premultiplied Color ##
|
2018-05-17 16:17:28 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Converts from Premultiplied integer components to Unpremultiplied float
|
|
|
|
components.
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Param SkPMColor Premultiplied color ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Return Unpremultiplied color ##
|
|
|
|
|
|
|
|
#NoExample
|
2018-04-16 12:37:38 +00:00
|
|
|
##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#SeeAlso FromColor
|
2018-04-16 12:37:38 +00:00
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method SkRGBA4f<kPremul_SkAlphaType> premul() const
|
2018-06-08 15:54:32 +00:00
|
|
|
#In Utility
|
2018-09-21 18:26:30 +00:00
|
|
|
#Line # returns Premultiplied color ##
|
|
|
|
|
|
|
|
Returns SkColor4f with all components premultiplied by Alpha.
|
|
|
|
|
|
|
|
#Return Premultiplied color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso unpremul
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Method SkRGBA4f<kUnpremul_SkAlphaType> unpremul() const
|
2018-09-21 18:26:30 +00:00
|
|
|
#In Utility
|
|
|
|
#Line # returns Unpremultiplied color ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
Returns SkRGBA4f with all components independent of Alpha.
|
2018-09-21 18:26:30 +00:00
|
|
|
|
|
|
|
#Return Unpremultiplied color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#SeeAlso premul
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
2018-10-17 13:39:54 +00:00
|
|
|
#Method uint32_t toBytes_RGBA() const
|
|
|
|
#In Utility
|
|
|
|
#Line # returns kRGBA_8888_SkColorType color ##
|
|
|
|
|
|
|
|
Produces bytes in RGBA order. Component values are not affected by color Alpha.
|
|
|
|
|
|
|
|
#Return color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
#Method static SkRGBA4f FromBytes_RGBA(uint32_t color)
|
|
|
|
#In Utility
|
|
|
|
#Line # sets kRGBA_8888_SkColorType color ##
|
|
|
|
|
|
|
|
Returns from color kRGBA_8888_SkColorType order. Component values are
|
|
|
|
not affected by color Alpha.
|
|
|
|
|
|
|
|
#Param color Premultiplied or Unpremultiplied ##
|
|
|
|
#Return color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
|
|
|
#Method SkRGBA4f makeOpaque() const
|
|
|
|
#In Utility
|
|
|
|
#Line # returns color without transparency ##
|
|
|
|
|
|
|
|
Returns color with Alpha set to one.
|
|
|
|
|
|
|
|
#Return color ##
|
|
|
|
|
|
|
|
#NoExample
|
|
|
|
##
|
|
|
|
|
|
|
|
#Method ##
|
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Struct ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Typedef SkRGBA4f SkColor4f
|
|
|
|
#Line # defines Unpremultiplied Color using floats ##
|
2018-04-16 12:37:38 +00:00
|
|
|
|
2018-10-08 18:57:48 +00:00
|
|
|
#Code
|
|
|
|
using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType>;
|
2018-06-08 15:54:32 +00:00
|
|
|
##
|
2018-10-08 18:57:48 +00:00
|
|
|
|
2018-05-16 11:07:07 +00:00
|
|
|
##
|
|
|
|
|
2018-04-16 12:37:38 +00:00
|
|
|
#Topic Color4f ##
|