diff options
author | Weiliang Chen <weiliangc@chromium.org> | 2018-05-22 18:44:02 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-23 18:50:53 +0000 |
commit | bed9d5ec3e1c83d17325069c739853a856564a83 (patch) | |
tree | 13228152dbc650ddfa80fe4add68280cfb639890 /include | |
parent | 4fa5824fa2ae896670517d01c58ed4aef4a97941 (diff) |
Add usage of SkYUVAIndex as pre-step to transfer to new YUVA API
The plan foward is to have a new API on SkImage to make from YUVA
textures which a combination of array of textures and array of
SkYUVAIndex struct indicating which texture and channel to read for
each plane. This is a pre-step to let the old API use these ideas.
Bug: skia: 7903
Change-Id: I6a696db31a574247eb2abff60f2186a74b640142
Reviewed-on: https://skia-review.googlesource.com/128601
Commit-Queue: Weiliang Chen <weiliangc@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkImageInfo.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h index eb96f19723..cb0e6dbbee 100644 --- a/include/core/SkImageInfo.h +++ b/include/core/SkImageInfo.h @@ -219,6 +219,42 @@ enum SkYUVColorSpace { kLastEnum_SkYUVColorSpace = kRec709_SkYUVColorSpace, }; +/** \enum SkImageInfo::SkImageSourceChannel + Describes different channels we could read from image source. +*/ +enum SkImageSourceChannel { + /** Describes the red channel; */ + kR_SkImageSourceChannel, + + /** Describes the green channel; */ + kG_SkImageSourceChannel, + + /** Describes the blue channel; */ + kB_SkImageSourceChannel, + + /** Describes the alpha channel; */ + kA_SkImageSourceChannel, + + /** Describes the alpha channel; */ + kLastEnum_SkImageSourceChannel = kA_SkImageSourceChannel, +}; + +/** \struct SkYUVAIndex + Describes from which image source and which channel to read each individual YUVA plane. + + SkYUVAIndex contains a index for which image source to read from and a enum for which channel + to read from. +*/ +struct SK_API SkYUVAIndex { + /** The index is a number between -1..3 which definies which image source to read from, where -1 + * means the image source doesn't exist. The assumption is we will always have image sources for + * each of YUV planes, but optionally have image source for A plane. */ + int fIndex; + /** The channel describes from which channel to read the info from. Currently we only deal with + * YUV and NV12 and channel info is ignored. */ + SkImageSourceChannel fChannel; +}; + /** \struct SkImageInfo Describes pixel dimensions and encoding. SkBitmap, SkImage, PixMap, and SkSurface can be created from SkImageInfo. SkImageInfo can be retrieved from SkBitmap and |