Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / ios / chrome / browser / ui / image_util.h
blobbb953673fd6fad889773a76dddac199380b0d091
1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_
6 #define IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_
8 #import <CoreGraphics/CoreGraphics.h>
9 #import <Foundation/Foundation.h>
11 namespace gfx {
12 class Image;
15 @class UIColor;
16 @class UIImage;
18 // Returns the dominant color for |image|.
19 UIColor* DominantColorForImage(const gfx::Image& image, CGFloat opacity);
21 // Returns a copy of |image| configured to stretch at the given offsets.
22 UIImage* StretchableImageFromUIImage(UIImage* image,
23 NSInteger left_cap_width,
24 NSInteger top_cap_height);
26 // Returns the image named |name|, configured to stretch at the center pixel.
27 UIImage* StretchableImageNamed(NSString* name);
29 // Returns the image named |name|, configured to stretch at the given offsets.
30 UIImage* StretchableImageNamed(NSString* name,
31 NSInteger left_cap_width,
32 NSInteger top_cap_height);
34 #endif // IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_