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