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.
5 #ifndef UI_GFX_IMAGE_IMAGE_UTIL_H_
6 #define UI_GFX_IMAGE_IMAGE_UTIL_H_
10 #include "base/basictypes.h"
11 #include "ui/base/ui_export.h"
19 // Creates an image from the given JPEG-encoded input. If there was an error
20 // creating the image, returns an IsEmpty() Image.
21 UI_EXPORT Image
ImageFrom1xJPEGEncodedData(const unsigned char* input
,
24 // Fills the |dst| vector with JPEG-encoded bytes of the 1x representation of
26 // Returns true if the image has a 1x representation and the 1x representation
27 // was encoded successfully.
28 // |quality| determines the compression level, 0 == lowest, 100 == highest.
29 // Returns true if the Image was encoded successfully.
30 UI_EXPORT
bool JPEG1xEncodedDataFromImage(const Image
& image
,
32 std::vector
<unsigned char>* dst
);
36 #endif // UI_GFX_IMAGE_IMAGE_UTIL_H_