| 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 |
|
| 8 |
#ifndef SkCodecAnimation_DEFINED |
| 9 |
#define SkCodecAnimation_DEFINED |
| 10 |
|
| 11 |
namespace SkCodecAnimation { |
| 12 |
/** |
| 13 |
* This specifies how the next frame is based on this frame. |
| 14 |
* |
| 15 |
* Names are based on the GIF 89a spec. |
| 16 |
* |
| 17 |
* The numbers correspond to values in a GIF. |
| 18 |
*/ |
| 19 |
enum class DisposalMethod { |
| 20 |
/** |
| 21 |
* The next frame should be drawn on top of this one. |
| 22 |
* |
| 23 |
* In a GIF, a value of 0 (not specified) is also treated as Keep. |
| 24 |
*/ |
| 25 |
kKeep = 1, |
| 26 |
|
| 27 |
/** |
| 28 |
* Similar to Keep, except the area inside this frame's rectangle |
| 29 |
* should be cleared to the BackGround color (transparent) before |
| 30 |
* drawing the next frame. |
| 31 |
*/ |
| 32 |
kRestoreBGColor = 2, |
| 33 |
|
| 34 |
/** |
| 35 |
* The next frame should be drawn on top of the previous frame - i.e. |
| 36 |
* disregarding this one. |
| 37 |
* |
| 38 |
* In a GIF, a value of 4 is also treated as RestorePrevious. |
| 39 |
*/ |
| 40 |
kRestorePrevious = 3, |
| 41 |
}; |
| 42 |
|
| 43 |
/** |
| 44 |
* How to blend the current frame. |
| 45 |
*/ |
| 46 |
enum class Blend { |
| 47 |
/** |
| 48 |
* Blend with the prior frame as if using SkBlendMode::kSrcOver. |
| 49 |
*/ |
| 50 |
kSrcOver, |
| 51 |
|
| 52 |
/** |
| 53 |
* Blend with the prior frame as if using SkBlendMode::kSrc. |
| 54 |
* |
| 55 |
* This frame's pixels replace the destination pixels. |
| 56 |
*/ |
| 57 |
kSrc, |
| 58 |
}; |
| 59 |
|
| 60 |
} // namespace SkCodecAnimation |
| 61 |
#endif // SkCodecAnimation_DEFINED |