-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle images layout, refactor view model to make it less complex.
- Loading branch information
Cesar Vargas Casaseca
committed
May 3, 2020
1 parent
11bbd9c
commit 01cb8c8
Showing
21 changed files
with
283 additions
and
65 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Warhol/SampleApp/Assets.xcassets/leftEye.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Untitled.png", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
Warhol/SampleApp/Assets.xcassets/nose.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "pngwave (3).png", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
Warhol/SampleApp/Assets.xcassets/rightEye.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "rightEye.png", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+17.8 KB
(120%)
...roj/project.xcworkspace/xcuserdata/cesarvargas.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// CGRect+SizeFactor.swift | ||
// Warhol | ||
// | ||
// Created by Cesar Vargas on 02.05.20. | ||
// Copyright © 2020 Cesar Vargas. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import CoreGraphics | ||
|
||
extension CGRect { | ||
func increaseRect(byPercentageWidth percentageWidth: CGFloat, | ||
byPercentageHeight percentageHeight: CGFloat) -> CGRect { | ||
let startWidth = width | ||
let startHeight = height | ||
let adjustmentWidth = (startWidth * percentageWidth) / 2.0 | ||
let adjustmentHeight = (startHeight * percentageHeight) / 2.0 | ||
return insetBy(dx: -adjustmentWidth, dy: -adjustmentHeight) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// FaceLandmarkPerimeter+Rect.swift | ||
// Warhol | ||
// | ||
// Created by Cesar Vargas on 03.05.20. | ||
// Copyright © 2020 Cesar Vargas. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import CoreGraphics | ||
|
||
extension FaceLandmarkPerimeter { | ||
func rect() -> CGRect { | ||
let leftMost: CGFloat = self.reduce(CGFloat.greatestFiniteMagnitude) { Swift.min($0, $1.x) } | ||
let upMost = reduce(CGFloat.greatestFiniteMagnitude) { Swift.min($0, $1.y) } | ||
let rightMost = reduce(0) { Swift.max($0, $1.x) } | ||
let downMost = reduce(0) { Swift.max($0, $1.y) } | ||
|
||
let originalWidth = rightMost - leftMost | ||
let originalHeight = downMost - upMost | ||
|
||
return CGRect(x: leftMost, y: upMost, width: originalWidth, height: originalHeight) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.