|
@ -41,6 +41,7 @@ Canvas::Initialize(Handle<Object> target) { |
|
|
#ifdef HAVE_JPEG |
|
|
#ifdef HAVE_JPEG |
|
|
NODE_SET_PROTOTYPE_METHOD(constructor, "streamJPEGSync", StreamJPEGSync); |
|
|
NODE_SET_PROTOTYPE_METHOD(constructor, "streamJPEGSync", StreamJPEGSync); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
proto->SetAccessor(String::NewSymbol("type"), GetType); |
|
|
proto->SetAccessor(String::NewSymbol("width"), GetWidth, SetWidth); |
|
|
proto->SetAccessor(String::NewSymbol("width"), GetWidth, SetWidth); |
|
|
proto->SetAccessor(String::NewSymbol("height"), GetHeight, SetHeight); |
|
|
proto->SetAccessor(String::NewSymbol("height"), GetHeight, SetHeight); |
|
|
target->Set(String::NewSymbol("Canvas"), constructor->GetFunction()); |
|
|
target->Set(String::NewSymbol("Canvas"), constructor->GetFunction()); |
|
@ -65,6 +66,17 @@ Canvas::New(const Arguments &args) { |
|
|
return args.This(); |
|
|
return args.This(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Get type string. |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
Handle<Value> |
|
|
|
|
|
Canvas::GetType(Local<String> prop, const AccessorInfo &info) { |
|
|
|
|
|
HandleScope scope; |
|
|
|
|
|
Canvas *canvas = ObjectWrap::Unwrap<Canvas>(info.This()); |
|
|
|
|
|
return scope.Close(String::New(canvas->isPDF() ? "pdf" : "image")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/*
|
|
|
/*
|
|
|
* Get width. |
|
|
* Get width. |
|
|
*/ |
|
|
*/ |
|
|