| 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_SUGGESTIONS_IMAGE_ENCODER_H_ | |
| 6 #define COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 class SkBitmap; | |
| 13 | |
| 14 namespace suggestions { | |
| 15 | |
| 16 // A interface to encode/decode images. | |
| 17 class ImageEncoder { | |
| 18 public: | |
| 19 ImageEncoder() {} | |
| 20 virtual ~ImageEncoder() {} | |
| 21 | |
| 22 // From encoded bytes to SkBitmap. Caller owns the returned pointer. | |
| 23 virtual SkBitmap* DecodeImage( | |
| 24 const std::vector<unsigned char>& encoded_data) = 0; | |
| 25 | |
| 26 // From SkBitmap to the vector of encoded bytes, |dst|. | |
| 27 virtual bool EncodeImage( | |
| 28 const SkBitmap& bitmap, std::vector<unsigned char>* dest) = 0; | |
| 29 | |
| 30 private: | |
| 31 DISALLOW_COPY_AND_ASSIGN(ImageEncoder); | |
| 32 }; | |
| 33 | |
| 34 } // namespace suggestions | |
| 35 | |
| 36 #endif // COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_H_ | |
| OLD | NEW |