Comments (5)
@snown What do you think? Is this something you would like to have a look at?
from aggeometrykit.
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.
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.
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.
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)
- Possible to perspective-distort an image? HOT 17
- Linker errors building Demo HOT 6
- imageWithPerspectiveCorrectionFromQuad corrupts source image HOT 6
- Anti-aliasing approaches HOT 8
- Transformation not applied? HOT 4
- imageWithPerspectiveCorrectionFromQuad scale problem. HOT 7
- Repo moved
- macos support? HOT 2
- Multiple Drag points + Video HOT 5
- Auto-layout HOT 4
- How can I crop the image by using AGGeometryKit. HOT 2
- Rotate around point and scale HOT 3
- Missing AGGeometryKitTests.m HOT 2
- Hello, when i set quadrilateral, the position of the layer is shifted, and how to remove the quadrilateral settings HOT 11
- tvOS HOT 4
- Memory leak in imageByCroppingToRect HOT 3
- Memory leaks HOT 2
- How can I get the final result as UIView or UIImageView
- Is it possible to straighten all the lines?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aggeometrykit.