blob: aeb625f6e53ef6e337dec13ff2b6d98e8ec62235 [file] [log] [blame]
twiz@google.com6cf53032012-06-22 18:55:55 +00001/*
2 * Copyright 2012 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 picture_utils_DEFINED
9#define picture_utils_DEFINED
10#include "SkTypes.h"
11
12class SkBitmap;
13class SkFILEStream;
14class SkString;
15class SkPicture;
16
17namespace sk_tools {
18 // Creates a posix style filepath by concatenating name onto dir with a
19 // forward slash into path.
keyar@chromium.org1cbd47c2012-07-13 18:22:59 +000020 void make_filepath(SkString* path, const SkString&, const SkString& name);
twiz@google.com6cf53032012-06-22 18:55:55 +000021
keyar@chromium.orgd1dc9202012-07-09 18:32:08 +000022 // Returns the last part of the path (file name or leaf directory name)
23 //
24 // This basically just looks for a foward slash or backslash (windows
25 // only)
26 void get_basename(SkString* basename, const SkString& path);
27
twiz@google.com6cf53032012-06-22 18:55:55 +000028 // Prepares the bitmap so that it can be written.
29 //
30 // Specifically, it configures the bitmap, allocates pixels and then
31 // erases the pixels to transparent black.
32 void setup_bitmap(SkBitmap* bitmap, int width, int height);
33}
34
35#endif // picture_utils_DEFINED