Code Monkey home page Code Monkey logo

photobooth's Introduction

PhotoBooth

MacOS App Coding Exercise

Install

Download the project or run:

$ git clone https://github.com/ManuelBulos/PhotoBooth.git

Run

Open photobooth.xcodeproj and hit run

After capturing a snapshot you'll be presented with the editing window:

Editing

When you are finished editing you can choose to save your work as .png or a .photobooth file. If you choose .photobooth you can open up that file again and keep editing (undoing previous lines and drawing new ones)

Saving

Technologies used

Frameworks

AVFoundation used for previewing computer's camera.

CoreGraphics used to handle path-based drawing

Third Parties

AEXML lightweight XML parsing. helps photobooth read polylines from svg files previously created using CGPoint arrays

PhotoBooth Document (.photobooth package)

The .photobooth extension is a UTI

Mac apps can add new uniform type identifiers for proprietary data formats. You declare new UTIs in the information property list (info.plist) file of a bundle.

This means that .photobooth is a directory (package) that contains 2 files:

  • the image in a .png format
  • the .svg file created from the CGPoints drawn inside the CGContext

This way we can open the png image, then parse the svg into an array of CGPoints and draw them again on top of that image.

I chose svg format because it's very easy to generate an XML file (SVG) from a given collection of CGPoints, we just need to map the x and y of each point to a polyline element on the XML File.

Unit Testing

To run the unit tests just Open photobooth.xcodeproj and select the class photoboothTests in the photoboothTests.swift file

IMPORTANT NOTE: the test named "testSavingAndReadingFiles" prompts you with a window, so make sure to select a directory from there.

Docs Reference

You can find more info about the project in the documentation

photobooth's People

Contributors

manuelwhisper avatar manuelbulos avatar

Watchers

James Cloos avatar  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.