aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-16 18:44:18 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-16 18:44:18 +0000
commit4ce738b98ee0be1771712e3036a7711c21f3b7f4 (patch)
tree4d79f3bf93f80a137e697d7ef9dcb8f0635e6393 /include
parent886b25f14ce6a6974521f096eb5feac0b4327236 (diff)
Extract transform_scanline_XXXX functions into transform_scanline.h for code-sharing
Review URL: https://codereview.appspot.com/6849065 git-svn-id: http://skia.googlecode.com/svn/trunk@6468 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/images/SkImageEncoder.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/include/images/SkImageEncoder.h b/include/images/SkImageEncoder.h
index 5e350d46ff..3fbfefa5f7 100644
--- a/include/images/SkImageEncoder.h
+++ b/include/images/SkImageEncoder.h
@@ -28,8 +28,25 @@ public:
kDefaultQuality = 80
};
- bool encodeFile(const char file[], const SkBitmap&, int quality);
- bool encodeStream(SkWStream*, const SkBitmap&, int quality);
+ /**
+ * Encode bitmap 'bm' in the desired format, writing results to
+ * file 'file', at quality level 'quality' (which can be in range
+ * 0-100).
+ *
+ * Calls the particular implementation's onEncode() method to
+ * actually do the encoding.
+ */
+ bool encodeFile(const char file[], const SkBitmap& bm, int quality);
+
+ /**
+ * Encode bitmap 'bm' in the desired format, writing results to
+ * stream 'stream', at quality level 'quality' (which can be in
+ * range 0-100).
+ *
+ * Calls the particular implementation's onEncode() method to
+ * actually do the encoding.
+ */
+ bool encodeStream(SkWStream* stream, const SkBitmap& bm, int quality);
static bool EncodeFile(const char file[], const SkBitmap&, Type,
int quality);
@@ -37,7 +54,14 @@ public:
int quality);
protected:
- virtual bool onEncode(SkWStream*, const SkBitmap&, int quality) = 0;
+ /**
+ * Encode bitmap 'bm' in the desired format, writing results to
+ * stream 'stream', at quality level 'quality' (which can be in
+ * range 0-100).
+ *
+ * This must be overridden by each SkImageEncoder implementation.
+ */
+ virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) = 0;
};
// This macro declares a global (i.e., non-class owned) creation entry point