| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 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_COMMON_GPU_MEDIA_JPEG_CODEC_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_JPEG_CODEC_H_ |
| 7 |
| 8 #include <stddef.h> |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 // Interface for encoding/decoding JPEG data. This is a wrapper around libjpeg, |
| 14 // which has an inconvenient interface for callers. This is only used for UI |
| 15 // elements, WebKit has its own more complicated JPEG decoder which handles, |
| 16 // among other things, partially downloaded data. |
| 17 class JPEGCodec { |
| 18 public: |
| 19 |
| 20 enum Type { |
| 21 kDecoder, |
| 22 kEncoder, |
| 23 kImageProcessor, |
| 24 }; |
| 25 |
| 26 virtual ~JPEGCodec(); |
| 27 |
| 28 static scoped_ptr<JPEGCodec> Create(Type type); |
| 29 |
| 30 virtual bool Initialize() = 0; |
| 31 |
| 32 // Decodes the JPEG data contained in input of length input_size. The |
| 33 // decoded data will be placed in *output with the dimensions in *w and *h |
| 34 // on success (returns true). This data will be written in the'format' |
| 35 // format. On failure, the values of these output variables is undefined. |
| 36 virtual bool Decode(const unsigned char* input, size_t input_size, |
| 37 unsigned char** output, unsigned * w, unsigned * h, |
| 38 unsigned* row_bytes) = 0; |
| 39 |
| 40 // Decodes the JPEG data contained in input of length input_size. If |
| 41 // successful, a SkBitmap is created and returned. It is up to the caller |
| 42 // to delete the returned bitmap. |
| 43 //static SkBitmap* Decode(const unsigned char* input, size_t input_size); |
| 44 }; |
| 45 |
| 46 } // namespace content |
| 47 |
| 48 #endif // CONTENT_COMMON_GPU_MEDIA_JPEG_CODEC_H_ |
| OLD | NEW |