OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 SERVICES_IMAGE_DECODER_PUBLIC_CPP_DECODE_H_ |
| 6 #define SERVICES_IMAGE_DECODER_PUBLIC_CPP_DECODE_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <vector> |
| 11 |
| 12 #include "services/image_decoder/public/interfaces/image_decoder.mojom.h" |
| 13 |
| 14 namespace service_manager { |
| 15 class Connector; |
| 16 } |
| 17 |
| 18 namespace image_decoder { |
| 19 |
| 20 const uint64_t kDefaultMaxSizeInBytes = 128 * 1024 * 1024; |
| 21 |
| 22 // Helper function to decode an image via the image_decoder service. Upon |
| 23 // completion, |callback| is invoked on the calling thread TaskRunner with an |
| 24 // SkBitmap argument. The SkBitmap will be null on failure and non-null on |
| 25 // success. |
| 26 void Decode(service_manager::Connector* connector, |
| 27 const std::vector<uint8_t>& encoded_bytes, |
| 28 mojom::ImageCodec codec, |
| 29 bool shrink_to_fit, |
| 30 uint64_t max_size_in_bytes, |
| 31 const mojom::ImageDecoder::DecodeImageCallback& callback); |
| 32 |
| 33 } // namespace image_decoder |
| 34 |
| 35 #endif // SERVICES_IMAGE_DECODER_PUBLIC_CPP_DECODE_H_ |
OLD | NEW |