696a93de43d626e866663d7e05b0302a8b797355
[apps/native/home/homescreen.git] / util / util-color-image.cpp
1 /*
2  * util-graphic.cpp
3  *
4  * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #include "util-color-image.h"
21 using namespace ClusterHome3D ;
22 namespace ClusterHome3D
23 {
24         Dali::Toolkit::ImageView CreateSolidColorActor( const Vector4& color, bool border, const Vector4& borderColor, const unsigned int borderSize )
25         {
26                 
27                 Toolkit::ImageView imageView = Toolkit::ImageView::New();
28                 Property::Map solidColorProperty;
29                 solidColorProperty.Insert( "renderer-type", "color-renderer" );
30                 solidColorProperty.Insert( "blend-color",color);
31                 imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, solidColorProperty );
32                 return imageView;
33         }
34         Dali::Toolkit::ImageView CreateTestSolidColorActor()
35         {
36                 Toolkit::ImageView imageView = Toolkit::ImageView::New();
37                 imageView.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
38                 imageView.SetAnchorPoint(AnchorPoint::CENTER);
39                 imageView.SetParentOrigin(ParentOrigin::CENTER);
40                 imageView.SetPosition(0.0f, 0.0f, 0.5f);
41                 Property::Map solidColorProperty;
42                 solidColorProperty.Insert( "renderer-type", "color-renderer" );
43                 solidColorProperty.Insert( "blend-color",Vector4((float)(rand()%10)/10, (float)(rand()%10)/10, (float)(rand()%10)/10, 0.5f));
44                 imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, solidColorProperty );
45                 return imageView;
46         }
47 }
48