*/
virtual Actor NewItem(unsigned int itemId)
{
- // Create an image actor for this item
+ // Create a renderable actor for this item
Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
Actor actor = CreateRenderableActor(image);
*/
virtual Actor NewItem(unsigned int itemId)
{
- // Create an image actor for this item
+ // Create a renderable actor for this item
Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
Actor actor = CreateRenderableActor(image);
// start multiple guassian blur call, each guassian blur creates two render tasks
DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
- // create image actors for the original image and each blurred image
+ // create image renderers for the original image and each blurred image
Stage::GetCurrent().Add( blurView );
Wait(application);
DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
application.SendNotification();
application.Render();
- // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image actor
+ // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image view
DALI_TEST_EQUALS( editor.GetChildCount(), 3u, TEST_LOCATION );
Actor layer = editor.GetChildAt( 0u );
application.SendNotification();
application.Render();
- // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image actor
+ // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image view
DALI_TEST_EQUALS( field.GetChildCount(), 3u, TEST_LOCATION );
Actor layer = field.GetChildAt( 0u );
/**
* @brief Create an initialized BubbleEmitter.
*
- * @param[in] winSize The size of the bubble moving area, usually the same size as the background image actor.
+ * @param[in] winSize The size of the bubble moving area, usually the same size as the background.
* @param[in] shapeImage The alpha channnel of this texture defines the bubble shape.
* @param[in] maximumNumberOfBubble The maximum number of bubble needed.
* @param[in] bubbleSizeRange The size range of the bubbles; x component is the low bound, and y component is the up bound.
* shadowPlaneBg.SetParentOrigin( ParentOrigin::CENTER );
* shadowPlaneBg.SetAnchorPoint( AnchorPoint::CENTER );
* shadowPlaneBg.SetSize(700.0f, 700.0f);
- * shadowPlaneBg.SetPosition( Vector3(0.0f, 0.0f, -30.0f) ); //Just behind the image actor.
+ * shadowPlaneBg.SetPosition( Vector3(0.0f, 0.0f, -30.0f) ); //Just behind the image view.
* shadowView.SetShadowPlaneBackground(ShadowPlane);
*
* Actor pointLight = Actor::New(); // This will be the light source
/**
* @brief Create a new Dissolve effect
*
- * DissolveEffect is a custom shader effect to achieve Dissolve effects in Image actors.
+ * DissolveEffect is a custom shader effect to achieve Dissolve effects in image views.
*
* Animatable/Constrainable uniforms:
* "uPercentage" - This value is proportional to the distortion applied; a value of zero means no distortion.
// EXTERNAL INCLUDES
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/image-actor.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/property-array.h>
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/signals/functor-delegate.h>
//////////////////////////////////////////////////////
// Create actors
- // Create an ImageActor for rendering from the scene texture to the bloom texture
- mBloomExtractImageActor = Toolkit::ImageView::New();
- mBloomExtractImageActor.SetParentOrigin( ParentOrigin::CENTER );
+ // Create an image view for rendering from the scene texture to the bloom texture
+ mBloomExtractImageView = Toolkit::ImageView::New();
+ mBloomExtractImageView.SetParentOrigin( ParentOrigin::CENTER );
// Create shader used for extracting the bright parts of an image
Property::Map customShader;
Property::Map rendererMap;
rendererMap.Insert( "rendererType", "image" );
rendererMap.Insert( "shader", customShader );
- mBloomExtractImageActor.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
+ mBloomExtractImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
- // Create an ImageActor for compositing the result (scene and bloom textures) to output
- mCompositeImageActor = Toolkit::ImageView::New();
- mCompositeImageActor.SetParentOrigin( ParentOrigin::CENTER );
+ // Create an image view for compositing the result (scene and bloom textures) to output
+ mCompositeImageView = Toolkit::ImageView::New();
+ mCompositeImageView.SetParentOrigin( ParentOrigin::CENTER );
// Create shader used to composite bloom and original image to output render target
customShader[ "fragmentShader" ] = COMPOSITE_FRAGMENT_SOURCE;
rendererMap[ "shader" ] = customShader;
- mCompositeImageActor.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
+ mCompositeImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
- // Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
- mTargetImageActor = Toolkit::ImageView::New();
- mTargetImageActor.SetParentOrigin( ParentOrigin::CENTER );
+ // Create an image view for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
+ mTargetImageView = Toolkit::ImageView::New();
+ mTargetImageView.SetParentOrigin( ParentOrigin::CENTER );
// Create the Gaussian Blur object + render tasks
// Note that we use mBloomExtractTarget as the source image and also re-use this as the gaussian blur final render target. This saves the gaussian blur code from creating it
// Connect to actor tree
Self().Add( mChildrenRoot );
Self().Add( mInternalRoot );
- mInternalRoot.Add( mBloomExtractImageActor );
+ mInternalRoot.Add( mBloomExtractImageView );
mInternalRoot.Add( mGaussianBlurView );
- mInternalRoot.Add( mCompositeImageActor );
- mInternalRoot.Add( mTargetImageActor );
+ mInternalRoot.Add( mCompositeImageView );
+ mInternalRoot.Add( mTargetImageView );
mInternalRoot.Add( mRenderDownsampledCamera );
mInternalRoot.Add( mRenderFullSizeCamera );
mTargetSize = Vector2(targetSize);
mChildrenRoot.SetSize(targetSize);
- mCompositeImageActor.SetSize(targetSize);
- mTargetImageActor.SetSize(targetSize);
+ mCompositeImageView.SetSize(targetSize);
+ mTargetImageView.SetSize(targetSize);
// Children render camera must move when GaussianBlurView object is
// resized. This is since we cannot change render target size - so we need
//////////////////////////////////////////////////////
// Point actors and render tasks at new render targets
- mBloomExtractImageActor.SetImage( mRenderTargetForRenderingChildren );
- mBloomExtractImageActor.SetSize(mDownsampledWidth, mDownsampledHeight); // size needs to match render target
+ mBloomExtractImageView.SetImage( mRenderTargetForRenderingChildren );
+ mBloomExtractImageView.SetSize(mDownsampledWidth, mDownsampledHeight); // size needs to match render target
// set GaussianBlurView to blur our extracted bloom
mGaussianBlurView.SetUserImageAndOutputRenderTarget(mBloomExtractTarget, mBlurExtractTarget);
// use the completed blur in the first buffer and composite with the original child actors render
- mCompositeImageActor.SetImage( mRenderTargetForRenderingChildren );
- TextureSet textureSet = mCompositeImageActor.GetRendererAt(0).GetTextures();
+ mCompositeImageView.SetImage( mRenderTargetForRenderingChildren );
+ TextureSet textureSet = mCompositeImageView.GetRendererAt(0).GetTextures();
textureSet.SetImage( 1u, mBlurExtractTarget );
// set up target actor for rendering result, i.e. the blurred image
- mTargetImageActor.SetImage(mOutputRenderTarget);
+ mTargetImageView.SetImage(mOutputRenderTarget);
}
}
// Extract the bright part of the image and render to a new buffer. Downsampling also occurs at this stage to save pixel fill, if it is set up.
mBloomExtractTask = taskList.CreateTask();
- mBloomExtractTask.SetSourceActor( mBloomExtractImageActor );
+ mBloomExtractTask.SetSourceActor( mBloomExtractImageView );
mBloomExtractTask.SetExclusive(true);
mBloomExtractTask.SetInputEnabled( false );
mBloomExtractTask.SetClearEnabled( true );
// GaussianBlurView tasks must be created here, so they are executed in the correct order with respect to BloomView tasks
GetImpl(mGaussianBlurView).CreateRenderTasks();
- // Use an image actor displaying the children render and composite it with the blurred bloom buffer, targeting the output
+ // Use an image view displaying the children render and composite it with the blurred bloom buffer, targeting the output
mCompositeTask = taskList.CreateTask();
- mCompositeTask.SetSourceActor( mCompositeImageActor );
+ mCompositeTask.SetSourceActor( mCompositeImageView );
mCompositeTask.SetExclusive(true);
mCompositeTask.SetInputEnabled( false );
mCompositeTask.SetClearEnabled( true );
// bloom threshold
// set defaults, makes sure properties are registered with shader
- mBloomExtractImageActor.RegisterProperty( BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT );
- mBloomExtractImageActor.RegisterProperty( RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME, 1.0f / (1.0f - BLOOM_THRESHOLD_DEFAULT) );
+ mBloomExtractImageView.RegisterProperty( BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT );
+ mBloomExtractImageView.RegisterProperty( RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME, 1.0f / (1.0f - BLOOM_THRESHOLD_DEFAULT) );
// Register a property that the user can control to change the bloom threshold
mBloomThresholdPropertyIndex = self.RegisterProperty(BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT);
- Property::Index shaderBloomThresholdPropertyIndex = mBloomExtractImageActor.GetPropertyIndex(BLOOM_THRESHOLD_PROPERTY_NAME);
- Constraint bloomThresholdConstraint = Constraint::New<float>( mBloomExtractImageActor, shaderBloomThresholdPropertyIndex, EqualToConstraint());
+ Property::Index shaderBloomThresholdPropertyIndex = mBloomExtractImageView.GetPropertyIndex(BLOOM_THRESHOLD_PROPERTY_NAME);
+ Constraint bloomThresholdConstraint = Constraint::New<float>( mBloomExtractImageView, shaderBloomThresholdPropertyIndex, EqualToConstraint());
bloomThresholdConstraint.AddSource( Source(self, mBloomThresholdPropertyIndex) );
bloomThresholdConstraint.Apply();
// precalc 1.0 / (1.0 - threshold) on CPU to save shader insns, using constraint to tie to the normal threshold property
- Property::Index shaderRecipOneMinusBloomThresholdPropertyIndex = mBloomExtractImageActor.GetPropertyIndex(RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME);
- Constraint thresholdConstraint = Constraint::New<float>( mBloomExtractImageActor, shaderRecipOneMinusBloomThresholdPropertyIndex, RecipOneMinusConstraint());
+ Property::Index shaderRecipOneMinusBloomThresholdPropertyIndex = mBloomExtractImageView.GetPropertyIndex(RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME);
+ Constraint thresholdConstraint = Constraint::New<float>( mBloomExtractImageView, shaderRecipOneMinusBloomThresholdPropertyIndex, RecipOneMinusConstraint());
thresholdConstraint.AddSource( LocalSource(shaderBloomThresholdPropertyIndex) );
thresholdConstraint.Apply();
// Register a property that the user can control to fade the bloom intensity via internally hidden shader
mBloomIntensityPropertyIndex = self.RegisterProperty(BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT);
- mCompositeImageActor.RegisterProperty( BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT );
- Property::Index shaderBloomIntensityPropertyIndex = mCompositeImageActor.GetPropertyIndex(BLOOM_INTENSITY_PROPERTY_NAME);
- Constraint bloomIntensityConstraint = Constraint::New<float>( mCompositeImageActor, shaderBloomIntensityPropertyIndex, EqualToConstraint());
+ mCompositeImageView.RegisterProperty( BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT );
+ Property::Index shaderBloomIntensityPropertyIndex = mCompositeImageView.GetPropertyIndex(BLOOM_INTENSITY_PROPERTY_NAME);
+ Constraint bloomIntensityConstraint = Constraint::New<float>( mCompositeImageView, shaderBloomIntensityPropertyIndex, EqualToConstraint());
bloomIntensityConstraint.AddSource( Source(self, mBloomIntensityPropertyIndex) );
bloomIntensityConstraint.Apply();
// Register a property that the user can control to fade the bloom saturation via internally hidden shader
mBloomSaturationPropertyIndex = self.RegisterProperty(BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT);
- mCompositeImageActor.RegisterProperty( BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT );
- Property::Index shaderBloomSaturationPropertyIndex = mCompositeImageActor.GetPropertyIndex(BLOOM_SATURATION_PROPERTY_NAME);
- Constraint bloomSaturationConstraint = Constraint::New<float>( mCompositeImageActor, shaderBloomSaturationPropertyIndex, EqualToConstraint());
+ mCompositeImageView.RegisterProperty( BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT );
+ Property::Index shaderBloomSaturationPropertyIndex = mCompositeImageView.GetPropertyIndex(BLOOM_SATURATION_PROPERTY_NAME);
+ Constraint bloomSaturationConstraint = Constraint::New<float>( mCompositeImageView, shaderBloomSaturationPropertyIndex, EqualToConstraint());
bloomSaturationConstraint.AddSource( Source(self, mBloomSaturationPropertyIndex) );
bloomSaturationConstraint.Apply();
// Register a property that the user can control to fade the image intensity via internally hidden shader
mImageIntensityPropertyIndex = self.RegisterProperty(IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT);
- mCompositeImageActor.RegisterProperty( IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT );
- Property::Index shaderImageIntensityPropertyIndex = mCompositeImageActor.GetPropertyIndex(IMAGE_INTENSITY_PROPERTY_NAME);
- Constraint imageIntensityConstraint = Constraint::New<float>( mCompositeImageActor, shaderImageIntensityPropertyIndex, EqualToConstraint());
+ mCompositeImageView.RegisterProperty( IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT );
+ Property::Index shaderImageIntensityPropertyIndex = mCompositeImageView.GetPropertyIndex(IMAGE_INTENSITY_PROPERTY_NAME);
+ Constraint imageIntensityConstraint = Constraint::New<float>( mCompositeImageView, shaderImageIntensityPropertyIndex, EqualToConstraint());
imageIntensityConstraint.AddSource( Source(self, mImageIntensityPropertyIndex) );
imageIntensityConstraint.Apply();
// Register a property that the user can control to fade the image saturation via internally hidden shader
mImageSaturationPropertyIndex = self.RegisterProperty(IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT);
- mCompositeImageActor.RegisterProperty( IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT );
- Property::Index shaderImageSaturationPropertyIndex = mCompositeImageActor.GetPropertyIndex(IMAGE_SATURATION_PROPERTY_NAME);
- Constraint imageSaturationConstraint = Constraint::New<float>( mCompositeImageActor, shaderImageSaturationPropertyIndex, EqualToConstraint());
+ mCompositeImageView.RegisterProperty( IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT );
+ Property::Index shaderImageSaturationPropertyIndex = mCompositeImageView.GetPropertyIndex(IMAGE_SATURATION_PROPERTY_NAME);
+ Constraint imageSaturationConstraint = Constraint::New<float>( mCompositeImageView, shaderImageSaturationPropertyIndex, EqualToConstraint());
imageSaturationConstraint.AddSource( Source(self, mImageSaturationPropertyIndex) );
imageSaturationConstraint.Apply();
}
// for extracting bright parts of image to an offscreen target
FrameBufferImage mBloomExtractTarget; // for rendering bright parts of image into separate texture, also used as target for gaussian blur
RenderTask mBloomExtractTask;
- Toolkit::ImageView mBloomExtractImageActor;
+ Toolkit::ImageView mBloomExtractImageView;
/////////////////////////////////////////////////////////////
// for blurring extracted bloom
// for compositing bloom and children renders to offscreen target
RenderTask mCompositeTask;
- Toolkit::ImageView mCompositeImageActor;
+ Toolkit::ImageView mCompositeImageView;
/////////////////////////////////////////////////////////////
// for holding blurred result
FrameBufferImage mOutputRenderTarget;
- Toolkit::ImageView mTargetImageActor;
+ Toolkit::ImageView mTargetImageView;
/////////////////////////////////////////////////////////////
// Properties for setting by user, e.g. by animations
* Ideally use one group of uniform to control one bubble.
* If the num of patches in the MeshActor is more than groups of uniforms,
* the uniform values will be shared by multiple bubbles. Allow up to 9 times.
- * @param[in] movementArea The size of the bubble moving area, usually the same size as the background image actor.
+ * @param[in] movementArea The size of the bubble moving area, usually the same size as the background.
* @return A newly allocated object.
*/
BubbleActor( unsigned int numberOfBubble,
Actor mActor;
Renderer mRenderer;
- Vector2 mMovementArea; ///< The size of the bubble moving area, usually the same size as the background image actor.
+ Vector2 mMovementArea; ///< The size of the bubble moving area, usually the same size as the background.
//properties mapped as uniforms
std::vector<Property::Index> mIndicesOffset; ///< Indices of the properties mapping to uniform array 'uOffset'
TextureSet mTextureSet; ///< The texture set which controls the bubble display
std::vector<BubbleActorPtr> mBubbleActors; ///< The meshActor vector, its size is mNumShader.
- Vector2 mMovementArea; ///< The size of the bubble moving area, usually the same size as the background image actor.
+ Vector2 mMovementArea; ///< The size of the bubble moving area, usually the same size as the background.
Vector2 mBubbleSizeRange; ///< The size range of the bubbles; x component is the low bound, and y component is the up bound.
Vector3 mHSVDelta; ///< The HSV difference used to adjust the background image color.
const Vector4 EFFECTS_VIEW_DEFAULT_BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 0.0 );
const bool EFFECTS_VIEW_REFRESH_ON_DEMAND(false);
+#define DALI_COMPOSE_SHADER(STR) #STR
+
const char* EFFECTS_VIEW_VERTEX_SOURCE = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
varying mediump vec2 vTexCoord;\n
// 2 modes:
// 1st mode, this control has a tree of actors (use Add() to add children) that are rendered and blurred.
// mRenderChildrenTask renders children to FB mRenderTargetForRenderingChildren
-// mHorizBlurTask renders mImageActorHorizBlur Actor showing FB mRenderTargetForRenderingChildren into FB mRenderTarget2
-// mVertBlurTask renders mImageActorVertBlur Actor showing FB mRenderTarget2 into FB mRenderTarget1
-// mCompositeTask renders mImageActorComposite Actor showing FB mRenderTarget1 into FB mRenderTargetForRenderingChildren
+// mHorizBlurTask renders mImageViewHorizBlur Actor showing FB mRenderTargetForRenderingChildren into FB mRenderTarget2
+// mVertBlurTask renders mImageViewVertBlur Actor showing FB mRenderTarget2 into FB mRenderTarget1
+// mCompositeTask renders mImageViewComposite Actor showing FB mRenderTarget1 into FB mRenderTargetForRenderingChildren
//
// 2nd mode, an image is blurred and rendered to a supplied target framebuffer
-// mHorizBlurTask renders mImageActorHorizBlur Actor showing mUserInputImage into FB mRenderTarget2
-// mVertBlurTask renders mImageActorVertBlur Actor showing mRenderTarget2 into FB mUserOutputRenderTarget
+// mHorizBlurTask renders mImageViewHorizBlur Actor showing mUserInputImage into FB mRenderTarget2
+// mVertBlurTask renders mImageViewVertBlur Actor showing mRenderTarget2 into FB mUserOutputRenderTarget
//
// Only this 2nd mode handles ActivateOnce
DALI_ASSERT_ALWAYS(mBlurUserImage);
mUserInputImage = inputImage;
- mImageActorHorizBlur.SetImage( mUserInputImage );
+ mImageViewHorizBlur.SetImage( mUserInputImage );
mUserOutputRenderTarget = outputRenderTarget;
}
//////////////////////////////////////////////////////
// Create actors
- // Create an ImageActor for performing a horizontal blur on the texture
- mImageActorHorizBlur = Toolkit::ImageView::New();
- mImageActorHorizBlur.SetParentOrigin(ParentOrigin::CENTER);
- mImageActorHorizBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
+ // Create an image view for performing a horizontal blur on the texture
+ mImageViewHorizBlur = Toolkit::ImageView::New();
+ mImageViewHorizBlur.SetParentOrigin(ParentOrigin::CENTER);
+ mImageViewHorizBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
- // Create an ImageActor for performing a vertical blur on the texture
- mImageActorVertBlur = Toolkit::ImageView::New();
- mImageActorVertBlur.SetParentOrigin(ParentOrigin::CENTER);
- mImageActorVertBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
+ // Create an image view for performing a vertical blur on the texture
+ mImageViewVertBlur = Toolkit::ImageView::New();
+ mImageViewVertBlur.SetParentOrigin(ParentOrigin::CENTER);
+ mImageViewVertBlur.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap );
// Register a property that the user can control to fade the blur in / out via the GaussianBlurView object
Actor self = Self();
mBlurStrengthPropertyIndex = self.RegisterProperty(GAUSSIAN_BLUR_VIEW_STRENGTH_PROPERTY_NAME, GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH);
- // Create an ImageActor for compositing the blur and the original child actors render
+ // Create an image view for compositing the blur and the original child actors render
if(!mBlurUserImage)
{
- mImageActorComposite = Toolkit::ImageView::New();
- mImageActorComposite.SetParentOrigin(ParentOrigin::CENTER);
- mImageActorComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value
+ mImageViewComposite = Toolkit::ImageView::New();
+ mImageViewComposite.SetParentOrigin(ParentOrigin::CENTER);
+ mImageViewComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value
- Constraint blurStrengthConstraint = Constraint::New<float>( mImageActorComposite, Actor::Property::COLOR_ALPHA, EqualToConstraint());
+ Constraint blurStrengthConstraint = Constraint::New<float>( mImageViewComposite, Actor::Property::COLOR_ALPHA, EqualToConstraint());
blurStrengthConstraint.AddSource( Source( self, mBlurStrengthPropertyIndex) );
blurStrengthConstraint.Apply();
- // Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
+ // Create an image view for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
mTargetActor = Toolkit::ImageView::New();
mTargetActor.SetParentOrigin(ParentOrigin::CENTER);
//////////////////////////////////////////////////////
// Connect to actor tree
- mInternalRoot.Add( mImageActorComposite );
+ mInternalRoot.Add( mImageViewComposite );
mInternalRoot.Add( mTargetActor );
mInternalRoot.Add( mRenderFullSizeCamera );
}
// Connect to actor tree
Self().Add( mChildrenRoot );
Self().Add( mInternalRoot );
- mInternalRoot.Add( mImageActorHorizBlur );
- mInternalRoot.Add( mImageActorVertBlur );
+ mInternalRoot.Add( mImageViewHorizBlur );
+ mInternalRoot.Add( mImageViewVertBlur );
mInternalRoot.Add( mRenderDownsampledCamera );
}
if( !mBlurUserImage )
{
- mImageActorComposite.SetSize(targetSize);
+ mImageViewComposite.SetSize(targetSize);
mTargetActor.SetSize(targetSize);
// Children render camera must move when GaussianBlurView object is resized. This is since we cannot change render target size - so we need to remap the child actors' rendering
// create offscreen buffer of new size to render our child actors to
mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
- // Set ImageActor for performing a horizontal blur on the texture
- mImageActorHorizBlur.SetImage( mRenderTargetForRenderingChildren );
+ // Set image view for performing a horizontal blur on the texture
+ mImageViewHorizBlur.SetImage( mRenderTargetForRenderingChildren );
// Create offscreen buffer for vert blur pass
mRenderTarget1 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat );
// use the completed blur in the first buffer and composite with the original child actors render
- mImageActorComposite.SetImage( mRenderTarget1 );
+ mImageViewComposite.SetImage( mRenderTarget1 );
// set up target actor for rendering result, i.e. the blurred image
mTargetActor.SetImage(mRenderTargetForRenderingChildren);
mRenderTarget2 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat );
// size needs to match render target
- mImageActorHorizBlur.SetSize(mDownsampledWidth, mDownsampledHeight);
+ mImageViewHorizBlur.SetSize(mDownsampledWidth, mDownsampledHeight);
// size needs to match render target
- mImageActorVertBlur.SetImage( mRenderTarget2 );
- mImageActorVertBlur.SetSize(mDownsampledWidth, mDownsampledHeight);
+ mImageViewVertBlur.SetImage( mRenderTarget2 );
+ mImageViewVertBlur.SetSize(mDownsampledWidth, mDownsampledHeight);
// set gaussian blur up for new sized render targets
SetShaderConstants();
// perform a horizontal blur targeting the second buffer
mHorizBlurTask = taskList.CreateTask();
- mHorizBlurTask.SetSourceActor( mImageActorHorizBlur );
+ mHorizBlurTask.SetSourceActor( mImageViewHorizBlur );
mHorizBlurTask.SetExclusive(true);
mHorizBlurTask.SetInputEnabled( false );
mHorizBlurTask.SetClearEnabled( true );
// use the second buffer and perform a horizontal blur targeting the first buffer
mVertBlurTask = taskList.CreateTask();
- mVertBlurTask.SetSourceActor( mImageActorVertBlur );
+ mVertBlurTask.SetSourceActor( mImageViewVertBlur );
mVertBlurTask.SetExclusive(true);
mVertBlurTask.SetInputEnabled( false );
mVertBlurTask.SetClearEnabled( true );
if(!mBlurUserImage)
{
mCompositeTask = taskList.CreateTask();
- mCompositeTask.SetSourceActor( mImageActorComposite );
+ mCompositeTask.SetSourceActor( mImageViewComposite );
mCompositeTask.SetExclusive(true);
mCompositeTask.SetInputEnabled( false );
Vector2 yAxis(0.0f, 1.0f);
for (i = 0; i < mNumSamples; ++i )
{
- mImageActorHorizBlur.RegisterProperty( GetSampleOffsetsPropertyName( i ), uvOffsets[ i ] * xAxis );
- mImageActorHorizBlur.RegisterProperty( GetSampleWeightsPropertyName( i ), weights[ i ] );
+ mImageViewHorizBlur.RegisterProperty( GetSampleOffsetsPropertyName( i ), uvOffsets[ i ] * xAxis );
+ mImageViewHorizBlur.RegisterProperty( GetSampleWeightsPropertyName( i ), weights[ i ] );
- mImageActorVertBlur.RegisterProperty( GetSampleOffsetsPropertyName( i ), uvOffsets[ i ] * yAxis );
- mImageActorVertBlur.RegisterProperty( GetSampleWeightsPropertyName( i ), weights[ i ] );
+ mImageViewVertBlur.RegisterProperty( GetSampleOffsetsPropertyName( i ), uvOffsets[ i ] * yAxis );
+ mImageViewVertBlur.RegisterProperty( GetSampleWeightsPropertyName( i ), weights[ i ] );
}
delete[] uvOffsets;
FrameBufferImage mRenderTarget1;
FrameBufferImage mRenderTarget2;
- Toolkit::ImageView mImageActorHorizBlur;
- Toolkit::ImageView mImageActorVertBlur;
+ Toolkit::ImageView mImageViewHorizBlur;
+ Toolkit::ImageView mImageViewVertBlur;
RenderTask mHorizBlurTask;
RenderTask mVertBlurTask;
/////////////////////////////////////////////////////////////
// for compositing blur and children renders to offscreen target
- Toolkit::ImageView mImageActorComposite;
+ Toolkit::ImageView mImageViewComposite;
RenderTask mCompositeTask;
/////////////////////////////////////////////////////////////
/**
* @brief Create a new PageTurnEffect
- * PageTurnEffect is a custom shader effect to achieve page turn effect for Image actors.
+ * PageTurnEffect is a custom shader to achieve page turn effect for image views.
*
* Usage example:-
*
* Property::Map pageTurnEffect = CreatePageTurnEffect();
*
* // set image view custom shader to the page-turn one\n
- * // for portrait view, one image actor for each page\n
- * // for landscape view, the page turned over is still visible, so back image is needed \n
- * // in this case, create another image Actor using the back image and added to the page actor \n
+ * // for portrait view, the image is rendered as the front side of page\n
+ * // for landscape view, the back side becomes visible when the page is turned over. \n
+ * // in this case, the left and right half of the image are renderer as the front and back side separately. \n
* ImageView page = ImageView::New(....); \n
* page.SetProperty ( ImageView::Property::IMAGE, pageTurnEffect ); \n
*
/**
* Constructor.
* It initializes the PageTurnPortraitView members
- * @param[in] pageFactory The factory which provides image actors to PageTurnView as the page content.
+ * @param[in] pageFactory The factory which provides image to PageTurnView as the page content.
* @param[in] pageSize The size of the page
*/
PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize );
/**
* Constructor.
* It initializes the PageTurnPortraitView members
- * @param[in] pageFactory The factory which provides image actors to PageTurnView as the page content.
+ * @param[in] pageFactory The factory which provides image to PageTurnView as the page content.
* @param[in] pageSize The size of the page
*/
PageTurnPortraitView( PageFactory& pageFactory, const Vector2& pageSize );
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h>
#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
-// headers needed for backward compatibility of PageFactory::NewPage(pageId) API
-#include <dali/public-api/actors/image-actor.h>
-
using namespace Dali;
namespace //Unnamed namespace
mClipper = Clipper::New( size );
self.Add( mClipper->GetRootActor() );
- self.Add( mClipper->GetImageActor() );
+ self.Add( mClipper->GetImageView() );
}
else if ( mClipper )
{
}
else
{
- // Note - this will automatically remove the root & image actors
+ // Note - this will automatically remove the root actor & the image view
mClipper.Reset();
}
}
mClipper = Clipper::New( size );
self.Add( mClipper->GetRootActor() );
- self.Add( mClipper->GetImageActor() );
+ self.Add( mClipper->GetImageView() );
}
else if ( mClipper )
{
}
else
{
- // Note - this will automatically remove the root & image actors
+ // Note - this will automatically remove the root actor & the image view
mClipper.Reset();
}
}
// EXTERNAL INCLUDES
#include <dali/public-api/render-tasks/render-task.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali/public-api/actors/image-actor.h>
// INTERNAL INCLUDES
#include "image-filter.h"
return mOffscreenRootActor;
}
-Actor Clipper::GetImageActor() const
+Actor Clipper::GetImageView() const
{
- return mImageActor;
+ return mImageView;
}
void Clipper::Refresh( const Vector2& size )
mOffscreenRootActor.SetSize( size );
- mImageActor.SetSize( offscreenSize );
- mImageActor.SetImage( frameBufferImage );
+ mImageView.SetSize( offscreenSize );
+ mImageView.SetImage( frameBufferImage );
mRenderTask.SetTargetFrameBuffer( frameBufferImage );
// Stores current sizPe to avoid create new Dali resources if text changes.
const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );
- // Create a root actor and an image actor for offscreen rendering.
+ // Create a root actor and an image view for offscreen rendering.
mOffscreenRootActor = Layer::New();
mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
mOffscreenRootActor.SetInheritPosition( false );
mOffscreenRootActor.SetDepthTestDisabled( true );
mOffscreenRootActor.SetSize( offscreenSize );
- mImageActor = ImageView::New();
- mImageActor.SetParentOrigin( ParentOrigin::CENTER );
- mImageActor.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
- mImageActor.SetSize( offscreenSize );
+ mImageView = ImageView::New();
+ mImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mImageView.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
+ mImageView.SetSize( offscreenSize );
// Creates a new camera actor.
mOffscreenCameraActor = CameraActor::New();
FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
offscreenSize.height,
Pixel::RGBA8888 );
- mImageActor.SetImage( frameBufferImage );
+ mImageView.SetImage( frameBufferImage );
mRenderTask.SetTargetFrameBuffer( frameBufferImage );
- mImageActor.OnStageSignal().Connect(this, &Clipper::OnStageConnect);
+ mImageView.OnStageSignal().Connect(this, &Clipper::OnStageConnect);
// Stores current size to avoid create new Dali resources if text changes.
mCurrentOffscreenSize = offscreenSize;
void Clipper::OnStageConnect( Dali::Actor actor )
{
- Renderer renderer = mImageActor.GetRendererAt(0);
+ Renderer renderer = mImageView.GetRendererAt(0);
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE );
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ONE_MINUS_SRC_ALPHA );
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA, BlendFactor::ONE );
if( Stage::IsInstalled() )
{
UnparentAndReset( mOffscreenRootActor );
- UnparentAndReset( mImageActor );
+ UnparentAndReset( mImageView );
Stage::GetCurrent().GetRenderTaskList().RemoveTask( mRenderTask );
}
/**
* @brief Children added to this actor will be clipped with the specified region.
*
- * @note This is done by rendering to a FrameBufferImage which must then be displayed; see also GetImageActor().
+ * @note This is done by rendering to a FrameBufferImage which must then be displayed; see also GetImageView().
* @return The root actor.
*/
Actor GetRootActor() const;
/**
* @brief This actor will display the resulting FrameBufferImage.
*
- * @return The image actor.
+ * @return The image view.
*/
- Actor GetImageActor() const;
+ Actor GetImageView() const;
/**
* @brief Refresh the contents of the FrameBufferImage.
Layer mOffscreenRootActor;
CameraActor mOffscreenCameraActor;
- ImageView mImageActor;
+ ImageView mImageView;
RenderTask mRenderTask;
Vector2 mCurrentOffscreenSize;
};
void Button::SetButtonImage( Image image )
{
- Actor imageActor = Toolkit::ImageView::New( image );
- imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
+ Actor imageView = Toolkit::ImageView::New( image );
+ imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageView );
}
void Button::SetSelectedImage( Image image )
{
- Actor imageActor = Toolkit::ImageView::New( image );
- imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor );
+ Actor imageView = Toolkit::ImageView::New( image );
+ imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageView );
}
Actor Button::GetButtonImage() const
{
/**
- * @brief PageFactory is an abstract interface for providing image actors to PageTurnView
+ * @brief PageFactory is an abstract interface for providing images to PageTurnView
* Each page is identified by a unique ID, and has a linear order from 0 to GetNumberOfPages()-1
*
* @SINCE_1_1.4
*
* var ImageView = require(" ImageView.js");
*
- * var imageView = new ImageView( position, orientation, image, "my first image actor");
+ * var imageView = new ImageView( position, orientation, image, "my first image view");
*
* #### Exporting as a singleton
*
Dali::Stage GetStage( v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args );
/**
- * StageApi API see image-actor.h for a description
+ * StageApi API see stage.h for a description
*/
void Add( const v8::FunctionCallbackInfo< v8::Value >& args );
void Remove( const v8::FunctionCallbackInfo< v8::Value >& args );
+++ /dev/null
-// Created with TexturePacker (http://www.codeandweb.com/texturepacker)
-// DALi Exporter: nick.holland@partner.samsung.com
-//
-// {{smartUpdateKey}}
-
-// For your application cut and paste either:
-//
-// 1. Lookup table.
-// 2. Constants.
-// 3. JavaScript property map for using with DALi JS.
-
-// Note: If you use one option, then delete code for the other two
-
-
-
-
-//
-// 1. ------ lookup table method ------
-//
-// Handy if you want to get image with a postfix, e.g. image_1, image_2, image_3
-// Or if some of the image names contain special characters which are not allowed
-// in constant definitions ( e.g. spaces and full stops).
-
-
-const char* ATLAS_FILE_NAME( "{{texture.fullName}}" ); ///< Atlas image filename
-
-
-/**
- * Structure to hold image name and position within the atlas.
- *
- */
-struct ImageInfo
-{
- const char* name;
- unsigned int x,y,w,h;
- Dali::BlendingMode::Type blendMode; // only enable blending if image has alpha
-};
-
-/**
- * lookup table
- */
-const ImageInfo ImageAtlas[]=
-{
-{% for sprite in allSprites %} { "{{sprite.trimmedName}}", {{sprite.frameRect.x}}, {{sprite.frameRect.y}}, {{sprite.frameRect.width}}, {{sprite.frameRect.height}}, {%if sprite.isSolid %}BlendingMode::OFF{% else%}BlendingMode::ON{% endif %} }{% if not forloop.last %},{% endif %}
-{% endfor %}
-};
-
-const unsigned int ATLAS_IMAGE_COUNT = sizeof(ImageAtlas)/sizeof(ImageAtlas[0]);
-
-// Example function on how to get an image info from the table
-//
-// std::string fileName = std::string( DALI_IMAGE_DIR ) + ATLAS_FILE_NAME;
-// Image imageAtlas = Image::New( fileName );
-//
-//
-// const ImageInfo* info = GetImageInfo("left_icon");
-//
-// if( info)
-// {
-// ImageActor myActor = ImageActor::New( imageAtlas, ImageActor::PixelArea( info->x, info->y, info->w, info->h) );
-// myActor->SetBlendMode( info->blendMode );
-//
-//
-
-const ImageInfo* GetImageInfo(const char* name)
-{
- typedef std::map< const char*, const ImageInfo* > LookupMap;
- static LookupMap lookup;
- if( lookup.empty() )
- {
- for( unsigned int i = 0; i < ATLAS_IMAGE_COUNT; ++i)
- {
- lookup[ ImageAtlas[i].name ] = &ImageAtlas[i];
- }
- }
- LookupMap::const_iterator iter = lookup.find(name);
- if( iter != lookup.end() )
- {
- return (*iter).second;
- }
- DALI_ASSERT_ALWAYS(0 && "image name not found in atlas");
- return NULL;
-}
-
-//
-//
-// 2. ------ constants code ------
-//
-//
-
-const char* ATLAS_FILE_NAME( "{{texture.fullName}}" );
-
-/**
- * Structure to hold position / blend mode within the atlas.
- *
- */
-struct ImageInfo
-{
- ImageInfo(unsigned int x,unsigned int y,unsigned int w,unsigned int h, Dali::BlendingMode::Type mode)
- :pixelArea(x,y,w,h),blendMode(mode)
- {}
- ImageActor::PixelArea pixelArea;
- Dali::BlendingMode::Type blendMode; // only enable blending if image had alpha
-};
-
-{% for sprite in allSprites %}const ImageInfo {{ sprite.trimmedName|upper}}( {{sprite.frameRect.x}}, {{sprite.frameRect.y}}, {{sprite.frameRect.width}}, {{sprite.frameRect.height}} ,{%if sprite.isSolid %}BlendingMode::OFF{% else%}BlendingMode::ON{% endif %} );
-{% endfor %}
-
-
-// Example on using the Atlas, please delete this code.
-void LoadAtlasImages()
-{
- std::string fileName = std::string(DALI_IMAGE_DIR) + ATLAS_FILE_NAME;
- Image atlasImage = Image::New( fileName );
- {% for sprite in allSprites %}ImageActor {{sprite.trimmedName|capfirst}} = ImageActor::New( atlasImage, {{sprite.trimmedName|upper}}.pixelArea);
- {{sprite.trimmedName|capfirst}}.SetBlendMode( {{sprite.trimmedName|upper}}.blendMode );
-
- {% endfor %}
-}
-
-//
-//
-// 3. ------ JavaScript key/value lookup table ------
-//
-//
-//
-
-ATLAS_IMAGE_LIST : [
-{% for sprite in allSprites %} { name: "{{sprite.trimmedName}}", x: {{sprite.frameRect.x}}, y:{{sprite.frameRect.y}}, w:{{sprite.frameRect.width}}, h:{{sprite.frameRect.height}}, blendMode:{%if sprite.isSolid %}dali.BLENDING_OFF{% else%}dali.BLENDING_ON{% endif %} }{% if not forloop.last %},{% endif %}
-{% endfor %}
-]
+++ /dev/null
-<exporter version="1.0">
- <!-- identifier of the exporter -->
- <name>dali_exporter</name>
-
- <!-- display name of the exporter for the combo box -->
- <displayName>DALi 3D</displayName>
-
- <!-- description of the exporter -->
- <description>DALi 3D exporter for TexturePacker</description>
-
- <!-- exporter version -->
- <version>1.0</version>
-
- <!-- currently only one file allowed - more to come soon -->
- <files>
- <file>
- <!-- name of this file variable -->
- <name>maintext</name>
-
- <!-- human readable name (for GUI) -->
- <displayName>.cpp file</displayName>
-
- <!-- file extension for the file -->
- <fileExtension>cpp</fileExtension>
-
- <!-- name of the template file -->
- <template>dali3d_exporter.cpp</template>
- </file>
- </files>
-
- <!-- target framework supports trimming -->
- <supportsTrimming>no</supportsTrimming>
-
- <!-- target framework supports rotated sprites -->
- <supportsRotation>no</supportsRotation>
-
- <!-- supports npot sizes -->
- <supportsNPOT>yes</supportsNPOT>
-
- <!-- supports file name stripping (remove .png etc.) -->
- <supportsTrimSpriteNames>yes</supportsTrimSpriteNames>
-
- <!-- supports texture subpath -->
- <supportsTextureSubPath>yes</supportsTextureSubPath>
-</exporter>
\ No newline at end of file