Skip to content

Commit

Permalink
🚀 Init
Browse files Browse the repository at this point in the history
* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* 🌲 Update

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* ⚡ WIP

* 🌲 Update

* Performance

* ⚡ WIP

* ⚡ WIP

* 🌲 Update

* 🌲 Update

* 🌲 Update

* 🌲 Update

* 🌲 Update

* 🌲 Update

* 🌲 Update

* Add files via upload

* Add files via upload

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Add files via upload

* Update README.md

* 🌲 Update

* 🌲 Update

* Add Filters

* Update README.md

* Add license

* Update README

* Update README.md

* Add callbacks

* oops

* Ignore

* Improve Performance

* Improve Performance

* Update README.md

* Update README.md

* ColorCubeStorage

* Add default param

* Revise Localize

* Add ControllStackView push/pop animation

* Update README.md

* Add files via upload

* Delete PixelEngine.png

* Update README.md

* Add files via upload

* Update README.md

* Delete top.jpg

* Add files via upload

* Update README.md

* Add animated option

* Update README.md

* 🌲 Update

* Revise Animation

* Update concurrentMap

* Add LayoutGuide

* Use UIGraphicsImageRenderer

* DisplayP3

* Update Animation

* Update Animation

* Update ColorCubeControl

* Add Icon

* Ignore
  • Loading branch information
muukii authored Oct 29, 2018
1 parent c027009 commit e6ba34a
Show file tree
Hide file tree
Showing 169 changed files with 10,907 additions and 16 deletions.
86 changes: 86 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

# Created by https://www.gitignore.io/api/swift

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

.DS_Store

# End of https://www.gitignore.io/api/swift
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.2
151 changes: 151 additions & 0 deletions From Fil/FilterChannels.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
//
// FilterChannels.swift
// Fil
//
// Created by Hiroshi Kimura on 12/29/15.
// Copyright © 2015 muukii. All rights reserved.
//

import LightRoom
import JAYSON

public func == (lhs: FilterChannels, rhs: FilterChannels) -> Bool {
if lhs.redChannel == rhs.redChannel &&
lhs.greenChannel == rhs.greenChannel &&
lhs.blueChannel == rhs.blueChannel {
return true
}
return false
}

public func == (lhs: FilterChannels.Channel, rhs: FilterChannels.Channel) -> Bool {
if lhs.redAmount == rhs.redAmount &&
lhs.greenAmount == rhs.greenAmount &&
lhs.blueAmount == rhs.blueAmount &&
lhs.constant == rhs.constant {
return true
}
return false
}

