Skia
2DGraphicsLibrary
 All Classes Namespaces 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& srcRect, SkScalar inset,
19  const CropRect* cropRect = nullptr);
20 
21  SK_TO_STRING_OVERRIDE()
22  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
23 
24 protected:
25  SkMagnifierImageFilter(const SkRect& srcRect,
26  SkScalar inset,
28  const CropRect* cropRect);
29  void flatten(SkWriteBuffer&) const override;
30 
31  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
32  SkIPoint* offset) const override;
33  sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
34 
35 private:
36  SkRect fSrcRect;
37  SkScalar fInset;
38 
39  typedef SkImageFilter INHERITED;
40 };
41 
42 #endif
Definition: SkImageFilter.h:76
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:125
Base class for image filters.
Definition: SkImageFilter.h:36
Definition: SkMagnifierImageFilter.h:15
Definition: SkWriteBuffer.h:27
Definition: SkRect.h:404
Definition: SkImageFilter.h:54
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40