OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ | |
7 #pragma once | |
8 | |
9 #include <vector> | |
10 | |
11 #include "third_party/skia/include/core/SkBitmap.h" | |
12 | |
13 namespace chromeos { | |
14 | |
15 // Wrapper class for bitmaps and raw images when it's necessary. Could | |
16 // be used for storing profile images (including animated profile | |
17 // images) and user wallpapers. | |
Nikita (slow)
2012/05/30 17:19:11
nit: why wallpaper is mentioned? Is there a plan t
ygorshenin1
2012/05/31 11:17:46
As UserImageLoader is used to load both wallpapers
| |
18 class UserImage { | |
19 public: | |
20 typedef std::vector<unsigned char> RawImage; | |
21 | |
22 // Constructs UserImage from bitmap. Should be used where only | |
23 // static image is needed (e.g. wallpapers). | |
24 explicit UserImage(const SkBitmap& image); | |
25 | |
26 // Constructs UserImage from raw image and bitmap that should | |
27 // represent single frame from that one. Can be used for wrapping | |
28 // animated images. | |
29 UserImage(const SkBitmap& image, const RawImage& raw_image); | |
30 | |
31 virtual ~UserImage(); | |
32 | |
33 void SetImage(const SkBitmap& image); | |
Nikita (slow)
2012/05/30 17:19:11
nit: Add comment that setting image would reset ra
ygorshenin1
2012/05/31 11:17:46
Done.
| |
34 const SkBitmap& image() const { return image_; } | |
35 bool has_raw_image() const { return has_raw_image_; } | |
36 bool has_animated_image() const { return has_animated_image_; } | |
37 const RawImage& raw_image() const { return raw_image_; } | |
38 | |
39 private: | |
40 SkBitmap image_; | |
41 bool has_raw_image_; | |
42 bool has_animated_image_; | |
43 RawImage raw_image_; | |
44 }; | |
45 | |
46 } // namespace chromeos | |
47 | |
48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_H_ | |
OLD | NEW |