X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpage-turn-view%2Fpage-turn-effect.h;h=fba77c5bf9a8bcfab5328b6f878c7556bee3207a;hp=59a4603f9cfe6547afea129fbbc96dea814edf58;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=70337c87eb5b0d5678117b6ab7e41099b62614e1 diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h b/dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h index 59a4603..fba77c5 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h @@ -1,8 +1,8 @@ -#ifndef __DALI_PAGE_TURN_EFFECT_H_ -#define __DALI_PAGE_TURN_EFFECT_H_ +#ifndef DALI_PAGE_TURN_EFFECT_H +#define DALI_PAGE_TURN_EFFECT_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,6 @@ */ // EXTERNAL INCLUDES -#include -#include -#include -#include -#include namespace Dali { @@ -37,50 +32,51 @@ namespace Internal /** * @brief Re-applies PageTurnEffect internal constraints - * The internal constraint uses the OriginalCenter property and the CurrentCenter Property + * The internal constraint uses the OriginalCenter property and the CURRENT_CENTER Property * to update the variety of common parameters which are with the same value for all the vertices. * Note: For each actor, the constraints are applied in the same order as the calls to Actor::ApplyConstraint(). - * So if there are other contraints applied to the OriginalCenter or CurrentCenter while when using this effect, + * So if there are other contraints applied to the ORIGINAL_CENTER or CURRENT_CENTER while when using this effect, * call this method to get the internal constraints and re-apply it afterwards. * - * @param[in] shaderEffect The page turn effect to which internal constraints should be re-applied + * @param[in] actor The page turn actor to which internal constraints should be re-applied + * @param[in] pageHeight The page height. */ -void PageTurnApplyInternalConstraint( ShaderEffect& shaderEffect); +void PageTurnApplyInternalConstraint( Actor& actor, float pageHeight ); /** * @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:- * * // create shader used for doing page-turn effect\n - * ShaderEffect pageTurnEffect = CreatePageTurnEffect(); + * Property::Map pageTurnEffect = CreatePageTurnEffect(); * - * // set image actor 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 - * ImageActor pageActor = ImageActor::New(....); \n - * ImageActor backImageActor = ImageActor::New(....); \n - * pageActor.Add(backPageActor);\n - * pageActor.SetShaderEffect ( pageTurnEffect ); \n + * // set image view custom shader to the page-turn one\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 * * //set initial values - * pageTurnEffect.SetUniform("uPageSize", Vector2);\n - * pageTurnEffect.SetUniform("uOriginalCenter", Vector2);\n - * pageTurnEffect.SetUniform("uIsTurningBack", bool);\n - * pageTurnEffect.SetUniform("uCurrentCenter",Vector2);\n + * page.SetProperty( page.GetPropertyIndex("uIsTurningBack",) bool );\n + * page.SetProperty( page.GetPropertyIndex("uSpineShadowParameter",) Vector2 );\n + * page.SetProperty( page.GetPropertyIndex("ORIGINAL_CENTER"), Vector2 );\n + * page.SetProperty( page.GetPropertyIndex("CURRENT_CENTER"), Vector2 );\n + * page.SetProperty( page.GetPropertyIndex("uCommonParameters"), Matrix );\n + * page.SetProperty( page.GetPropertyIndex("uTextureWidth"), float ); // Set to 1.0 for single-sided or 2.0 for double-sided \n + * PageTurnApplyInternalConstraint( page );\n * * //Animate it with the current center property\n - * Animation animation[mAnimationIndex] = Animation::New( ... );\n - * animation.AnimateTo(Property( pageTurnEffect, "uCurrentCenter" ), - * currentCenter, - * AlphaFunction::...);\n - * animation[mAnimationIndex].Play(); \n + * Animation animation = Animation::New( ... );\n + * animation.AnimateTo(Property( page, "CURRENT_CENTER" ), + * currentCenter, + * AlphaFunction::...);\n + * animation.Play(); \n * - * Animatable/Constrainable uniforms: */ -ShaderEffect CreatePageTurnEffect(); +Property::Map CreatePageTurnEffect(); } // namespace Internal @@ -88,4 +84,4 @@ ShaderEffect CreatePageTurnEffect(); } // namespace Dali -#endif /* __DALI_TOOLKIT_SC_CURVE_EFFECT_H_ */ +#endif // DALI_PAGE_TURN_EFFECT_H