Coder Social home page Coder Social logo

koolistov-forks / swiftgraphics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bengottlieb/swiftgraphics

0.0 1.0 0.0 2.14 MB

Bringing Swift goodness to Quartz.

License: BSD 2-Clause "Simplified" License

Swift 89.96% Objective-C 9.28% C++ 0.48% Objective-C++ 0.26% Shell 0.01%

swiftgraphics's Introduction

SwiftGraphics

IMPORTANT

All development happens on the develop branch. Code is merged back on master branch infrequently.

Also note this project is moving to Swift 1.2, which requires Xcode 6.3 and Mac OS X 10.10. Note that this changes breaks Travis CI.

Bringing Swift goodness to Quartz.

Travis

See "Help Wanted" section of this document for how you can contribute to SwiftGraphics.

Philosophy

Wrap Quartz (and other related Frameworks such as CoreImage) in a nice "Swifthonic" API.

Provide wrappers and operators to help make working with graphics primitives in swift as convenient as possible.

What's included

  • Pragmatic operator overloading for CoreGraphics types including: CGPoint, CGSize, CGRect, CGAffineTransform
  • Object Oriented extensions for CGContext (including easy creation of bitmap context), CGPath
  • A bezier curve object that can represent curves of any order (including quadratic and cubic of course)
  • A path object that represents a bezier path - can be used to create and manipulate paths in a more natural way than CGPath or NSBezierPath can do
  • Fleshed out Geometry objects (Triangle, Ellipse, etc) allowing creating and introspection.
  • Convex Hull Generation
  • QuadTree data structure
  • Metaballs (Marching Squares algorithm) implementation

Convex Hull Screenshot Metaballs Screenshot QuadTree Screenshot Ellipse Screenshot

In Progress

All of this code is very much a work in progress. I'm adding and changing functionality as needed. As such I'm trying not to add code that isn't used (with some exceptions).

Project Structure

SwiftGraphics is made up of:

  • Two SwiftGraphics dynamic frameworks (one for iOS and one for Mac OS X),
  • A Mac OS X only SwiftGraphicsPlayground framework (containing code generally useful when using Playground)
  • A directory of Playground files
  • A Mac OS X testbed app “SwiftGraphics_OSX_UITest” that highlights some of the more interactive code
  • Unit Test Targets

Usage

SwiftGraphics builds iOS and OS X frameworks. Just add SwiftGraphics.xcodeproj to your project and set up your dependencies appropriately.

You can play with SwiftGraphics in Xcode 6 Playgrounds. IMPORTANT just make sure you compile the SwiftGraphicsPlayground target before trying to run any Playgrounds.

Help Wanted

Your help wanted. I would definitely appreciate contributions from other members of the Swift/Cocoa community. Please fork this project and submit pull requests.

You can help by using Swift Graphics in your projects and discovering its shortcomings. I encourage you to file issues against this project.

Contributions are always welcome in the following areas:

  • Header doc comments explaining what the functions do
  • Unit tests
  • Playgrounds showing graphically what SwiftGraphics can do
  • New graphical algorithms (take your pick from wikipedia)
  • New geometry structs

Code Life Cycle

All development occurs on the develop branch. New code starts either as a Playground or as a tab inside the houseSwiftGraphics_OSX_UITest application target.

As code proves itself to be useful it is added to the SwiftGraphicsPlayground target and shared with all Playgrounds.

If code is generally useful it is moved directly to the SwiftGraphics target.

License

See LICENSE for more information

swiftgraphics's People

Contributors

schwa avatar rhcad avatar delebedev avatar saniul avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.