Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkImageEncoder.h
1 /*
2  * Copyright 2011 Google Inc.
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 SkImageEncoder_DEFINED
9 #define SkImageEncoder_DEFINED
10 
11 #include "SkBitmap.h"
12 #include "SkEncodedImageFormat.h"
13 #include "SkStream.h"
14 
34 SK_API bool SkEncodeImage(SkWStream* dst, const SkPixmap& src,
35  SkEncodedImageFormat format, int quality);
39 inline bool SkEncodeImage(SkWStream* dst, const SkBitmap& src, SkEncodedImageFormat f, int q) {
40  SkPixmap pixmap;
41  return src.peekPixels(&pixmap) && SkEncodeImage(dst, pixmap, f, q);
42 }
43 
44 #endif // SkImageEncoder_DEFINED
bool peekPixels(SkPixmap *) const
If the pixels are available from this bitmap return true, and fill out the specified pixmap (if not n...
Pairs SkImageInfo with actual pixels and rowbytes.
Definition: SkPixmap.h:23
The SkBitmap class specifies a raster bitmap.
Definition: SkBitmap.h:37
Definition: SkStream.h:182