Skip to content

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Bunney committed Jan 4, 2016
2 parents f9d1cb2 + 4ed2ffa commit 7d2b581
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 108 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: objective-c
osx_image: xcode7
osx_image: xcode7.2
before_install:
- gem install xcpretty
script:
- set -o pipefail

- xcodebuild -project Toucan.xcodeproj -scheme "ToucanTests" test -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
- xcodebuild -project Toucan.xcodeproj -scheme "Toucan" test -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 6s" ONLY_ACTIVE_ARCH=NO | xcpretty -c
- xcodebuild -project Toucan.xcodeproj -scheme "Toucan.tvOS" build -destination "platform=tvOS Simulator,name=Apple TV 1080p" ONLY_ACTIVE_ARCH=NO | xcpretty -c
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 Gavin Bunney, Bunney Apps (http://bunney.net.au)
Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![Toucan: Fabulous Image Processing in Swift](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/toucan.png)

[![Build Status](https://travis-ci.org/gavinbunney/Toucan.svg)](https://travis-ci.org/gavinbunney/Toucan)
[![Cocoapods](https://img.shields.io/cocoapods/v/Toucan.svg?style=flat)](https://cocoapods.org/pods/Toucan)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

Toucan is a Swift library that provides a clean, quick API for processing images. It greatly simplifies the production of images, supporting resizing, cropping and stylizing your images.
Expand All @@ -23,16 +24,15 @@ Toucan is a Swift library that provides a clean, quick API for processing images

## Requirements ##

- Xcode 7
- Xcode 7.2
- iOS 8.0+

*As of version 0.4, Toucan only supports Swift 2. Use version 0.3.x for the latest Swift 1.2 compatible release*

## Setup ##

* Include the `Toucan` framework by dragging it into your project and import the library in your code using `import Toucan`

Currently there are issues loading the library using `pod 'Toucan'` which is pending changes from Cocoapods.
* Install using Cocoapods: [https://cocoapods.org/pods/Toucan](https://cocoapods.org/pods/Toucan)
* or manually include the `Toucan` framework by dragging it into your project and import the library in your code using `import Toucan`

## Toucan Usage ##

Expand All @@ -51,14 +51,14 @@ let resizedImage = Toucan.Resize.resizeImage(myImage, size: CGSize(width: 100, h
let resizedAndMaskedImage = Toucan.maskWithEllipse(resizedImage)
```

Typically, the instance version is a bit cleaner to use, and the one you want.

## Resizing ##

Resize the contained image to the specified size. Depending on what `fitMode` is supplied, the image may be clipped, cropped or scaled.

```swift
Toucan(image: myImage).resize(size: CGSize, fitMode: Toucan.Resize.FitMode)
or
Toucan.Resize.resizeImage(image: UIImage, size: CGSize, fitMode: FitMode = .Clip) -> UIImage
```

### Fit Mode ###
Expand All @@ -80,28 +80,28 @@ Alter the original image with a mask; supports ellipse, rounded rect and image m

Example | Function
---- | ---------
![Ellipse Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Ellipse-Circle.jpg)|Mask the given image with an ellipse. Allows specifying an additional border to draw on the clipped image. For a circle, ensure the image width and height are equal!<br/><br/>`Toucan(image: myImage).maskWithEllipse().image`<br/>or<br/>`Toucan.Mask.maskImageWithEllipse(myImage) -> UIImage`
![Ellipse Mask w. Border](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Ellipse-Border.jpg)|When specifying a border width, it is draw on the clipped image.<br/><br/>`Toucan(image: myImage).maskWithEllipse(borderWidth: 10, borderColor: UIColor.yellowColor()).image`<br/>or<br/>`Toucan.Mask.maskImageWithEllipse(myImage, borderWidth: 10, borderColor: UIColor.yellowColor()) -> UIImage`
![Ellipse Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Ellipse-Circle.jpg)|Mask the given image with an ellipse. Allows specifying an additional border to draw on the clipped image. For a circle, ensure the image width and height are equal!<br/><br/>`Toucan(image: myImage).maskWithEllipse().image`
![Ellipse Mask w. Border](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Ellipse-Border.jpg)|When specifying a border width, it is draw on the clipped image.<br/><br/>`Toucan(image: myImage).maskWithEllipse(borderWidth: 10, borderColor: UIColor.yellowColor()).image`

### Path Mask ###

Example | Function
---- | ---------
![Path Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Path.jpg)|Mask the given image with a path. The path will be scaled to fit the image correctly!<br/><br/>`path.moveToPoint(CGPointMake(0, 50))`<br/>`path.addLineToPoint(CGPointMake(50, 0))`<br/>`path.addLineToPoint(CGPointMake(100, 50))`<br/>`path.addLineToPoint(CGPointMake(50, 100))`<br/>`path.closePath()`<br/>`Toucan(image: myImage).maskWithPath(path: path).image`<br/>or<br/>`Toucan.Mask.maskImageWithPath(myImage, path: path) -> UIImage`
![Path Mask w. Closure](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Path.jpg)|Mask the given image with a path provided via a closure. This allows you to construct your path relative to the bounds of the image!<br/><br/>`Toucan(image: myImage).maskWithPathClosure(path: (rect: CGRect) -> (UIBezierPath)).image`<br/>or<br/>`Toucan.Mask.maskImageWithPathClosure(myImage, path: (rect: CGRect) -> (UIBezierPath)) -> UIImage`
![Path Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Path.jpg)|Mask the given image with a path. The path will be scaled to fit the image correctly!<br/><br/>`path.moveToPoint(CGPointMake(0, 50))`<br/>`path.addLineToPoint(CGPointMake(50, 0))`<br/>`path.addLineToPoint(CGPointMake(100, 50))`<br/>`path.addLineToPoint(CGPointMake(50, 100))`<br/>`path.closePath()`<br/>`Toucan(image: myImage).maskWithPath(path: path).image`
![Path Mask w. Closure](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Path.jpg)|Mask the given image with a path provided via a closure. This allows you to construct your path relative to the bounds of the image!<br/><br/>`Toucan(image: myImage).maskWithPathClosure(path: (rect: CGRect) -> (UIBezierPath)).image`

### Rounded Rect Mask ###

Example | Function
---- | ---------
![Rounded Rect Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-RoundedRect.jpg)|Mask the given image with a rounded rectangle border. Allows specifying an additional border to draw on the clipped image.<br/><br/>`Toucan(image: myImage).maskWithRoundedRect(cornerRadius: 30).image`<br/>or<br/>`Toucan.Mask.maskImageWithRoundedRect(myImage, cornerRadius: 30) -> UIImage`
![Rounded Rect Mask w. Border](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-RoundedRect-Border.jpg)|When specifying a border width, it is draw on the clipped rounded rect.<br/><br/>`Toucan(image: myImage).maskWithRoundedRect(cornerRadius: 30, borderWidth: 10, borderColor: UIColor.purpleColor()).image`<br/>or<br/>`Toucan.Mask.maskImageWithRoundedRect(myImage, cornerRadius: 30, borderWidth: 10, borderColor: UIColor.purpleColor()) -> UIImage`
![Rounded Rect Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-RoundedRect.jpg)|Mask the given image with a rounded rectangle border. Allows specifying an additional border to draw on the clipped image.<br/><br/>`Toucan(image: myImage).maskWithRoundedRect(cornerRadius: 30).image`
![Rounded Rect Mask w. Border](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-RoundedRect-Border.jpg)|When specifying a border width, it is draw on the clipped rounded rect.<br/><br/>`Toucan(image: myImage).maskWithRoundedRect(cornerRadius: 30, borderWidth: 10, borderColor: UIColor.purpleColor()).image`

### Image Mask ###

Example | Function
---- | ---------
![Image Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Custom.jpg)|Mask the given image with another image mask. Note that the areas in the original image that correspond to the black areas of the mask show through in the resulting image. The areas that correspond to the white areas of the mask aren’t painted. The areas that correspond to the gray areas in the mask are painted using an intermediate alpha value that’s equal to 1 minus the image mask sample value.<br/><br/>`Toucan(image: myImage).maskWithImage(maskImage: octagonMask).image`<br/>or<br/>`Toucan.Mask.maskImageWithImage(myImage, maskImage: octagonMask) -> UIImage`
![Image Mask](https://raw.githubusercontent.com/gavinbunney/Toucan/master/assets/examples/Mask-Custom.jpg)|Mask the given image with another image mask. Note that the areas in the original image that correspond to the black areas of the mask show through in the resulting image. The areas that correspond to the white areas of the mask aren’t painted. The areas that correspond to the gray areas in the mask are painted using an intermediate alpha value that’s equal to 1 minus the image mask sample value.<br/><br/>`Toucan(image: myImage).maskWithImage(maskImage: octagonMask).image`

---

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Source/Toucan.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Toucan.h
//
// Copyright (c) 2014 Gavin Bunney, Bunney Apps (http://bunney.net.au)
// Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Source/Toucan.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Toucan.swift
//
// Copyright (c) 2014 Gavin Bunney, Bunney Apps (http://bunney.net.au)
// Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions Source/tvOS/ToucanTVOS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ToucanTVOS.h
//
// Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <UIKit/UIKit.h>

//! Project version number for ToucanTVOS.
FOUNDATION_EXPORT double ToucanTVOSVersionNumber;

//! Project version string for ToucanTVOS.
FOUNDATION_EXPORT const unsigned char ToucanTVOSVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <ToucanTVOS/PublicHeader.h>


2 changes: 1 addition & 1 deletion Tests/MaskingTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014 Gavin Bunney, Bunney Apps (http://bunney.net.au)
// Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Tests/ResizeTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014 Gavin Bunney, Bunney Apps (http://bunney.net.au)
// Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Tests/ToucanTestCase.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014 Gavin Bunney, Bunney Apps (http://bunney.net.au)
// Copyright (c) 2014-2016 Gavin Bunney, Simple Labs (http://thesimplelab.co)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Toucan.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Toucan'
s.version = '0.4.3'
s.version = '0.5.0'
s.license = 'MIT'
s.summary = 'Fabulous Image Processing in Swift'
s.homepage = 'https://github.com/gavinbunney/Toucan'
Expand Down
Loading

0 comments on commit 7d2b581

Please sign in to comment.