本文整理汇总了C++中DynamicJpegStack::Dimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicJpegStack::Dimensions方法的具体用法?C++ DynamicJpegStack::Dimensions怎么用?C++ DynamicJpegStack::Dimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicJpegStack
的用法示例。
在下文中一共展示了DynamicJpegStack::Dimensions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: free
void
DynamicJpegStack::UV_JpegEncodeAfter(uv_work_t *req)
{
;
encode_request *enc_req = (encode_request *)req->data;
delete req;
DynamicJpegStack *jpeg = (DynamicJpegStack *)enc_req->jpeg_obj;
Handle<Value> argv[3];
if (enc_req->error) {
argv[0] = Nan::Undefined();
argv[1] = Nan::Undefined();
argv[2] = Nan::Error(enc_req->error);
}
else {
Handle<Object> buf = Nan::NewBuffer(enc_req->jpeg, enc_req->jpeg_len).ToLocalChecked();
argv[0] = buf;
argv[1] = jpeg->Dimensions();
argv[2] = Nan::Undefined();
}
enc_req->callback->Call(3, argv);
delete enc_req->callback;
free(enc_req->jpeg);
free(enc_req->error);
jpeg->Unref();
free(enc_req);
}
示例2:
Handle<Value>
DynamicJpegStack::Dimensions(const Arguments &args)
{
HandleScope scope;
DynamicJpegStack *jpeg = ObjectWrap::Unwrap<DynamicJpegStack>(args.This());
return scope.Close(jpeg->Dimensions());
}
示例3: Undefined
int
DynamicJpegStack::EIO_JpegEncodeAfter(eio_req *req)
{
HandleScope scope;
ev_unref(EV_DEFAULT_UC);
encode_request *enc_req = (encode_request *)req->data;
DynamicJpegStack *jpeg = (DynamicJpegStack *)enc_req->jpeg_obj;
Handle<Value> argv[3];
if (enc_req->error) {
argv[0] = Undefined();
argv[1] = Undefined();
argv[2] = ErrorException(enc_req->error);
}
else {
Buffer *buf = Buffer::New(enc_req->jpeg_len);
memcpy(BufferData(buf), enc_req->jpeg, enc_req->jpeg_len);
argv[0] = buf->handle_;
argv[1] = jpeg->Dimensions();
argv[2] = Undefined();
}
TryCatch try_catch; // don't quite see the necessity of this
enc_req->callback->Call(Context::GetCurrent()->Global(), 3, argv);
if (try_catch.HasCaught())
FatalException(try_catch);
enc_req->callback.Dispose();
free(enc_req->jpeg);
free(enc_req->error);
jpeg->Unref();
free(enc_req);
return 0;
}