OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 /** | 78 /** |
79 * If the image has direct access to its pixels (i.e. they are in local | 79 * If the image has direct access to its pixels (i.e. they are in local |
80 * RAM) return the (const) address of those pixels, and if not null, return | 80 * RAM) return the (const) address of those pixels, and if not null, return |
81 * the ImageInfo and rowBytes. The returned address is only valid while | 81 * the ImageInfo and rowBytes. The returned address is only valid while |
82 * the image object is in scope. | 82 * the image object is in scope. |
83 * | 83 * |
84 * On failure, returns NULL and the info and rowBytes parameters are | 84 * On failure, returns NULL and the info and rowBytes parameters are |
85 * ignored. | 85 * ignored. |
86 */ | 86 */ |
87 const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const; | 87 const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const; |
88 | 88 |
89 /** | 89 /** |
90 * Encode the image's pixels and return the result as a new SkData, which | 90 * Encode the image's pixels and return the result as a new SkData, which |
91 * the caller must manage (i.e. call unref() when they are done). | 91 * the caller must manage (i.e. call unref() when they are done). |
92 * | 92 * |
93 * If the image type cannot be encoded, or the requested encoder type is | 93 * If the image type cannot be encoded, or the requested encoder type is |
94 * not supported, this will return NULL. | 94 * not supported, this will return NULL. |
95 */ | 95 */ |
96 SkData* encode(SkImageEncoder::Type t = SkImageEncoder::kPNG_Type, | 96 SkData* encode(SkImageEncoder::Type t = SkImageEncoder::kPNG_Type, |
97 int quality = 80) const; | 97 int quality = 80) const; |
98 | 98 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 * On failure, false will be returned, and bitmap will unmodified. | 133 * On failure, false will be returned, and bitmap will unmodified. |
134 */ | 134 */ |
135 // On ice for now: | 135 // On ice for now: |
136 // - should it respect the particular colortype/alphatype of the src | 136 // - should it respect the particular colortype/alphatype of the src |
137 // - should it have separate entrypoints for preallocated and not bitmaps? | 137 // - should it have separate entrypoints for preallocated and not bitmaps? |
138 // - isn't it enough to allow the caller to draw() the image into a canvas? | 138 // - isn't it enough to allow the caller to draw() the image into a canvas? |
139 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; | 139 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; |
140 }; | 140 }; |
141 | 141 |
142 #endif | 142 #endif |
OLD | NEW |