X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fsrc%2Fimage%2Fresource-image-api.cpp;h=c119b533003ebf21583eab87028834f2594a220d;hp=8e7df3307cd4139fdd64ecce550d1ae5a0c9a4c7;hb=b0d0b451bd3414c8f502810f45fcacba2882d717;hpb=61be2f8d3c96e01da8e6ade2a76a192ff6ab6945 diff --git a/plugins/dali-script-v8/src/image/resource-image-api.cpp b/plugins/dali-script-v8/src/image/resource-image-api.cpp index 8e7df33..c119b53 100644 --- a/plugins/dali-script-v8/src/image/resource-image-api.cpp +++ b/plugins/dali-script-v8/src/image/resource-image-api.cpp @@ -51,8 +51,8 @@ ResourceImage ResourceImageApi::GetResourceImage( v8::Isolate* isolate, const v8 * @for ResourceImage * @param {Object} options * @param {String} options.url The URL of the image file to use. - * @param {Integer} [options.loadPolicy] The LoadPolicy to apply when loading the image resource. - * @param {Integer} [options.releasePolicy] optionally release memory when image is not visible on screen. + * @param {Float} options.width The width to fit the loaded image to + * @param {Float} options.height The height to fit the loaded image to * @return {Object} Image */ Image ResourceImageApi::New( const v8::FunctionCallbackInfo< v8::Value >& args ) @@ -62,12 +62,6 @@ Image ResourceImageApi::New( const v8::FunctionCallbackInfo< v8::Value >& args ) std::string url; ImageDimensions dimensions; - FittingMode::Type fittingMode = FittingMode::DEFAULT; - SamplingMode::Type samplingMode = SamplingMode::DEFAULT; - bool orientationCorrection = true; - ResourceImage::LoadPolicy loadPolicy( ResourceImage::IMMEDIATE ); - Image::ReleasePolicy releasePolicy( Image::NEVER); - v8::Local options( args[0] ); if( !options->IsObject() ) @@ -103,54 +97,7 @@ Image ResourceImageApi::New( const v8::FunctionCallbackInfo< v8::Value >& args ) dimensions = ImageDimensions( dimensions.GetWidth(), height ); } - v8::Local fittingModeValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "fittingMode" ) ); - if( fittingModeValue->IsUint32() ) - { - fittingMode = static_cast( fittingModeValue->ToUint32()->Value() ); - } - - v8::Local samplingModeValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "samplingMode" ) ); - if( samplingModeValue->IsUint32() ) - { - samplingMode = static_cast( samplingModeValue->ToUint32()->Value() ); - } - - v8::Local orientationCorrectionValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "orientationCorrection" ) ); - if( orientationCorrectionValue->IsBoolean() ) - { - orientationCorrection = orientationCorrectionValue->ToBoolean()->Value(); - } - - v8::Local releasePolicyValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "releasePolicy" ) ); - if( releasePolicyValue->IsUint32() ) - { - releasePolicy = static_cast( releasePolicyValue->ToUint32()->Value() ); - } - - v8::Local loadPolicyValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "loadPolicy" ) ); - if( loadPolicyValue->IsUint32() ) - { - loadPolicy = static_cast< ResourceImage::LoadPolicy >( loadPolicyValue->ToUint32()->Value()); - } - - return ResourceImage::New( url, loadPolicy, releasePolicy, dimensions, fittingMode, samplingMode, orientationCorrection ); -} - -/** - * Get the load policy - * - * @method getLoadPolicy - * @for ResourceImage - * @return {Integer} load policy either dali.IMAGE_LOAD_POLICY_ON_DEMAND or dali.IMAGE_LOAD_POLICY_IMMEDIATE - */ -void ResourceImageApi::GetLoadPolicy( const v8::FunctionCallbackInfo< v8::Value >& args ) -{ - v8::Isolate* isolate = args.GetIsolate(); - v8::HandleScope handleScope( isolate ); - - ResourceImage image = GetResourceImage( isolate, args ); - - args.GetReturnValue().Set( v8::Integer::New( isolate, image.GetLoadPolicy() ) ); + return ResourceImage::New( url, dimensions ); } /**