Skia
2DGraphicsLibrary
 All Classes 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 
25 class SK_API SkLumaColorFilter : public SkColorFilter {
26 public:
27  static sk_sp<SkColorFilter> Make();
28 
29 #ifdef SK_SUPPORT_LEGACY_COLORFILTER_PTR
30  static SkColorFilter* Create() { return Make().release(); }
31 #endif
32 
33  void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const override;
34 
35 #if SK_SUPPORT_GPU
37 #endif
38 
39  SK_TO_STRING_OVERRIDE()
40  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLumaColorFilter)
41 
42 protected:
43  void flatten(SkWriteBuffer&) const override;
44 
45 private:
47 
48  typedef SkColorFilter INHERITED;
49 };
50 
51 #endif
T *SK_WARN_UNUSED_RESULT release()
Return the bare pointer, and set the internal object pointer to nullptr.
Definition: SkRefCnt.h:363
ColorFilters are optional objects in the drawing pipeline.
Definition: SkColorFilter.h:29
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:48
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:147
Luminance-to-alpha color filter, as defined in http://www.w3.org/TR/SVG/masking.html#Masking http://w...
Definition: SkLumaColorFilter.h:25
Definition: SkWriteBuffer.h:26
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
virtual sk_sp< GrFragmentProcessor > asFragmentProcessor(GrContext *) const
A subclass may implement this factory function to work with the GPU backend.