From 946a690d3146c6c9966fc01ffcf9ab5d033f2023 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Fri, 5 Oct 2018 15:19:24 -0400 Subject: [PATCH] fix bookmaker add a couple of undefined terms and make the parameter descriptions start lowercase NOTRY=true R=robertphillips@google.com Docs-Preview: https://skia.org/?cl=160160 Bug: skia: Change-Id: I45223943ce56d9ca13e818bc5e21607b8c4ee100 Reviewed-on: https://skia-review.googlesource.com/c/160160 Reviewed-by: Robert Phillips Commit-Queue: Cary Clark --- docs/SkImage_Reference.bmh | 4 +- docs/undocumented.bmh | 2 +- site/user/api/SkImage_Reference.md | 171 +++++++++++++++++++++++++---- site/user/api/catalog.htm | 4 +- site/user/api/undocumented.md | 4 + 5 files changed, 159 insertions(+), 26 deletions(-) diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh index 35261dc303..513d950c1c 100644 --- a/docs/SkImage_Reference.bmh +++ b/docs/SkImage_Reference.bmh @@ -636,7 +636,7 @@ Recognized formats vary by GPU back-end. Creates an SkImage by flattening the specified YUVA planes into a single, interleaved RGBA image. #Param context GPU context ## -#Param yuvColorSpace How the YUV values are converted to RGB. One of: +#Param yuvColorSpace how the YUV values are converted to RGB. One of: kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace, kRec709_SkYUVColorSpace ## @@ -684,7 +684,7 @@ Creates an SkImage by flattening the specified YUVA planes into a single, interl image. backendTexture is used to store the result of the flattening. #Param context GPU context ## -#Param yuvColorSpace How the YUV values are converted to RGB. One of: +#Param yuvColorSpace how the YUV values are converted to RGB. One of: kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace, kRec709_SkYUVColorSpace ## diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh index ad056fa952..7c72da6642 100644 --- a/docs/undocumented.bmh +++ b/docs/undocumented.bmh @@ -2,7 +2,7 @@ #External DirectWrite TrueType Windows Linux Android iOS __ANDROID_API__ AHardwareBuffer FreeType FreeType-based Harfbuzz - LCD RGB sRGB ARGB BGR YUV SDTV HDTV + LCD RGB sRGB BGR RGBA ARGB YUV YUVA SDTV HDTV Unicode Unicode5 UTF-8 UTF-16 UTF-32 ASCII Unichar API BMP GIF HEIF ICO JPEG PNG WBMP WebP diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index 57c4c956b2..e297a3bf3e 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -229,6 +229,14 @@ SkImage can be constructed or initialized by these functions, including C++ clas MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk sp<SkColorSpace> colorSpace, TextureReleaseProc textureReleaseProc, ReleaseContext releaseContext) + + MakeFromYUVATexturesCopy + creates Image from YUV ColorSpace data + + + MakeFromYUVATexturesCopyWithExternalBackend + creates Image from planar YUV ColorSpace, stored in texture + MakeFromYUVTexturesCopy creates Image from YUV ColorSpace data in three planes @@ -346,6 +354,14 @@ SkImage member functions read and modify the structure properties. MakeFromTexture creates Image from GPU Texture + + MakeFromYUVATexturesCopy + creates Image from YUV ColorSpace data + + + MakeFromYUVATexturesCopyWithExternalBackend + creates Image from planar YUV ColorSpace, stored in texture + MakeFromYUVTexturesCopy creates Image from YUV ColorSpace data in three planes @@ -892,7 +908,7 @@ created Image, or nullptr ### Example -
+
### See Also @@ -1077,14 +1093,127 @@ created Image, or nullptr --- + +## MakeFromYUVATexturesCopy + +
+static sk sp<SkImage> MakeFromYUVATexturesCopy(GrContext* context, SkYUVColorSpace yuvColorSpace,
+                                               const GrBackendTexture yuvaTextures[],
+                                               const SkYUVAIndex yuvaIndices[4], SkISize imageSize,
+                                               GrSurfaceOrigin imageOrigin,
+                                               sk sp<SkColorSpace> imageColorSpace = nullptr)
+
+ +Creates an SkImage by flattening the specified YUVA planes into a single, interleaved RGBA image. + +### Parameters + + + + + + + + + + + + + + + + + + + + + + +
contextGPU context
yuvColorSpacehow the YUV values are converted to RGB. One of: +kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace, +kRec709_SkYUVColorSpace
yuvaTexturesarray of (up to four) YUVA textures on GPU which contain the, +possibly interleaved, YUVA planes
yuvaIndicesarray indicating which texture (in 'yuvaTextures') and channel +(in the specified texture) maps to each of Y, U, V, and A. +
imageSizesize of the resulting image
imageOriginorigin of the resulting image. One of: kBottomLeft GrSurfaceOrigin, +kTopLeft GrSurfaceOrigin
imageColorSpacerange of colors of the resulting image; may be nullptr
+ +### Return Value + +created SkImage, or nullptr + +### See Also + +MakeFromYUVATexturesCopyWithExternalBackend + +--- + + +## MakeFromYUVATexturesCopyWithExternalBackend + +
+static sk sp<SkImage> MakeFromYUVATexturesCopyWithExternalBackend(
+            GrContext* context,
+                        SkYUVColorSpace yuvColorSpace, const GrBackendTexture yuvaTextures[],
+                        const SkYUVAIndex yuvaIndices[4], SkISize imageSize,
+                        GrSurfaceOrigin imageOrigin, const GrBackendTexture& backendTexture,
+                        sk sp<SkColorSpace> imageColorSpace = nullptr)
+
+ +Creates an SkImage by flattening the specified YUVA planes into a single, interleaved RGBA +image. backendTexture is used to store the result of the flattening. + +### Parameters + + + + + + + + + + + + + + + + + + + + + + + + + +
contextGPU context
yuvColorSpacehow the YUV values are converted to RGB. One of: +kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace, +kRec709_SkYUVColorSpace
yuvaTexturesarray of (up to four) YUVA textures on GPU which contain the, +possibly interleaved, YUVA planes
yuvaIndicesarray indicating which texture (in 'yuvaTextures') and channel +(in the specified texture) maps to each of Y, U, V, and A. +
imageSizesize of the resulting image
imageOriginorigin of the resulting image. One of: kBottomLeft GrSurfaceOrigin, +kTopLeft GrSurfaceOrigin
backendTexturethe resource that stores the final pixels
imageColorSpacerange of colors of the resulting image; may be nullptr
+ +### Return Value + +created SkImage, or nullptr + +### See Also + +MakeFromYUVATexturesCopy + +--- + ## MakeFromYUVTexturesCopy
 static sk sp<SkImage> MakeFromYUVTexturesCopy(GrContext* context, SkYUVColorSpace yuvColorSpace,
                                               const GrBackendTexture yuvTextures[3],
-                                              GrSurfaceOrigin surfaceOrigin,
-                                              sk sp<SkColorSpace> colorSpace = nullptr)
+                                              GrSurfaceOrigin imageOrigin,
+                                              sk sp<SkColorSpace> imageColorSpace = nullptr)
 
