Latest 0.3.1
Homepage https://github.com/oleh-zayats/Legofy
License MIT
Platforms ios 10.0
Frameworks Foundation, UIKit
Authors

License
Platform
Language
Dependencies

alt text

Installation:

  1. Install using CocoaPods:
    Add the following line to the project’s Podfile:
    pod 'Legofy'
    run pod install

  2. Manually:
    Drag Classes folder to your project directory and add brick images from Resources into Assets folder of the project.

How To Use:

Import module:

import Legofy

Initialize service with:

init(sourceImage: UIImage, outputSize: CGSize? = nil, brickSize: CGFloat = 20.0, brickType: BrickType = .clean, blendMode: BlendMode = .multiply)

Setup delegate:

legofyService?.delegate = self

Use isPercentProgressEnabled to get progress in percents instaed of default Float value

legofyService?.isPercentProgressEnabled = true

Brick types available:

enum BrickType {
    case clean, legoV1, legoV2, legoV3, custom(UIImage)
}

Blend modes available:

enum BlendMode {
    case multiply, hardLight, colorBurn, difference
}

Call ‘generateImage’ to generate image:

legofyService?.generateImage()

Or ‘generateBrickTileImages’ to generate brick tiles and positions (columns/rows):

legofyService?.generateBrickTileImages() 
Check out the project in ‘Demo’ folder.
Don’t forget to run pod install in Demo directory ^^
alt text

construction: Work in progress…

TODO:

  1. Make a nice project structure. :heavy_check_mark:
  2. Add Example Folder with CocoaPod usage. :heavy_check_mark:
  3. Write some simple Unit Tests.
  4. Describe component in Readme. :heavy_check_mark:
  5. Add more brick assets to choose from, or maybe pdf/svg for scalability. :heavy_check_mark:
  6. Add output image adjustment possibilities (enchance image, change blend mode?). :heavy_check_mark:

Latest podspec

{
    "name": "Legofy",
    "version": "0.3.1",
    "summary": "Turn any image into lego block grid.",
    "description": ""Feed an image to LegofyService and it will be transformed into a lego block grid."",
    "homepage": "https://github.com/oleh-zayats/Legofy",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Oleh Zayats": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/oleh-zayats/Legofy.git",
        "tag": "0.3.1"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "resources": "Resources/*.png",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This