public struct FilterChannels: Filtering, MultipleParameters, PresetComponent, Equatable {

/**
Amount: -200% ~ 200%, actually values is -2...2
*/
public struct Channel: Equatable {
public var redAmount: Double // -1...1
public var greenAmount: Double // -1...1
public var blueAmount: Double // -1...1
public var constant: Double // -1...1

public init(_ redAmount: Double, _ greenAmount: Double, _ blueAmount: Double, _ constant: Double) {
self.redAmount = redAmount
self.greenAmount = greenAmount
self.blueAmount = blueAmount
self.constant = constant
}

var vector: Vector4 {
return [
CGFloat(4 * self.redAmount),
CGFloat(4 * self.greenAmount),
CGFloat(4 * self.blueAmount),
CGFloat(4 * self.constant),
]
}

var stringRepresentation: String {

return "[\(4 * self.redAmount), \(4 * self.greenAmount), \(4 * self.blueAmount), \(4 * self.constant)]"
}
}

public var redChannel: Channel
public var greenChannel: Channel
public var blueChannel: Channel

public let filterChain: FilterChain = {

return LightRoom.ColorFilter.ColorMatrix(
rVector: self.redChannel.vector,
gVector: self.greenChannel.vector,
bVector: self.blueChannel.vector,
aVector: [0,0,0,1],
biasVector: [0,0,0,0])
}

public init(
redChannel: Channel = Channel(0.25, 0, 0, 0),
greenChannel: Channel = Channel(0, 0.25, 0, 0),
blueChannel: Channel = Channel(0, 0, 0.25, 0)) {

self.redChannel = redChannel
self.greenChannel = greenChannel
self.blueChannel = blueChannel
}

public init?(json: JSON) {

guard
let redChannelRedAmount = json[Keys.RedChannelRedAmount].number,
let redChannelGreenAmount = json[Keys.RedChannelGreenAmount].number,
let redChannelBlueAmount = json[Keys.RedChannelBlueAmount].number,
let redChannelConstant = json[Keys.RedChannelConstant].number,
let greenChannelRedAmount = json[Keys.GreenChannelRedAmount].number,
let greenChannelGreenAmount = json[Keys.GreenChannelGreenAmount].number,
let greenChannelBlueAmount = json[Keys.GreenChannelBlueAmount].number,
let greenChannelConstant = json[Keys.GreenChannelConstant].number,
let blueChannelRedAmount = json[Keys.BlueChannelRedAmount].number,
let blueChannelGreenAmount = json[Keys.BlueChannelGreenAmount].number,
let blueChannelBlueAmount = json[Keys.BlueChannelBlueAmount].number,
let blueChannelConstant = json[Keys.BlueChannelConstant].number
else {
return nil
}

self.redChannel = Channel(redChannelRedAmount.doubleValue, redChannelGreenAmount.doubleValue, redChannelBlueAmount.doubleValue, redChannelConstant.doubleValue)
self.greenChannel = Channel(greenChannelRedAmount.doubleValue, greenChannelGreenAmount.doubleValue, greenChannelBlueAmount.doubleValue, greenChannelConstant.doubleValue)
self.blueChannel = Channel(blueChannelRedAmount.doubleValue, blueChannelGreenAmount.doubleValue, blueChannelBlueAmount.doubleValue, blueChannelConstant.doubleValue)
}

public func toJSON() -> JSON {

var dictionary: [String: AnyObject] = [:]

dictionary[Keys.RedChannelRedAmount] = NSNumber(double: self.redChannel.redAmount)
dictionary[Keys.RedChannelGreenAmount] = NSNumber(double: self.redChannel.greenAmount)
dictionary[Keys.RedChannelBlueAmount] = NSNumber(double: self.redChannel.blueAmount)
dictionary[Keys.RedChannelConstant] = NSNumber(double: self.redChannel.constant)

dictionary[Keys.GreenChannelRedAmount] = NSNumber(double: self.greenChannel.redAmount)
dictionary[Keys.GreenChannelGreenAmount] = NSNumber(double: self.greenChannel.greenAmount)
dictionary[Keys.GreenChannelBlueAmount] = NSNumber(double: self.greenChannel.blueAmount)
dictionary[Keys.GreenChannelConstant] = NSNumber(double: self.greenChannel.constant)

dictionary[Keys.BlueChannelRedAmount] = NSNumber(double: self.blueChannel.redAmount)
dictionary[Keys.BlueChannelGreenAmount] = NSNumber(double: self.blueChannel.greenAmount)
dictionary[Keys.BlueChannelBlueAmount] = NSNumber(double: self.blueChannel.blueAmount)
dictionary[Keys.BlueChannelConstant] = NSNumber(double: self.blueChannel.constant)

return JSON(dictionary)
}

private enum Keys {
static let RedChannelRedAmount = "redChannelRedAmount"
static let RedChannelGreenAmount = "redChannelGreenAmount"
static let RedChannelBlueAmount = "redChannelBlueAmount"
static let RedChannelConstant = "redChannelConstant"

static let GreenChannelRedAmount = "greenChannelRedAmount"
static let GreenChannelGreenAmount = "greenChannelGreenAmount"
static let GreenChannelBlueAmount = "greenChannelBlueAmount"
static let GreenChannelConstant = "greenChannelConstant"

static let BlueChannelRedAmount = "blueChannelRedAmount"
static let BlueChannelGreenAmount = "blueChannelGreenAmount"
static let BlueChannelBlueAmount = "blueChannelBlueAmount"
static let BlueChannelConstant = "blueChannelConstant"
}
}

41 changes: 41 additions & 0 deletions From Fil/FilterCrystallize.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// FilterCrystalize.swift
// Fil
//
// Created by muukii on 4/16/16.
// Copyright © 2016 muukii. All rights reserved.
//

import LightRoom

public struct FilterCrystallize: Filtering {

public static let maximumValue: Double = 60
public static let minimumValue: Double = 10
public static let neutralValue: Double = 10

public let value: Double

public let filterChain: FilterChain

public init(value: Double) {

self.value = value
self.filterChain = {

let clamp = LightRoom.TileEffect.AffineClamp(transform: CGAffineTransform(scaleX: 1,y: 1))

return FilterChain { (image) -> CIImage? in

guard let image = image else {
return nil
}
let radius = RadiusCalculator.radius(image.extent) * value / FilterCrystallize.maximumValue
let filter = LightRoom.Stylize.Crystallize(radius: radius)

image >>> clamp >>> filter
return filter.outputImage?.cropping(to: image.extent)
}
}()
}
}
30 changes: 30 additions & 0 deletions From Fil/FilterGrain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// FilterGrain.swift
// Fil
//
// Created by Hiroshi Kimura on 12/20/15.
// Copyright © 2015 muukii. All rights reserved.
//

import LightRoom
import LightRoomExtension

public struct FilterGrain: Filtering {

public static let maximumValue: Double = 0.7
public static let minimumValue: Double = 0
public static let neutralValue: Double = 0

public let value: Double

public let filterChain: FilterChain

public init(value: Double) {

self.value = value
self.filterChain = {

return LightRoom.ExternalFilter.Grain(intencity: value)
}()
}
}
Loading

0 comments on commit e6ba34a

Please sign in to comment.