diff options
author | Mike Reed <reed@google.com> | 2017-04-28 13:53:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-28 18:25:17 +0000 |
commit | 736a9cc88d623f1c309b70554f02f0f111a30766 (patch) | |
tree | 44179aecaea55e9a3c6b9d59ca7358de84adcea7 /src/utils | |
parent | 185ba21bffc2df9ddfc1e351505a7a622821df1f (diff) |
remove unused yuv methods
Bug: skia:
Change-Id: Ie1e6c905d8989b49c2cf5c9e5fd1f383268f6480
Reviewed-on: https://skia-review.googlesource.com/14645
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkRGBAToYUV.cpp | 58 | ||||
-rw-r--r-- | src/utils/SkRGBAToYUV.h | 21 |
2 files changed, 0 insertions, 79 deletions
diff --git a/src/utils/SkRGBAToYUV.cpp b/src/utils/SkRGBAToYUV.cpp deleted file mode 100644 index 0528b144f0..0000000000 --- a/src/utils/SkRGBAToYUV.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkRGBAToYUV.h" -#include "SkCanvas.h" -#include "SkColorMatrixFilterRowMajor255.h" -#include "SkImage.h" -#include "SkPaint.h" -#include "SkSurface.h" - -bool SkRGBAToYUV(const SkImage* image, const SkISize sizes[3], void* const planes[3], - const size_t rowBytes[3], SkYUVColorSpace colorSpace) { - // Matrices that go from RGBA to YUV. - static const SkScalar kYUVColorSpaceInvMatrices[][15] = { - // kJPEG_SkYUVColorSpace - { 0.299001f, 0.586998f, 0.114001f, 0.f, 0.0000821798f * 255.f, - -0.168736f, -0.331263f, 0.499999f, 0.f, 0.499954f * 255.f, - 0.499999f, -0.418686f, -0.0813131f, 0.f, 0.499941f * 255.f}, - - // kRec601_SkYUVColorSpace - { 0.256951f, 0.504421f, 0.0977346f, 0.f, 0.0625f * 255.f, - -0.148212f, -0.290954f, 0.439166f, 0.f, 0.5f * 255.f, - 0.439166f, -0.367886f, -0.0712802f, 0.f, 0.5f * 255.f}, - - // kRec709_SkYUVColorSpace - { 0.182663f, 0.614473f, 0.061971f, 0.f, 0.0625f * 255.f, - -0.100672f, -0.338658f, 0.43933f, 0.f, 0.5f * 255.f, - 0.439142f, -0.39891f, -0.040231f, 0.f, 0.5f * 255.f}, - }; - static_assert(kLastEnum_SkYUVColorSpace == 2, "yuv color matrix array problem"); - static_assert(kJPEG_SkYUVColorSpace == 0, "yuv color matrix array problem"); - static_assert(kRec601_SkYUVColorSpace == 1, "yuv color matrix array problem"); - static_assert(kRec709_SkYUVColorSpace == 2, "yuv color matrix array problem"); - - for (int i = 0; i < 3; ++i) { - size_t rb = rowBytes[i] ? rowBytes[i] : sizes[i].fWidth; - auto surface(SkSurface::MakeRasterDirect( - SkImageInfo::MakeA8(sizes[i].fWidth, sizes[i].fHeight), planes[i], rb)); - if (!surface) { - return false; - } - SkPaint paint; - paint.setFilterQuality(kLow_SkFilterQuality); - paint.setBlendMode(SkBlendMode::kSrc); - int rowStartIdx = 5 * i; - const SkScalar* row = kYUVColorSpaceInvMatrices[colorSpace] + rowStartIdx; - paint.setColorFilter( - SkColorMatrixFilterRowMajor255::MakeSingleChannelOutput(row)); - surface->getCanvas()->drawImageRect(image, SkIRect::MakeWH(image->width(), image->height()), - SkRect::MakeIWH(surface->width(), surface->height()), - &paint); - } - return true; -} diff --git a/src/utils/SkRGBAToYUV.h b/src/utils/SkRGBAToYUV.h deleted file mode 100644 index 5c3c1b1465..0000000000 --- a/src/utils/SkRGBAToYUV.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkRGBAToYUV_DEFINED -#define SkRGBAToYUV_DEFINED - -#include "SkPixmap.h" -#include "SkSize.h" - -class SkImage; -// Works with any image type at the moment, but in the future it may only work with raster-backed -// images. This really should take a SkPixmap for the input, however the implementation for the -// time being requires an image. -bool SkRGBAToYUV(const SkImage*, const SkISize [3], void* const planes[3], - const size_t rowBytes[3], SkYUVColorSpace); - -#endif |