summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/ui/image_util.h
blob: bb953673fd6fad889773a76dddac199380b0d091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_
#define IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_

#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>

namespace gfx {
class Image;
}

@class UIColor;
@class UIImage;

// Returns the dominant color for |image|.
UIColor* DominantColorForImage(const gfx::Image& image, CGFloat opacity);

// Returns a copy of |image| configured to stretch at the given offsets.
UIImage* StretchableImageFromUIImage(UIImage* image,
                                     NSInteger left_cap_width,
                                     NSInteger top_cap_height);

// Returns the image named |name|, configured to stretch at the center pixel.
UIImage* StretchableImageNamed(NSString* name);

// Returns the image named |name|, configured to stretch at the given offsets.
UIImage* StretchableImageNamed(NSString* name,
                               NSInteger left_cap_width,
                               NSInteger top_cap_height);

#endif  // IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_