Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkMagnifierImageFilter.h
1 /*
2  * Copyright 2012 The Android Open Source Project
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 
9 #ifndef SkMagnifierImageFilter_DEFINED
10 #define SkMagnifierImageFilter_DEFINED
11 
12 #include "SkRect.h"
13 #include "SkImageFilter.h"
14 
15 class SK_API SkMagnifierImageFilter : public SkImageFilter {
16 public:
17  static sk_sp<SkImageFilter> Make(const SkRect& src, SkScalar inset,
19  const CropRect* cropRect = nullptr);
20 
21  SK_TO_STRING_OVERRIDE()
22  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
23 
24 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
25  static SkImageFilter* Create(const SkRect& src, SkScalar inset,
26  SkImageFilter* input = nullptr) {
27  return Make(src, inset, sk_ref_sp<SkImageFilter>(input)).release();
28  }
29 #endif
30 
31 protected:
32  SkMagnifierImageFilter(const SkRect& srcRect,
33  SkScalar inset,
35  const CropRect* cropRect);
36  void flatten(SkWriteBuffer&) const override;
37 
38  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
39  SkIPoint* offset) const override;
40 
41 private:
42  SkRect fSrcRect;
43  SkScalar fInset;
44  typedef SkImageFilter INHERITED;
45 };
46 
47 #endif
T *SK_WARN_UNUSED_RESULT release()
Return the bare pointer, and set the internal object pointer to nullptr.
Definition: SkRefCnt.h:363
Definition: SkImageFilter.h:55
void flatten(SkWriteBuffer &) const override
Override this if your subclass needs to record data that it will need to recreate itself from its Cre...
virtual sk_sp< SkSpecialImage > onFilterImage(SkSpecialImage *src, const Context &, SkIPoint *offset) const =0
This is the virtual which should be overridden by the derived class to perform image filtering...
Definition: SkRefCnt.h:135
Base class for image filters.
Definition: SkImageFilter.h:35
Definition: SkMagnifierImageFilter.h:15
Definition: SkWriteBuffer.h:26
Definition: SkRect.h:390
Definition: SkImageFilter.h:37
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40