Releases: andyf-canva/thorvg-swift
thorvg-swift 0.5.0
This is a minor release, focusing on the new PixelFormat API we have created.
What's Changed
- Introduce
PixelFormatAPI by @andyf-canva in #15
Full Changelog: 0.4.2...0.5.0
thorvg-swift 0.4.2
This release is simply updating our upstream reference of ThorVG from version v0.12.1 to v0.13.2.
We have seen some memory leak issues, where ThorVG is inaccurately deleting Picture pointers associated to Animation objects. Following this issue, this now seems to be resolved as of version v0.13.0.
thorvg-swift 0.4.1
This is a patch release, fixing the scaling behaviour we have when using a contentRect. It also simplifies the way in which we apply transforms to a Picture.
What's Changed
- Fix stretch to fit scaling behaviour by @andyf-canva in #13
Full Changelog: 0.4.0...0.4.1
thorvg-swift 0.4.0
What's Changed
- Refactoring Swift Wrapper: Introduce internal Swift types by @andyf-canva in #9
- Refactoring Swift Wrapper: Refactor Lottie type by @andyf-canva in #10
- Refactoring Swift Wrapper: Introduce LottieRenderer by @andyf-canva in #11
- Remove duplicate typealias by @andyf-canva in #12
Full Changelog: 0.3.1...0.4.0
thorvg-swift 0.3.1
This is a patch release, to sync the thorvg-swift fork with the upstream thorvg repo.
Important note: We have decided to rebase main onto the more stable v0.12.4 release. This will provide more faith in the stability of the APIs we are using, as opposed to branching off the upstream main.
Going forward, we intend to revise our approach on versioning as well to avoid confusion with Swift Package versions versus upstream ThorVG versions.
thorvg-swift 0.3.0
This is a minor release, focused on updating the cropping behaviour of the renderFrame function, and adding support for snapshot tests.
Changes
Cropping ✂️
Previously, the Lottie.renderFrame cropping functionality allowed you to specify a rectangle to define the visible area of a Lottie frame. However, it lacked the capability to scale the cropped area, meaning the output size was directly dependent on the crop dimensions, potentially leading to a mismatch with the desired frame size.
With this change, the cropping functionality has been improved to not only define the visible area but also to ensure that the cropped portion is properly scaled and positioned to match the specified frame size (size parameter).
| Before | After |
|---|---|
Testing 🧪
This release also introduces snapshot testing to the repo, using pointfreeco's swift-snapshot-testing library.
This gives us coverage over the output of the renderFrame function, and addresses our core use cases: scaling and cropping.
thorvg-swft 0.2.1
This is a very small release to remove the C++ interoperability Swift settings defined in Package.swift.
We are now using ThorVG's C API bindings to provide Swift interoperability.
thorvg-swift 0.2.0
This is the second release of this forked repo, aiming to provide a Swift API.
The core changes of this release focuses on Lottie rendering.
Changes
Lottie rendering
This release introduces the Swift Lottie type.
The Lottie type is responsible for initialising Lottie data, and providing the ability to render Lottie frames into a provided buffer.
Internally, Lottie uses the Animation, Picture and Canvas objects provided by ThorVG to achieve this.
Public API
/// Shorthand for the buffer type used to represent image pixel data.
public typealias Buffer = UnsafeMutablePointer<UInt32>
/// Object used to load and render Lottie frames.
public class Lottie {
/// The number of frames in the Lottie animation.
public let numberOfFrames: Int
/// The duration of the Lottie animation.
public let duration: CMTime
/// The original size of the Lottie animation.
public let size: CGSize
/// Initializes a new Lottie instance from a file path.
/// - Parameters:
/// - path: The file path of the Lottie animation.
public convenience init(path: String) throws
/// Initializes a new Lottie instance from a string representing the animation.
/// - Parameters:
/// - string: The string representing the Lottie animation.
public convenience init(string: String) throws
/// Renders a Lottie frame into a buffer.
/// - Parameters:
/// - index: The index of the frame to render.
/// - buffer: The buffer to render the frame into.
/// - stride: The stride of the buffer.
/// - size: The desired size of the rendered frame.
/// - crop: Optional rectangle to crop the rendered frame.
public func renderFrame(at index: Int, into buffer: thorvg_swift.Buffer, stride: Int, size: CGSize, crop: CGRect? = nil) throws
}Going forward
This is our first release of the Lottie API, and is yet to be throughly tested in production.
Subsequent bug fixes will ensue, aiming to add additional test coverage as well.
thorvg-swift 0.1.0
This is the initial release of this repo, which forks the ThorVG repo.
The core changes of this release focus on adding Swift Package Manager support.
Going forward, subsequent releases will focus on writing a Swift wrapper on top of ThorVG's C++ API to expose the Lottie rendering functionality.