OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 COMPONENTS_BOOKMARKS_ENHANCED_IMAGE_STORE_UTIL_H_ | |
6 #define COMPONENTS_BOOKMARKS_ENHANCED_IMAGE_STORE_UTIL_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 #include "base/memory/ref_counted_memory.h" | |
10 #include "ui/gfx/geometry/size.h" | |
11 #include "ui/gfx/image/image.h" | |
12 | |
13 namespace image_store_util { | |
sky
2014/05/06 16:14:20
Namespaces generally should not match files. Inste
Kibeom Kim (inactive)
2014/05/07 00:09:46
Done.
| |
14 // The two methods below archive and unarchive an image to and from a bag of | |
15 // bytes. There is no API on gfx::Image capable of doing it while preserving the | |
16 // scale of the image. | |
17 | |
18 // Encode the UIImage representation of a gfx::Image. | |
sky
2014/05/06 16:14:20
UIImage?
Kibeom Kim (inactive)
2014/05/07 00:09:46
Done.
| |
19 scoped_refptr<base::RefCountedMemory> BytesForImage(gfx::Image image); | |
sky
2014/05/06 16:14:20
const gfx::Image&
Kibeom Kim (inactive)
2014/05/07 00:09:46
Done.
| |
20 | |
21 // Decode the UIImage in the bytes and returns a gfx::Image. | |
sky
2014/05/06 16:14:20
UIImage?
Kibeom Kim (inactive)
2014/05/07 00:09:46
Done.
| |
22 gfx::Image ImageForBytes(const scoped_refptr<base::RefCountedMemory>& data); | |
23 | |
24 } | |
25 | |
26 #endif // COMPONENTS_BOOKMARKS_ENHANCED_IMAGE_STORE_UTIL_H_ | |
OLD | NEW |