| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkImageDecoder_DEFINED | 10 #ifndef SkImageDecoder_DEFINED |
| 11 #define SkImageDecoder_DEFINED | 11 #define SkImageDecoder_DEFINED |
| 12 | 12 |
| 13 #include "SkBitmap.h" | 13 #include "SkBitmap.h" |
| 14 #include "SkBitmapFactory.h" | 14 #include "SkBitmapFactory.h" |
| 15 #include "SkImage.h" | 15 #include "SkImage.h" |
| 16 #include "SkRect.h" | 16 #include "SkRect.h" |
| 17 #include "SkRefCnt.h" | 17 #include "SkRefCnt.h" |
| 18 | 18 |
| 19 class SkStream; | 19 class SkStream; |
| 20 | 20 |
| 21 /** \class SkImageDecoder | 21 /** \class SkImageDecoder |
| 22 | 22 |
| 23 Base class for decoding compressed images into a SkBitmap | 23 Base class for decoding compressed images into a SkBitmap |
| 24 */ | 24 */ |
| 25 class SkImageDecoder { | 25 class SkImageDecoder { |
| 26 public: | 26 public: |
| 27 virtual ~SkImageDecoder(); | 27 virtual ~SkImageDecoder(); |
| 28 | 28 |
| 29 // Should be consistent with kFormatName | 29 // Should be consistent with sFormatName |
| 30 enum Format { | 30 enum Format { |
| 31 kUnknown_Format, | 31 kUnknown_Format, |
| 32 kBMP_Format, | 32 kBMP_Format, |
| 33 kGIF_Format, | 33 kGIF_Format, |
| 34 kICO_Format, | 34 kICO_Format, |
| 35 kJPEG_Format, | 35 kJPEG_Format, |
| 36 kPNG_Format, | 36 kPNG_Format, |
| 37 kWBMP_Format, | 37 kWBMP_Format, |
| 38 kWEBP_Format, | 38 kWEBP_Format, |
| 39 | 39 |
| 40 kLastKnownFormat = kWEBP_Format | 40 kLastKnownFormat = kWEBP_Format |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 /** Return the compressed data's format (see Format enum) | 43 /** Return the format of image this decoder can decode. If this decoder can
decode multiple |
| 44 formats, kUnknown_Format will be returned. |
| 44 */ | 45 */ |
| 45 virtual Format getFormat() const; | 46 virtual Format getFormat() const; |
| 46 | 47 |
| 47 /** Return the compressed data's format name. | 48 /** Return a readable string of the value returned by getFormat(). |
| 48 */ | 49 */ |
| 49 const char* getFormatName() const; | 50 const char* getFormatName() const; |
| 50 | 51 |
| 51 /** Returns true if the decoder should try to dither the resulting image. | 52 /** Returns true if the decoder should try to dither the resulting image. |
| 52 The default setting is true. | 53 The default setting is true. |
| 53 */ | 54 */ |
| 54 bool getDitherImage() const { return fDitherImage; } | 55 bool getDitherImage() const { return fDitherImage; } |
| 55 | 56 |
| 56 /** Set to true if the the decoder should try to dither the resulting image. | 57 /** Set to true if the the decoder should try to dither the resulting image. |
| 57 The default setting is true. | 58 The default setting is true. |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // not all of these will be available | 468 // not all of these will be available |
| 468 DECLARE_DECODER_CREATOR(BMPImageDecoder); | 469 DECLARE_DECODER_CREATOR(BMPImageDecoder); |
| 469 DECLARE_DECODER_CREATOR(GIFImageDecoder); | 470 DECLARE_DECODER_CREATOR(GIFImageDecoder); |
| 470 DECLARE_DECODER_CREATOR(ICOImageDecoder); | 471 DECLARE_DECODER_CREATOR(ICOImageDecoder); |
| 471 DECLARE_DECODER_CREATOR(JPEGImageDecoder); | 472 DECLARE_DECODER_CREATOR(JPEGImageDecoder); |
| 472 DECLARE_DECODER_CREATOR(PNGImageDecoder); | 473 DECLARE_DECODER_CREATOR(PNGImageDecoder); |
| 473 DECLARE_DECODER_CREATOR(WBMPImageDecoder); | 474 DECLARE_DECODER_CREATOR(WBMPImageDecoder); |
| 474 DECLARE_DECODER_CREATOR(WEBPImageDecoder); | 475 DECLARE_DECODER_CREATOR(WEBPImageDecoder); |
| 475 | 476 |
| 476 #endif | 477 #endif |
| OLD | NEW |