Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkCodec_DEFINED | 8 #ifndef SkCodec_DEFINED |
| 9 #define SkCodec_DEFINED | 9 #define SkCodec_DEFINED |
| 10 | 10 |
| 11 #include "../private/SkTemplates.h" | 11 #include "../private/SkTemplates.h" |
| 12 #include "SkColor.h" | 12 #include "SkColor.h" |
| 13 #include "SkEncodedFormat.h" | 13 #include "SkEncodedFormat.h" |
| 14 #include "SkEncodedInfo.h" | 14 #include "SkEncodedInfo.h" |
| 15 #include "SkImageInfo.h" | 15 #include "SkImageInfo.h" |
| 16 #include "SkSize.h" | 16 #include "SkSize.h" |
| 17 #include "SkStream.h" | 17 #include "SkStream.h" |
| 18 #include "SkTypes.h" | 18 #include "SkTypes.h" |
| 19 #include "SkYUVSizeInfo.h" | 19 #include "SkYUVSizeInfo.h" |
| 20 | 20 |
| 21 class SkColorSpace; | 21 class SkColorSpace; |
| 22 class SkData; | 22 class SkData; |
| 23 class SkPngChunkReader; | 23 class SkPngChunkReader; |
| 24 class SkSampler; | 24 class SkSampler; |
| 25 | 25 |
| 26 namespace DM { | |
| 27 class ColorCodecSrc; | |
| 28 } | |
| 29 | |
| 26 /** | 30 /** |
| 27 * Abstraction layer directly on top of an image codec. | 31 * Abstraction layer directly on top of an image codec. |
| 28 */ | 32 */ |
| 29 class SkCodec : SkNoncopyable { | 33 class SkCodec : SkNoncopyable { |
| 30 public: | 34 public: |
| 31 /** | 35 /** |
| 32 * Minimum number of bytes that must be buffered in SkStream input. | 36 * Minimum number of bytes that must be buffered in SkStream input. |
| 33 * | 37 * |
| 34 * An SkStream passed to NewFromStream must be able to use this many | 38 * An SkStream passed to NewFromStream must be able to use this many |
| 35 * bytes to determine the image type. Then the same SkStream must be | 39 * bytes to determine the image type. Then the same SkStream must be |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 639 /** | 643 /** |
| 640 * Returns the number of scanlines that have been decoded so far. | 644 * Returns the number of scanlines that have been decoded so far. |
| 641 * This is unaffected by the SkScanlineOrder. | 645 * This is unaffected by the SkScanlineOrder. |
| 642 * | 646 * |
| 643 * Returns -1 if we have not started a scanline decode. | 647 * Returns -1 if we have not started a scanline decode. |
| 644 */ | 648 */ |
| 645 int currScanline() const { return fCurrScanline; } | 649 int currScanline() const { return fCurrScanline; } |
| 646 | 650 |
| 647 virtual int onOutputScanline(int inputScanline) const; | 651 virtual int onOutputScanline(int inputScanline) const; |
| 648 | 652 |
| 653 /** | |
| 654 * Used for testing with qcms. | |
|
scroggo
2016/05/31 21:13:34
I think you said this was temporary? Should there
msarett
2016/05/31 22:02:19
Yes I think so.
| |
| 655 */ | |
| 656 virtual sk_sp<SkData> getICCData() const { return nullptr; } | |
| 649 private: | 657 private: |
| 650 const SkEncodedInfo fEncodedInfo; | 658 const SkEncodedInfo fEncodedInfo; |
| 651 const SkImageInfo fSrcInfo; | 659 const SkImageInfo fSrcInfo; |
| 652 SkAutoTDelete<SkStream> fStream; | 660 SkAutoTDelete<SkStream> fStream; |
| 653 bool fNeedsRewind; | 661 bool fNeedsRewind; |
| 654 sk_sp<SkColorSpace> fColorSpace; | 662 sk_sp<SkColorSpace> fColorSpace; |
| 655 const Origin fOrigin; | 663 const Origin fOrigin; |
| 656 | 664 |
| 657 // These fields are only meaningful during scanline decodes. | 665 // These fields are only meaningful during scanline decodes. |
| 658 SkImageInfo fDstInfo; | 666 SkImageInfo fDstInfo; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 /** | 710 /** |
| 703 * Return an object which will allow forcing scanline decodes to sample in X. | 711 * Return an object which will allow forcing scanline decodes to sample in X. |
| 704 * | 712 * |
| 705 * May create a sampler, if one is not currently being used. Otherwise, doe s | 713 * May create a sampler, if one is not currently being used. Otherwise, doe s |
| 706 * not affect ownership. | 714 * not affect ownership. |
| 707 * | 715 * |
| 708 * Only valid during scanline decoding. | 716 * Only valid during scanline decoding. |
| 709 */ | 717 */ |
| 710 virtual SkSampler* getSampler(bool /*createIfNecessary*/) { return nullptr; } | 718 virtual SkSampler* getSampler(bool /*createIfNecessary*/) { return nullptr; } |
| 711 | 719 |
| 720 friend class DM::ColorCodecSrc; // For testing with qcms | |
| 712 friend class SkSampledCodec; | 721 friend class SkSampledCodec; |
| 713 friend class SkIcoCodec; | 722 friend class SkIcoCodec; |
| 714 }; | 723 }; |
| 715 #endif // SkCodec_DEFINED | 724 #endif // SkCodec_DEFINED |
| OLD | NEW |