Creates Image from copy of yuvTextures, an array of textures on GPU. @@ -1103,10 +1232,10 @@ Creates Image from copy of yuvTextures array of YUV textures on GPU - surfaceOrigin + imageOrigin one of: kBottomLeft GrSurfaceOrigin, kTopLeft GrSurfaceOrigin - colorSpace + imageColorSpace range of colors; may be nullptr @@ -1117,7 +1246,7 @@ created Image, or nullptr ### See Also -MakeFromYUVTexturesCopyWithExternalBackend MakeFromNV12TexturesCopy +MakeFromYUVTexturesCopyWithExternalBackend MakeFromNV12TexturesCopy MakeFromYUVATexturesCopy --- @@ -1128,8 +1257,8 @@ created Image, or nullptr static sk sp<SkImage> MakeFromYUVTexturesCopyWithExternalBackend( GrContext* context, SkYUVColorSpace yuvColorSpace, const GrBackendTexture yuvTextures[3], - GrSurfaceOrigin surfaceOrigin, const GrBackendTexture backendTexture, - sk sp<SkColorSpace> colorSpace = nullptr) ; + GrSurfaceOrigin imageOrigin, const GrBackendTexture& backendTexture, + sk sp<SkColorSpace> imageColorSpace = nullptr) ; Creates Image from copy of yuvTextures, an array of textures on GPU. @@ -1149,13 +1278,13 @@ convert to RGB colors. yuvTextures array of YUV textures on GPU - surfaceOrigin + imageOrigin one of: kBottomLeft GrSurfaceOrigin, kTopLeft GrSurfaceOrigin backendTexture the resource that stores the final pixels - colorSpace + imageColorSpace range of colors; may be nullptr @@ -1166,7 +1295,7 @@ created SkImage, or nullptr ### See Also -MakeFromYUVTexturesCopy MakeFromNV12TexturesCopy +MakeFromYUVTexturesCopy MakeFromNV12TexturesCopy MakeFromYUVATexturesCopyWithExternalBackend --- @@ -1176,8 +1305,8 @@ created SkImage, or nullptr
 static sk sp<SkImage> MakeFromNV12TexturesCopy(GrContext* context, SkYUVColorSpace yuvColorSpace,
                                                const GrBackendTexture nv12Textures[2],
-                                               GrSurfaceOrigin surfaceOrigin,
-                                               sk sp<SkColorSpace> colorSpace = nullptr)
+                                               GrSurfaceOrigin imageOrigin,
+                                               sk sp<SkColorSpace> imageColorSpace = nullptr)
 
