只是想知道将下面的库转换为Objective-C以便在iPhone上使用有多难?
我猜我正在寻找一些类似的图像处理库,它们将引导我朝着正确的方向前进?我知道,像Instragram、Path和Hipstamatic这样的现有应用程序,要应用相同的过滤器并不容易。
然而,我希望能够做一些类似的事情。
下面是JavaScript库:
https://github.com/alexmic/filtrr/blob/master/filtrr.js
它的功能演示可以在这里找到:
http://alexmic.net/demos/filtrr
发布于 2011-05-23 10:10:16
我已经开始了一些转换,下面是一个示例。当然,完全转换它需要很多时间,对我来说太多了。但看看我是怎么做到的。我希望你有使用Obj-C的经验?
此外,也许您可以查看一些现有的库。
http://code.google.com/p/simple-iphone-image-processing/
http://mattgemmell.com/2010/07/05/mgimageutilities/
http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html
此外,不要忘记XCode可以将C++编译到您的项目中,因此还要研究C或C++库。
NSObject canvas;
int w;
int h;
int ctx;
NSData imageData;
@implementation filtr
{
-(id) initWithCanvas:(id)_canvas
{
if (!_canvas) {
throw "Canvas supplied to filtr was null or undefined.";
}
canvas = _canvas;
w = canvas.width;
h = canvas.height;
ctx = canvas.getContext("2d");
imageData = ctx.getImageData(0, 0, w, h);
}
/**
* Clamps the intensity level between 0 - 255.
*
* @param i The intensity level.
*/
-(int)safe:(int)i
{
return MIN(255, MAX(0, i));
}https://stackoverflow.com/questions/6092129
复制相似问题