All Projects → LeoNatan → Lninterpolation

LeoNatan / Lninterpolation

Licence: mit
An interpolation framework for Cocoa and Cocoa Touch.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Lninterpolation

Smile
Statistical Machine Intelligence & Learning Engine
Stars: ✭ 5,412 (+18562.07%)
Mutual labels:  interpolation
Wfcolorcode
NSColor extension adding ability to handle HSL color space and CSS3 style color codes
Stars: ✭ 16 (-44.83%)
Mutual labels:  cocoa
Objc Uti
Objective-C wrapper for Uniform Type Identifiers (UTIs)
Stars: ✭ 7 (-75.86%)
Mutual labels:  cocoa
Latest
A small utility app for macOS that makes sure you know about all the latest updates to the apps you use.
Stars: ✭ 657 (+2165.52%)
Mutual labels:  cocoa
React Move
React Move | Beautiful, data-driven animations for React
Stars: ✭ 6,395 (+21951.72%)
Mutual labels:  interpolation
Jcggcolorslider
Colorful NSSlider subclass
Stars: ✭ 19 (-34.48%)
Mutual labels:  cocoa
Strongbox
A KeePass/Password Safe Client for iOS and OS X
Stars: ✭ 586 (+1920.69%)
Mutual labels:  cocoa
Wenoof
WENO interpolation Object Oriented Fortran library
Stars: ✭ 27 (-6.9%)
Mutual labels:  interpolation
Nswindowstyles
A showcase of the many different styles of windows possible with NSWindow on macOS
Stars: ✭ 801 (+2662.07%)
Mutual labels:  cocoa
Mgkmenuwithfilter
A macOS menu that supports items filtration via keyboard input
Stars: ✭ 26 (-10.34%)
Mutual labels:  cocoa
Xit
Mac OS X Git GUI
Stars: ✭ 700 (+2313.79%)
Mutual labels:  cocoa
Frenchkiss.js
The blazing fast lightweight internationalization (i18n) module for javascript
Stars: ✭ 776 (+2575.86%)
Mutual labels:  interpolation
Privilegedtaskrunner
Swift 4 example code for creating privileged helpers in macOS
Stars: ✭ 19 (-34.48%)
Mutual labels:  cocoa
Orsserialport
Serial port library for Objective-C and Swift macOS apps
Stars: ✭ 609 (+2000%)
Mutual labels:  cocoa
Tablebinding
Swift NSTableView bound to an NSArrayController
Stars: ✭ 8 (-72.41%)
Mutual labels:  cocoa
Flightanimator
Advanced Natural Motion Animations, Simple Blocks Based Syntax
Stars: ✭ 588 (+1927.59%)
Mutual labels:  interpolation
Cocoaheads Ukraine
Collection of talks given at the CocoaHeads Ukraine meetups.
Stars: ✭ 18 (-37.93%)
Mutual labels:  cocoa
Mpedn
EDN I/O library for Objective-C (MacOS and iOS)
Stars: ✭ 28 (-3.45%)
Mutual labels:  cocoa
Super Resolution cnn
Implementation of 'Image Super-Resolution using Deep Convolutional Network'
Stars: ✭ 27 (-6.9%)
Mutual labels:  interpolation
Esmpy Tutorial
Basic tutorial for ESMPy Python package
Stars: ✭ 22 (-24.14%)
Mutual labels:  interpolation

LNInterpolation

An interpolation framework for Cocoa and Cocoa Touch.

GitHub release PayPal Donation Button

GitHub stars GitHub license Carthage compatible

GitHub issues GitHub closed issues GitHub contributors

Protocol

The framework defines a protocol, LNInterpolable (Interpolable in Swift), defining a common API for interpolating between two values.

The protocol defines two methods.

Objective C

- (instancetype)interpolateToValue:(id)toValue progress:(double)progress;
- (instancetype)interpolateToValue:(id)toValue progress:(double)progress behavior:(LNInterpolationBehavior)behavior;

Swift

public func interpolate(to toValue: Any, progress: Double) -> Self
public func interpolate(to toValue: Any, progress: Double, behavior: InterpolationBehavior) -> Self

The first variant returns an interpolated value between the original and toValue according to progress, using the default behavior. The second is similar, but receives a behavior modifier. Each implementation can use this to choose how to implement the interpolation between the values. A default value of LNInterpolationBehaviorUseDefault (.useDefault in Swift) is always available.

Provided Implementations

The framework provides implementation for the most common cases where interpolation may be needed.

NSValue and NSNumber

An implementation is provided for NSValue, which provides support for the following values:

  • Numbers (NSNumber)
    • Decimal numbers (NSDecimalNumber)
  • Core Graphics: CGPoint, CGSize, CGVector, CGRect, CGAffineTransform (NSValue)
  • UIKit: UIOffset, UIEdgeInsets (NSValue)
  • AppKit: NSEdgeInsets (NSValue)

UIColor and NSColor

An implementation is provided for colors (both for iOS and macOS). By default, color interpolation is performed in Lab colorspace for best possible interpolation quality. If performance is an issue, you may use LNInterpolationBehaviorUseRGBColorSpace (.useRGBColorSpace in Swift) to specify a behavior where RGB colorspace is used.

Demo Playground

A demo playground is provided. Open LNInterpolationExample/LNInterpolationExample.xcworkspace and build the framework for macOS. Open the playground and explore the available pages.

Adding to Your Project

Carthage

Add the following to your Cartfile:

github "LeoNatan/LNInterpolation"

Manual

Drag the LNInterpolation.xcodeproj project to your project, and add LNInterpolation.framework to Embedded Binaries in your project target's General tab. Xcode should sort everything else on its own.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].