Skia
2D Graphics Library
SkImageInfo.h File Reference
#include "include/core/SkAlphaType.h"
#include "include/core/SkColorType.h"
#include "include/core/SkMath.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
#include "include/private/SkTFitsIn.h"
#include "include/private/SkTo.h"
Include dependency graph for SkImageInfo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SkColorInfo
 Describes pixel and encoding. More...
 
struct  SkImageInfo
 Describes pixel dimensions and encoding. More...
 

Enumerations

enum  SkYUVColorSpace : int {
  kJPEG_Full_SkYUVColorSpace , kRec601_Limited_SkYUVColorSpace , kRec709_Full_SkYUVColorSpace , kRec709_Limited_SkYUVColorSpace ,
  kBT2020_8bit_Full_SkYUVColorSpace , kBT2020_8bit_Limited_SkYUVColorSpace , kBT2020_10bit_Full_SkYUVColorSpace , kBT2020_10bit_Limited_SkYUVColorSpace ,
  kBT2020_12bit_Full_SkYUVColorSpace , kBT2020_12bit_Limited_SkYUVColorSpace , kIdentity_SkYUVColorSpace , kLastEnum_SkYUVColorSpace = kIdentity_SkYUVColorSpace ,
  kJPEG_SkYUVColorSpace = kJPEG_Full_SkYUVColorSpace , kRec601_SkYUVColorSpace = kRec601_Limited_SkYUVColorSpace , kRec709_SkYUVColorSpace = kRec709_Limited_SkYUVColorSpace , kBT2020_SkYUVColorSpace = kBT2020_8bit_Limited_SkYUVColorSpace
}
 

Functions

SK_API int SkColorTypeBytesPerPixel (SkColorType ct)
 Returns the number of bytes required to store a pixel, including unused padding. More...
 
SK_API bool SkColorTypeIsAlwaysOpaque (SkColorType ct)
 Returns true if SkColorType always decodes alpha to 1.0, making the pixel fully opaque. More...
 
SK_API bool SkColorTypeValidateAlphaType (SkColorType colorType, SkAlphaType alphaType, SkAlphaType *canonical=nullptr)
 Returns true if canonical can be set to a valid SkAlphaType for colorType. More...
 

Enumeration Type Documentation

◆ SkYUVColorSpace

enum SkYUVColorSpace : int
Enumerator
kJPEG_Full_SkYUVColorSpace 

describes full range

kRec601_Limited_SkYUVColorSpace 

describes SDTV range

kRec709_Full_SkYUVColorSpace 

describes HDTV range

kRec709_Limited_SkYUVColorSpace 
kBT2020_8bit_Full_SkYUVColorSpace 

describes UHDTV range, non-constant-luminance

kBT2020_8bit_Limited_SkYUVColorSpace 
kBT2020_10bit_Full_SkYUVColorSpace 
kBT2020_10bit_Limited_SkYUVColorSpace 
kBT2020_12bit_Full_SkYUVColorSpace 
kBT2020_12bit_Limited_SkYUVColorSpace 
kIdentity_SkYUVColorSpace 

maps Y->R, U->G, V->B

kLastEnum_SkYUVColorSpace 

last valid value

kJPEG_SkYUVColorSpace 
kRec601_SkYUVColorSpace 
kRec709_SkYUVColorSpace 
kBT2020_SkYUVColorSpace 

Function Documentation

◆ SkColorTypeBytesPerPixel()

SK_API int SkColorTypeBytesPerPixel ( SkColorType  ct)

Returns the number of bytes required to store a pixel, including unused padding.

Returns zero if ct is kUnknown_SkColorType or invalid.

Returns
bytes per pixel

◆ SkColorTypeIsAlwaysOpaque()

SK_API bool SkColorTypeIsAlwaysOpaque ( SkColorType  ct)

Returns true if SkColorType always decodes alpha to 1.0, making the pixel fully opaque.

If true, SkColorType does not reserve bits to encode alpha.

Returns
true if alpha is always set to 1.0

◆ SkColorTypeValidateAlphaType()

SK_API bool SkColorTypeValidateAlphaType ( SkColorType  colorType,
SkAlphaType  alphaType,
SkAlphaType canonical = nullptr 
)

Returns true if canonical can be set to a valid SkAlphaType for colorType.

If there is more than one valid canonical SkAlphaType, set to alphaType, if valid. If true is returned and canonical is not nullptr, store valid SkAlphaType.

Returns false only if alphaType is kUnknown_SkAlphaType, color type is not kUnknown_SkColorType, and SkColorType is not always opaque. If false is returned, canonical is ignored.

Parameters
canonicalstorage for SkAlphaType
Returns
true if valid SkAlphaType can be associated with colorType