Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkLumaColorFilter.h
1 /*
2  * Copyright 2013 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkLumaColorFilter_DEFINED
9 #define SkLumaColorFilter_DEFINED
10 
11 #include "SkColorFilter.h"
12 #include "SkRefCnt.h"
13 
14 class SkRasterPipeline;
15 
27 class SK_API SkLumaColorFilter : public SkColorFilter {
28 public:
29  static sk_sp<SkColorFilter> Make();
30 
31  void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const override;
32 
33 #if SK_SUPPORT_GPU
35 #endif
36 
37  SK_TO_STRING_OVERRIDE()
38  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLumaColorFilter)
39 
40 protected:
41  void flatten(SkWriteBuffer&) const override;
42 
43 private:
45  void onAppendStages(SkRasterPipeline*, SkColorSpace*, SkArenaAlloc*,
46  bool shaderIsOpaque) const override;
47 
48  typedef SkColorFilter INHERITED;
49 };
50 
51 #endif
virtual sk_sp< GrFragmentProcessor > asFragmentProcessor(GrContext *, SkColorSpace *dstColorSpace) const
A subclass may implement this factory function to work with the GPU backend.
Definition: SkColorSpace.h:59
ColorFilters are optional objects in the drawing pipeline.
Definition: SkColorFilter.h:32
virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) const =0
Called with a scanline of colors, as if there was a shader installed.
SkFlattenable is the base class for objects that need to be flattened into a data stream for either t...
Definition: SkFlattenable.h:70
Definition: GrContext.h:47
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:161
Luminance-to-alpha color filter, as defined in http://www.w3.org/TR/SVG/masking.html#Masking http://w...
Definition: SkLumaColorFilter.h:27
Definition: SkWriteBuffer.h:27
virtual void flatten(SkWriteBuffer &) const
Override this if your subclass needs to record data that it will need to recreate itself from its Cre...
Definition: SkFlattenable.h:117