videocapture read now uses err, im convention

This commit is contained in:
Peter Braden 2013-04-09 21:34:00 -07:00
parent a347ab682e
commit 865962c845
3 changed files with 10 additions and 4 deletions

View File

@ -185,6 +185,11 @@ doesn't work for you please get in touch.
## Changelog
#### 0.0.13
- V Early support for face recognition - API is _likely_ to change. Have fun!
- *API Change*: VideoCapture.read now calls callback(err, im) instead of callback(im)
#### 0.0.12
- Matrix clone()
- NamedWindow Support

View File

@ -5,7 +5,7 @@ var camera = new cv.VideoCapture(0);
setInterval(function() {
camera.read(function(im) {
camera.read(function(err, im) {
im.save('/tmp/cam.png');
});

View File

@ -116,11 +116,12 @@ void AfterAsyncRead(uv_work_t *req) {
mat = baton->im->mat;
img->mat = mat;
Local<Value> argv[1];
Local<Value> argv[2];
argv[0] = im_to_return;
argv[0] = Local<Value>::New(Null());
argv[1] = im_to_return;
baton->cb->Call(Context::GetCurrent()->Global(), 1, argv);
baton->cb->Call(Context::GetCurrent()->Global(), 2, argv);
baton->cb.Dispose();
delete baton;