Giter VIP home page Giter VIP logo

Comments (5)

hfossli avatar hfossli commented on June 2, 2024

@snown What do you think? Is this something you would like to have a look at?

from aggeometrykit.

snown avatar snown commented on June 2, 2024

Sorry for the delay, yeah I'll take a crack at this. I'm up against a deadline right now, but I may have a couple extra cycles soon. Feel free to assign.

Thanks.

from aggeometrykit.

hfossli avatar hfossli commented on June 2, 2024

Cool :) It will definitely be boosting the quality of the output which again will be a huge improvement of this crop-to-quad-feature!

Should we use the accelerate-framework? :)

from aggeometrykit.

hfossli avatar hfossli commented on June 2, 2024

Hey @snown, I've been thinking. iOS 7 has been around for quite some time now. Before iOS 7 we couldn't render layers/uiview with 3d transforms to images. With iOS 7 that became possible. Our resampling is inferior to UIKit's version. It is now possible to do something like this

// 1. Create a imageview
UIImageView *imageView = [UIImageView new];

// 2. Apply a transform
imageView.transform = ...;

// 3. Apply image
imageView.image = image;

// 4. Position it
imageView.layer.position = ...;

// 3. Add it to a container
UIImageView *container = [UIImageView new];
[container addSubview:imageView];

// 6. Render that container
CGSize size = ...;
CGRect rect = ...;
CGFloat scale = ...;
UIGraphicsBeginImageContextWithOptions(size, NO, scale);
[container drawViewHierarchyInRect:rect afterScreenUpdates:YES];
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

// 7. Crop the result
UIImage *final = [correctedImage imageByCroppingToRect:destinationRect];

Maybe we could update that imageByCroppingToQuad:destinationSize: to do something along these lines instead? I don't know how to calculate the proper transform, maybe you do?

from aggeometrykit.

hfossli avatar hfossli commented on June 2, 2024

Useful stuff! We can throw our resampler out the window! Anyone have time to do a PR for that?
http://flexmonkey.blogspot.no/2016/04/a-look-at-perspective-transform.html

from aggeometrykit.

Related Issues (20)

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.