scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 8 | #ifndef SkCodecAnimation_DEFINED |
| 9 | #define SkCodecAnimation_DEFINED |
| 10 | |
| 11 | #include "SkCodec.h" |
| 12 | #include "SkRect.h" |
| 13 | |
| 14 | class SkCodecAnimation { |
| 15 | public: |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 16 | /** |
| 17 | * This specifies how the next frame is based on this frame. |
| 18 | * |
| 19 | * Names are based on the GIF 89a spec. |
| 20 | * |
| 21 | * The numbers correspond to values in a GIF. |
| 22 | */ |
| 23 | enum DisposalMethod { |
| 24 | /** |
| 25 | * The next frame should be drawn on top of this one. |
| 26 | * |
| 27 | * In a GIF, a value of 0 (not specified) is also treated as Keep. |
| 28 | */ |
| 29 | Keep_DisposalMethod = 1, |
| 30 | |
| 31 | /** |
| 32 | * Similar to Keep, except the area inside this frame's rectangle |
| 33 | * should be cleared to the BackGround color (transparent) before |
| 34 | * drawing the next frame. |
| 35 | */ |
| 36 | RestoreBGColor_DisposalMethod = 2, |
| 37 | |
| 38 | /** |
| 39 | * The next frame should be drawn on top of the previous frame - i.e. |
| 40 | * disregarding this one. |
| 41 | * |
| 42 | * In a GIF, a value of 4 is also treated as RestorePrevious. |
| 43 | */ |
| 44 | RestorePrevious_DisposalMethod = 3, |
| 45 | }; |
| 46 | |
| 47 | private: |
| 48 | SkCodecAnimation(); |
| 49 | }; |
| 50 | #endif // SkCodecAnimation_DEFINED |