Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: src/core/SkColorMatrixFilterRowMajor255.h

Issue 1513393002: Add ability to extract YUV planes from SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gm cleanup Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColorMatrixFilter_DEFINED 8 #ifndef SkColorMatrixFilter_DEFINED
9 #define SkColorMatrixFilter_DEFINED 9 #define SkColorMatrixFilter_DEFINED
10 10
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 12
13 class SK_API SkColorMatrixFilterRowMajor255 : public SkColorFilter { 13 class SK_API SkColorMatrixFilterRowMajor255 : public SkColorFilter {
14 public: 14 public:
15 explicit SkColorMatrixFilterRowMajor255(const SkScalar array[20]); 15 explicit SkColorMatrixFilterRowMajor255(const SkScalar array[20]);
16 16
17 /** Creates a color matrix filter that returns the same value in all four ch annels. */
18 static SkColorFilter* CreateSingleChannelOutput(const SkScalar row[5]);
19
17 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid e; 20 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid e;
18 void filterSpan4f(const SkPM4f src[], int count, SkPM4f[]) const override; 21 void filterSpan4f(const SkPM4f src[], int count, SkPM4f[]) const override;
19 uint32_t getFlags() const override; 22 uint32_t getFlags() const override;
20 bool asColorMatrix(SkScalar matrix[20]) const override; 23 bool asColorMatrix(SkScalar matrix[20]) const override;
21 SkColorFilter* newComposed(const SkColorFilter*) const override; 24 SkColorFilter* newComposed(const SkColorFilter*) const override;
22 25
23 #if SK_SUPPORT_GPU 26 #if SK_SUPPORT_GPU
24 const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override; 27 const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override;
25 #endif 28 #endif
26 29
27 SK_TO_STRING_OVERRIDE() 30 SK_TO_STRING_OVERRIDE()
28 31
29 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter) 32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter)
30 33
31 protected: 34 protected:
32 void flatten(SkWriteBuffer&) const override; 35 void flatten(SkWriteBuffer&) const override;
33 36
34 private: 37 private:
38 SkColorMatrixFilterRowMajor255() {};
39
35 SkScalar fMatrix[20]; 40 SkScalar fMatrix[20];
36 float fTranspose[20]; // for Sk4s 41 float fTranspose[20]; // for Sk4s
37 uint32_t fFlags; 42 uint32_t fFlags;
38 43
39 void initState(const SkScalar array[20]); 44 void initState();
40 45
41 typedef SkColorFilter INHERITED; 46 typedef SkColorFilter INHERITED;
42 }; 47 };
43 48
44 #endif 49 #endif
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698