1 // Copyright (c) 2013 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 CONTENT_PUBLIC_CHILD_IMAGE_DECODER_UTILS_H_ 6 #define CONTENT_PUBLIC_CHILD_IMAGE_DECODER_UTILS_H_ 7 8 #include <stddef.h> 9 10 #include "content/common/content_export.h" 11 12 class SkBitmap; 13 14 namespace gfx { 15 class Size; 16 } 17 18 namespace content { 19 20 // Helper function to decode the image using the data passed in. 21 // On success returns the decoded image. 22 // On failure returns an empty bitmap. 23 CONTENT_EXPORT SkBitmap DecodeImage(const unsigned char* data, 24 const gfx::Size& desired_image_size, 25 size_t size); 26 } // namespace content 27 28 #endif // CONTENT_PUBLIC_CHILD_IMAGE_DECODER_UTILS_H_ 29