2 * Copyright 2013 The Android Open Source Project
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkResizeImageFilter_DEFINED
9 #define SkResizeImageFilter_DEFINED
11 #include "SkImageFilter.h"
17 /*! \class SkResizeImageFilter
18 Resampling image filter. This filter draws its source image resampled using the given scale
22 class SK_API SkResizeImageFilter : public SkImageFilter {
24 /** Construct a (scaling-only) resampling image filter.
25 * @param sx The x scale parameter to apply when resizing.
26 * @param sy The y scale parameter to apply when resizing.
27 * @param filterLevel The quality of filtering to apply when scaling.
28 * @param input The input image filter. If NULL, the src bitmap
29 * passed to filterImage() is used instead.
32 SkResizeImageFilter(SkScalar sx, SkScalar sy, SkPaint::FilterLevel filterLevel,
33 SkImageFilter* input = NULL);
34 virtual ~SkResizeImageFilter();
36 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkResizeImageFilter)
39 SkResizeImageFilter(SkReadBuffer& buffer);
40 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
42 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
43 SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
47 SkPaint::FilterLevel fFilterLevel;
48 typedef SkImageFilter INHERITED;