mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
if toBuffer has a cb, run it async. re #21
This commit is contained in:
parent
ac6c685b56
commit
d71b0ae7b3
@ -304,6 +304,10 @@ Handle<Value>
|
||||
Matrix::ToBuffer(const v8::Arguments& args){
|
||||
SETUP_FUNCTION(Matrix)
|
||||
|
||||
if (args.Length() > 0){
|
||||
return Matrix::ToBufferAsync(args);
|
||||
}
|
||||
|
||||
std::vector<uchar> vec(0);
|
||||
std::vector<int> params(0);//CV_IMWRITE_JPEG_QUALITY 90
|
||||
|
||||
|
||||
@ -138,12 +138,12 @@ vows.describe('Smoke Tests OpenCV').addBatch({
|
||||
|
||||
}
|
||||
|
||||
, "toBufferAsync": {
|
||||
, "toBuffer Async": {
|
||||
topic: function(cv){
|
||||
var buf = fs.readFileSync('./examples/mona.png')
|
||||
, cb = this.callback
|
||||
cv.readImage(buf.slice(0), function(err, mat){
|
||||
var buff = mat.toBufferAsync(function(){
|
||||
var buff = mat.toBuffer(function(){
|
||||
cb.apply(this, arguments)
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user