Creates Image from copy of nv12Textures, an array of textures on GPU. @@ -1199,10 +1328,10 @@ Returned Image has the dimensions nv12Textures array of YUV textures on GPU - surfaceOrigin + imageOrigin one of: kBottomLeft GrSurfaceOrigin, kTopLeft GrSurfaceOrigin - colorSpace + imageColorSpace range of colors; may be nullptr @@ -1213,7 +1342,7 @@ created Image, or nullptr ### See Also -MakeFromNV12TexturesCopyWithExternalBackend MakeFromYUVTexturesCopy +MakeFromNV12TexturesCopyWithExternalBackend MakeFromYUVTexturesCopy MakeFromYUVATexturesCopy --- @@ -1224,8 +1353,8 @@ created Image, or nullptr static sk sp<SkImage> MakeFromNV12TexturesCopyWithExternalBackend( GrContext* context, SkYUVColorSpace yuvColorSpace, const GrBackendTexture nv12Textures[2], - GrSurfaceOrigin surfaceOrigin, const GrBackendTexture backendTexture, - sk sp<SkColorSpace> colorSpace = nullptr) ; + GrSurfaceOrigin imageOrigin, const GrBackendTexture& backendTexture, + sk sp<SkColorSpace> imageColorSpace = nullptr) ; Creates Image from copy of nv12Textures, an array of textures on GPU. @@ -1247,13 +1376,13 @@ Returned Image has the dimensions nv12Textures array of YUV textures on GPU - surfaceOrigin + imageOrigin one of: kBottomLeft GrSurfaceOrigin, kTopLeft GrSurfaceOrigin backendTexture the resource that stores the final pixels - colorSpace + imageColorSpace range of colors; may be nullptr @@ -1264,7 +1393,7 @@ created Image, or nullptr ### See Also -MakeFromNV12TexturesCopy MakeFromYUVTexturesCopy +MakeFromNV12TexturesCopy MakeFromYUVTexturesCopy MakeFromYUVATexturesCopyWithExternalBackend --- diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index 919a625587..49bc74c4d8 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -6153,10 +6153,10 @@ "name": "SkImage::MakeFromTexture" }, "SkImage_MakeFromTexture_2": { - "code": "void draw(SkCanvas* canvas) {\n GrContext* context = canvas->getGrContext();\n if (!context) {\n return;\n }\n auto debugster = [](SkImage::ReleaseContext releaseContext) -> void {\n // broken \n // *((int *) releaseContext) += 128;\n };\n int x = 0;\n for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {\n sk_sp image = SkImage::MakeFromTexture(context, backEndTexture,\n origin, kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr, debugster, &x);\n canvas->drawImage(image, x, 0);\n x += 128;\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n GrContext* context = canvas->getGrContext();\n if (!context) {\n return;\n }\n auto debugster = [](SkImage::ReleaseContext releaseContext) -> void {\n // broken\n // *((int *) releaseContext) += 128;\n };\n int x = 0;\n for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {\n sk_sp image = SkImage::MakeFromTexture(context, backEndTexture,\n origin, kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr, debugster, &x);\n canvas->drawImage(image, x, 0);\n x += 128;\n }\n}", "width": 256, "height": 256, - "hash": "5af7b864b6ed8d96def81206124ac699", + "hash": "f40e1ebba6b067714062b81877b22fa1", "file": "SkImage_Reference", "name": "SkImage::MakeFromTexture_2" }, diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index e4ca275472..7a7741e839 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -660,3 +660,7 @@ bool isValid() const # YUV Component V # YUV Component Y + +# YUV Planes + +# Class SkYUVAIndex