| 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 picture_utils_DEFINED | 8 #ifndef picture_utils_DEFINED |
| 9 #define picture_utils_DEFINED | 9 #define picture_utils_DEFINED |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * Replaces all instances of oldChar with newChar in str. | 28 * Replaces all instances of oldChar with newChar in str. |
| 29 * | 29 * |
| 30 * TODO: This function appears here and in skimage_main.cpp ; | 30 * TODO: This function appears here and in skimage_main.cpp ; |
| 31 * we should add the implementation to src/core/SkString.cpp, write tests fo
r it, | 31 * we should add the implementation to src/core/SkString.cpp, write tests fo
r it, |
| 32 * and remove it from elsewhere. | 32 * and remove it from elsewhere. |
| 33 */ | 33 */ |
| 34 void replace_char(SkString* str, const char oldChar, const char newChar); | 34 void replace_char(SkString* str, const char oldChar, const char newChar); |
| 35 | 35 |
| 36 // Creates a posix style filepath by concatenating name onto dir with a | |
| 37 // forward slash into path. | |
| 38 // TODO(epoger): delete in favor of SkOSPath::SkPathJoin()? | |
| 39 void make_filepath(SkString* path, const SkString&, const SkString& name); | |
| 40 | |
| 41 // Returns true if the string ends with % | 36 // Returns true if the string ends with % |
| 42 bool is_percentage(const char* const string); | 37 bool is_percentage(const char* const string); |
| 43 | 38 |
| 44 // Prepares the bitmap so that it can be written. | 39 // Prepares the bitmap so that it can be written. |
| 45 // | 40 // |
| 46 // Specifically, it configures the bitmap, allocates pixels and then | 41 // Specifically, it configures the bitmap, allocates pixels and then |
| 47 // erases the pixels to transparent black. | 42 // erases the pixels to transparent black. |
| 48 void setup_bitmap(SkBitmap* bitmap, int width, int height); | 43 void setup_bitmap(SkBitmap* bitmap, int width, int height); |
| 49 | 44 |
| 50 /** | 45 /** |
| 51 * Write a bitmap file to disk. | 46 * Write a bitmap file to disk. |
| 52 * | 47 * |
| 53 * @param bm the bitmap to record | 48 * @param bm the bitmap to record |
| 54 * @param dirPath directory within which to write the image file | 49 * @param dirPath directory within which to write the image file |
| 55 * @param subdirOrNull subdirectory within dirPath, or NULL to just write in
to dirPath | 50 * @param subdirOrNull subdirectory within dirPath, or NULL to just write in
to dirPath |
| 56 * @param baseName last part of the filename | 51 * @param baseName last part of the filename |
| 57 * | 52 * |
| 58 * @return true if written out successfully | 53 * @return true if written out successfully |
| 59 */ | 54 */ |
| 60 bool write_bitmap_to_disk(const SkBitmap& bm, const SkString& dirPath, | 55 bool write_bitmap_to_disk(const SkBitmap& bm, const SkString& dirPath, |
| 61 const char *subdirOrNull, const SkString& baseName
); | 56 const char *subdirOrNull, const SkString& baseName
); |
| 62 | 57 |
| 63 } // namespace sk_tools | 58 } // namespace sk_tools |
| 64 | 59 |
| 65 #endif // picture_utils_DEFINED | 60 #endif // picture_utils_DEFINED |
| OLD | NEW |