Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkOffsetImageFilter.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 #ifndef SkOffsetImageFilter_DEFINED
9 #define SkOffsetImageFilter_DEFINED
10 
11 #include "SkImageFilter.h"
12 #include "SkPoint.h"
13 
14 class SK_API SkOffsetImageFilter : public SkImageFilter {
15 public:
16  static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy,
18  const CropRect* cropRect = nullptr);
19 
20  SkRect computeFastBounds(const SkRect& src) const override;
21 
22  SK_TO_STRING_OVERRIDE()
23  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter)
24 
25 protected:
26  void flatten(SkWriteBuffer&) const override;
27  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
28  SkIPoint* offset) const override;
29  sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
30  SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override;
31 
32 private:
33  SkOffsetImageFilter(SkScalar dx, SkScalar dy, sk_sp<SkImageFilter> input, const CropRect*);
34 
35  SkVector fOffset;
36 
37  typedef SkImageFilter INHERITED;
38 };
39 
40 #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...
Definition: SkPoint.h:156
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:28
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: SkOffsetImageFilter.h:14
Definition: SkWriteBuffer.h:27
Definition: SkRect.h:404
virtual SkIRect onFilterNodeBounds(const SkIRect &, const SkMatrix &, MapDirection) const
Performs a forwards or reverse mapping of the given rect to accommodate this filter's margin requirem...
Definition: SkImageFilter.h:54
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40