Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: components/suggestions/jpeg/jpeg_image_encoder.h

Issue 630073002: [Suggestions] Create ImageEncoder, to abstract away image encode/decode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn fix Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698