Cleanup for removal of ImageAttributes from public API 92/37592/6
authorAndrew Cox <andrew.cox@partner.samsung.com>
Tue, 31 Mar 2015 14:54:06 +0000 (15:54 +0100)
committerAndrew Cox <andrew.cox@partner.samsung.com>
Mon, 20 Apr 2015 11:50:27 +0000 (12:50 +0100)
Change-Id: I5bafc645c223b173abdd20db00094c501c846ee4
Signed-off-by: Andrew Cox <andrew.cox@partner.samsung.com>
14 files changed:
examples/animated-shapes/animated-shapes-example.cpp
examples/blocks/blocks-example.cpp
examples/bubble-effect/bubble-effect-example.cpp
examples/cluster/cluster-example.cpp
examples/cube-transition-effect/cube-transition-effect-example.cpp
examples/dissolve-effect/dissolve-effect-example.cpp
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
examples/motion-blur/motion-blur-example.cpp
examples/new-window/new-window-example.cpp
examples/path-animation/path-animation.cpp
examples/radial-menu/radial-menu-example.cpp
examples/refraction-effect/refraction-effect-example.cpp
examples/scroll-view/scroll-view-example.cpp
shared/view.h

index ba34cea..262f0b5 100644 (file)
@@ -60,8 +60,7 @@ public:
     stage.Add( mView );
 
     //Set background image for the view
-    ImageAttributes attributes;
-    Image image = ResourceImage::New( BACKGROUND_IMAGE, attributes );
+    Image image = ResourceImage::New( BACKGROUND_IMAGE );
 
 
     Dali::ImageActor backgroundImageActor = Dali::ImageActor::New( image );
index eb64275..db050fe 100644 (file)
@@ -524,10 +524,7 @@ private:
     Vector2 stageSize(Stage::GetCurrent().GetSize());
     const Vector2 brickSize(BRICK_SIZE * Vector2(stageSize.x, stageSize.x));
 
-    ImageAttributes attr;
-    attr.SetSize( 128, 64 );
-    attr.SetScalingMode( ImageAttributes::ScaleToFill );
-    Image img = ResourceImage::New(BRICK_IMAGE_PATH[type], attr);
+    Image img = ResourceImage::New( BRICK_IMAGE_PATH[type], Dali::ImageDimensions( 128, 64 ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
     ImageActor brick = ImageActor::New(img);
     brick.SetParentOrigin(ParentOrigin::TOP_LEFT);
     brick.SetAnchorPoint(AnchorPoint::CENTER);
index db2a52e..5f06194 100644 (file)
@@ -53,19 +53,15 @@ const unsigned int DEFAULT_NUMBER_OF_BUBBLES( 1000 );
 /**
  * @brief Load an image, scaled-down to no more than the stage dimensions.
  *
- * Uses image scaling mode ImageAttributes::ScaleToFill to resize the image at
+ * Uses image scaling mode FittingMode::SCALE_TO_FILL to resize the image at
  * load time to cover the entire stage with pixels with no borders,
- * and filter mode ImageAttributes::BoxThenLinear to sample the image with
+ * and filter mode BOX_THEN_LINEAR to sample the image with
  * maximum quality.
  */
 ResourceImage LoadStageFillingImage( const char * const imagePath )
 {
   Size stageSize = Stage::GetCurrent().GetSize();
-  ImageAttributes attributes;
-  attributes.SetSize( stageSize.x, stageSize.y );
-  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-  attributes.SetScalingMode( ImageAttributes::ScaleToFill );
-  return ResourceImage::New( imagePath, attributes );
+  return ResourceImage::New( imagePath, Dali::ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
 }
 
 }// end LOCAL_STUFF
index 59af760..d9c3610 100644 (file)
@@ -528,13 +528,9 @@ public:
     DALI_ASSERT_ALWAYS(paths);
 
     // Add a background image to the cluster, limiting the loaded size by
-    // fitting it inside a quarter of the stage area with the conservative Box
+    // fitting it inside a quarter of the stage area with the conservative BOX
     // filter mode:
-    Dali::ImageAttributes backgroundAttributes;
-    backgroundAttributes.SetSize( Stage::GetCurrent().GetSize() * 0.5f );
-    backgroundAttributes.SetFilterMode( Dali::ImageAttributes::Box );
-    backgroundAttributes.SetScalingMode( Dali::ImageAttributes::ShrinkToFit );
-    Image bg = ResourceImage::New( CLUSTER_BACKGROUND_IMAGE_PATH );
+    Image bg = ResourceImage::New( CLUSTER_BACKGROUND_IMAGE_PATH, Dali::ImageDimensions( stageSize.x * 0.5f, stageSize.y * 0.5f ), Dali::FittingMode::SHRINK_TO_FIT, Dali::SamplingMode::BOX );
     ImageActor image = ImageActor::New(bg);
     image.SetRelayoutEnabled( false );
     clusterActor.SetBackgroundImage(image);
@@ -563,14 +559,11 @@ public:
     actor.SetAnchorPoint( AnchorPoint::CENTER );
 
     // Load the thumbnail at quarter of screen width or standard size if that is smaller:
-    ImageAttributes attribs = ImageAttributes::New();
     Size stageQuarter = Stage::GetCurrent().GetSize() * 0.25f;
-    attribs.SetSize( std::min( stageQuarter.x, CLUSTER_IMAGE_THUMBNAIL_WIDTH), std::min( stageQuarter.y, CLUSTER_IMAGE_THUMBNAIL_HEIGHT ) );
-    attribs.SetFilterMode( Dali::ImageAttributes::BoxThenLinear );
-    attribs.SetScalingMode(Dali::ImageAttributes::ShrinkToFit );
+    const ImageDimensions requestedDims = ImageDimensions( std::min( stageQuarter.x, CLUSTER_IMAGE_THUMBNAIL_WIDTH ), std::min( stageQuarter.y, CLUSTER_IMAGE_THUMBNAIL_HEIGHT ) );
 
     // Add a shadow image child actor
-    Image shadowImage = ResourceImage::New( CLUSTER_SHADOW_IMAGE_PATH, attribs );
+    Image shadowImage = ResourceImage::New( CLUSTER_SHADOW_IMAGE_PATH, requestedDims, Dali::FittingMode::SHRINK_TO_FIT, Dali::SamplingMode::BOX );
     ImageActor shadowActor = ImageActor::New(shadowImage);
 
     // Shadow is not exactly located on the center of the image, so it is moved to a little
@@ -585,7 +578,7 @@ public:
     actor.Add( shadowActor );
 
     // Add a picture image actor to actor (with equal size to the parent).
-    Image image = ResourceImage::New( imagePath, attribs );
+    Image image = ResourceImage::New( imagePath, requestedDims, Dali::FittingMode::SHRINK_TO_FIT, Dali::SamplingMode::BOX );
     ImageActor imageActor = ImageActor::New( image );
     imageActor.SetParentOrigin( ParentOrigin::CENTER );
     imageActor.SetAnchorPoint( AnchorPoint::CENTER );
index 691fe06..0090720 100644 (file)
@@ -91,19 +91,15 @@ const int VIEWINGTIME = 2000; // 2 seconds
 /**
  * @brief Load an image, scaled-down to no more than the stage dimensions.
  *
- * Uses image scaling mode ImageAttributes::ScaleToFill to resize the image at
+ * Uses image scaling mode SCALE_TO_FILL to resize the image at
  * load time to cover the entire stage with pixels with no borders,
- * and filter mode ImageAttributes::BoxThenLinear to sample the image with
+ * and filter mode BOX_THEN_LINEAR to sample the image with
  * maximum quality.
  */
 ResourceImage LoadStageFillingImage( const char * const imagePath )
 {
   Size stageSize = Stage::GetCurrent().GetSize();
-  ImageAttributes attributes;
-  attributes.SetSize( stageSize.x, stageSize.y );
-  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-  attributes.SetScalingMode( ImageAttributes::ScaleToFill );
-  return ResourceImage::New( imagePath, attributes );
+  return ResourceImage::New( imagePath, ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
 }
 
 } // namespace
index 59da358..1ec0293 100644 (file)
@@ -77,19 +77,15 @@ const float INITIAL_DEPTH = -10.0f;
 /**
  * @brief Load an image, scaled-down to no more than the stage dimensions.
  *
- * Uses image scaling mode ImageAttributes::ScaleToFill to resize the image at
+ * Uses image scaling mode SCALE_TO_FILL to resize the image at
  * load time to cover the entire stage with pixels with no borders,
- * and filter mode ImageAttributes::BoxThenLinear to sample the image with
+ * and filter mode BOX_THEN_LINEAR to sample the image with
  * maximum quality.
  */
 ResourceImage LoadStageFillingImage( const char * const imagePath )
 {
   Size stageSize = Stage::GetCurrent().GetSize();
-  ImageAttributes attributes;
-  attributes.SetSize( stageSize.x, stageSize.y );
-  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-  attributes.SetScalingMode( ImageAttributes::ScaleToFill );
-  return ResourceImage::New( imagePath, attributes );
+  return ResourceImage::New( imagePath, ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
 }
 
 } // namespace
index 8fb6496..e3d7a51 100644 (file)
@@ -27,7 +27,7 @@
  * The functions CreateImage and CreateImageActor below show how to build an
  * image using a scaling mode to have %Dali resize it during loading.
  *
- * This demo defaults to the ScaleToFill mode of ImageAttributes which makes
+ * This demo defaults to the SCALE_TO_FILL mode of ImageAttributes which makes
  * sure that every pixel in the loaded image is filled with a source colour
  * from the image's central region while losing the minimum number of pixels
  * from its periphery.
@@ -77,7 +77,7 @@ const unsigned GRID_CELL_PADDING = 4;
 /** The aspect ratio of cells in the image grid. */
 const float CELL_ASPECT_RATIO = 1.33333333333333333333f;
 
-const ImageAttributes::ScalingMode DEFAULT_SCALING_MODE = ImageAttributes::ScaleToFill;
+const Dali::FittingMode::Type DEFAULT_SCALING_MODE = Dali::FittingMode::SCALE_TO_FILL;
 
 /** The number of times to spin an image on touching, each spin taking a second.*/
 const float SPIN_DURATION = 1.0f;
@@ -172,19 +172,15 @@ const unsigned NUM_IMAGE_PATHS = sizeof(IMAGE_PATHS) / sizeof(IMAGE_PATHS[0]) -
  * @param[in] filename The path of the image.
  * @param[in] width The width of the image in pixels.
  * @param[in] height The height of the image in pixels.
- * @param[in] scalingMode The mode to use when scaling the image to fit the desired dimensions.
+ * @param[in] fittingMode The mode to use when scaling the image to fit the desired dimensions.
  */
-Image CreateImage(const std::string& filename, unsigned int width, unsigned int height, ImageAttributes::ScalingMode scalingMode )
+Image CreateImage(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode )
 {
 #ifdef DEBUG_PRINT_DIAGNOSTICS
-    fprintf( stderr, "CreateImage(%s, %u, %u, scalingMode=%u)\n", filename.c_str(), width, height, unsigned( scalingMode ) );
+    fprintf( stderr, "CreateImage(%s, %u, %u, fittingMode=%u)\n", filename.c_str(), width, height, unsigned( fittingMode ) );
 #endif
-  ImageAttributes attributes;
+  Image image = ResourceImage::New( filename, ImageDimensions( width, height ), fittingMode, Dali::SamplingMode::BOX_THEN_LINEAR );
 
-  attributes.SetSize( width, height );
-  attributes.SetScalingMode( scalingMode );
-  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-  Image image = ResourceImage::New( filename, attributes );
   return image;
 }
 
@@ -194,11 +190,11 @@ Image CreateImage(const std::string& filename, unsigned int width, unsigned int
  * @param[in] filename The path of the image.
  * @param[in] width The width of the image in pixels.
  * @param[in] height The height of the image in pixels.
- * @param[in] scalingMode The mode to use when scaling the image to fit the desired dimensions.
+ * @param[in] fittingMode The mode to use when scaling the image to fit the desired dimensions.
  */
-ImageActor CreateImageActor(const std::string& filename, unsigned int width, unsigned int height, ImageAttributes::ScalingMode scalingMode )
+ImageActor CreateImageActor(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode )
 {
-  Image img = CreateImage( filename, width, height, scalingMode );
+  Image img = CreateImage( filename, width, height, fittingMode );
   ImageActor actor = ImageActor::New( img );
   actor.SetName( filename );
   actor.SetParentOrigin(ParentOrigin::CENTER);
@@ -208,22 +204,22 @@ ImageActor CreateImageActor(const std::string& filename, unsigned int width, uns
 }
 
 /** Cycle the scaling mode options. */
-ImageAttributes::ScalingMode NextMode( const ImageAttributes::ScalingMode oldMode )
+Dali::FittingMode::Type NextMode( const Dali::FittingMode::Type oldMode )
 {
-  ImageAttributes::ScalingMode newMode = ImageAttributes::ShrinkToFit;
+  Dali::FittingMode::Type newMode = FittingMode::SHRINK_TO_FIT;
   switch ( oldMode )
   {
-    case ImageAttributes::ShrinkToFit:
-      newMode = ImageAttributes::ScaleToFill;
+    case FittingMode::SHRINK_TO_FIT:
+      newMode = FittingMode::SCALE_TO_FILL;
       break;
-    case ImageAttributes::ScaleToFill:
-      newMode = ImageAttributes::FitWidth;
+    case FittingMode::SCALE_TO_FILL:
+      newMode = FittingMode::FIT_WIDTH;
       break;
-    case ImageAttributes::FitWidth:
-      newMode = ImageAttributes::FitHeight;
+    case FittingMode::FIT_WIDTH:
+      newMode = FittingMode::FIT_HEIGHT;
       break;
-    case ImageAttributes::FitHeight:
-      newMode = ImageAttributes::ShrinkToFit;
+    case FittingMode::FIT_HEIGHT:
+      newMode = FittingMode::SHRINK_TO_FIT;
       break;
   }
   return newMode;
@@ -273,7 +269,7 @@ public:
   : mApplication( application ),
     mScrolling( false )
   {
-    std::cout << "ImageScalingScaleToFillController::ImageScalingScaleToFillController" << std::endl;
+    std::cout << "ImageScalingIrregularGridController::ImageScalingIrregularGridController" << std::endl;
 
     // Connect to the Application's Init signal
     mApplication.InitSignal().Connect( this, &ImageScalingIrregularGridController::Create );
@@ -289,7 +285,7 @@ public:
    */
   void Create( Application& application )
   {
-    std::cout << "ImageScalingScaleToFillController::Create" << std::endl;
+    std::cout << "ImageScalingIrregularGridController::Create" << std::endl;
 
     DemoHelper::RequestThemeChange();
 
@@ -326,13 +322,13 @@ public:
   /**
    * Build the main part of the application's view.
    */
-  void PopulateContentLayer( const ImageAttributes::ScalingMode scalingMode )
+  void PopulateContentLayer( const Dali::FittingMode::Type fittingMode )
   {
     Stage stage = Stage::GetCurrent();
     Vector2 stageSize = stage.GetSize();
 
     float fieldHeight;
-    Actor imageField = BuildImageField( stageSize.x, GRID_WIDTH, GRID_MAX_HEIGHT, scalingMode, fieldHeight );
+    Actor imageField = BuildImageField( stageSize.x, GRID_WIDTH, GRID_MAX_HEIGHT, fittingMode, fieldHeight );
 
     mScrollView = ScrollView::New();
 
@@ -375,7 +371,7 @@ public:
   Actor BuildImageField( const float fieldWidth,
                            const unsigned gridWidth,
                            const unsigned maxGridHeight,
-                           ImageAttributes::ScalingMode scalingMode,
+                           Dali::FittingMode::Type fittingMode,
                            float & outFieldHeight )
   {
     // Generate the list of image configurations to be fitted into the field:
@@ -443,11 +439,11 @@ public:
       const Vector2 imageRegionCorner = gridOrigin + cellSize * Vector2( imageSource.cellX, imageSource.cellY );
       const Vector2 imagePosition = imageRegionCorner + Vector2( GRID_CELL_PADDING , GRID_CELL_PADDING ) + imageSize * 0.5f;
 
-      ImageActor image = CreateImageActor( imageSource.configuration.path, imageSize.x, imageSize.y, scalingMode );
+      ImageActor image = CreateImageActor( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode );
       image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) );
       image.SetSize( imageSize );
       image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
-      mScalingModes[image.GetId()] = scalingMode;
+      mFittingModes[image.GetId()] = fittingMode;
       mSizes[image.GetId()] = imageSize;
 
       gridActor.Add( image );
@@ -475,14 +471,14 @@ public:
 
         // Change the scaling mode:
         const unsigned id = actor.GetId();
-        ImageAttributes::ScalingMode newMode = NextMode( mScalingModes[id] );
+        Dali::FittingMode::Type newMode = NextMode( mFittingModes[id] );
         const Vector2 imageSize = mSizes[actor.GetId()];
 
         ImageActor imageActor = ImageActor::DownCast( actor );
         Image oldImage = imageActor.GetImage();
         Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode );
         imageActor.SetImage( newImage );
-        mScalingModes[id] = newMode;
+        mFittingModes[id] = newMode;
       }
     }
     return false;
@@ -520,14 +516,14 @@ public:
       {
         // Cycle the scaling mode options:
         const Vector2 imageSize = mSizes[gridImageActor.GetId()];
-        ImageAttributes::ScalingMode newMode = NextMode( mScalingModes[gridImageActor.GetId()] );
+        Dali::FittingMode::Type newMode = NextMode( mFittingModes[gridImageActor.GetId()] );
         Image oldImage = gridImageActor.GetImage();
         Image newImage = CreateImage(ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width, imageSize.height, newMode );
         gridImageActor.SetImage( newImage );
 
-        mScalingModes[gridImageActor.GetId()] = newMode;
+        mFittingModes[gridImageActor.GetId()] = newMode;
 
-        SetTitle( std::string( newMode == ImageAttributes::ShrinkToFit ? "ShrinkToFit" : newMode == ImageAttributes::ScaleToFill ?  "ScaleToFill" : newMode == ImageAttributes::FitWidth ? "FitWidth" : "FitHeight" ) );
+        SetTitle( std::string( newMode == FittingMode::SHRINK_TO_FIT ? "SHRINK_TO_FIT" : newMode == FittingMode::SCALE_TO_FILL ?  "SCALE_TO_FILL" : newMode == FittingMode::FIT_WIDTH ? "FIT_WIDTH" : "FIT_HEIGHT" ) );
       }
     }
     return true;
@@ -579,7 +575,7 @@ private:
   Actor mGridActor;                   ///< The container for the grid of images
   ScrollView mScrollView;             ///< ScrollView UI Component
   bool mScrolling;                    ///< ScrollView scrolling state (true = scrolling, false = stationary)
-  std::map<unsigned, ImageAttributes::ScalingMode> mScalingModes; ///< Stores the current scaling mode of each image, keyed by image actor id.
+  std::map<unsigned, Dali::FittingMode::Type> mFittingModes; ///< Stores the current scaling mode of each image, keyed by image actor id.
   std::map<unsigned, Vector2> mSizes; ///< Stores the current size of each image, keyed by image actor id.
 };
 
index 317ac70..c35f474 100644 (file)
@@ -92,18 +92,14 @@ const float ORIENTATION_DURATION = 0.5f;                  ///< Time to rotate to
 /**
  * @brief Load an image, scaled-down to no more than the dimensions passed in.
  *
- * Uses ImageAttributes::ShrinkToFit which ensures the resulting image is
+ * Uses SHRINK_TO_FIT which ensures the resulting image is
  * smaller than or equal to the specified dimensions while preserving its
  * original aspect ratio.
  */
 ResourceImage LoadImageFittedInBox( const char * const imagePath, uint32_t maxWidth, uint32_t maxHeight )
 {
   // Load the image nicely scaled-down to fit within the specified max width and height:
-  ImageAttributes attributes;
-  attributes.SetSize( maxWidth, maxHeight);
-  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-  attributes.SetScalingMode( ImageAttributes::ShrinkToFit );
-  return ResourceImage::New( imagePath, attributes );
+  return ResourceImage::New( imagePath, ImageDimensions( maxWidth, maxHeight ), FittingMode::SHRINK_TO_FIT, Dali::SamplingMode::BOX_THEN_LINEAR );
 }
 
 } // unnamed namespace
index fe1fa9f..1f918f0 100644 (file)
@@ -222,8 +222,9 @@ FrameBufferImage NewWindowController::CreateMirrorImage(const char* imageName)
 ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName)
 {
   FrameBufferImage fbo;
-  Image image = ResourceImage::New( imageName );
-  Vector2 FBOSize = ResourceImage::GetImageSize(imageName);
+  Image image = ResourceImage::New(imageName);
+  Uint16Pair intFboSize = ResourceImage::GetImageSize(imageName);
+  Vector2 FBOSize = Vector2( intFboSize.GetWidth(), intFboSize.GetHeight() );
   fbo = FrameBufferImage::New( FBOSize.width, FBOSize.height, Pixel::RGBA8888);
   GaussianBlurView gbv = GaussianBlurView::New(5, 2.0f, Pixel::RGBA8888, 0.5f, 0.5f, true);
   gbv.SetBackgroundColor(Color::TRANSPARENT);
@@ -241,7 +242,8 @@ ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName)
 FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect)
 {
   Stage stage = Stage::GetCurrent();
-  Vector2 FBOSize = ResourceImage::GetImageSize(imageName);
+  Uint16Pair intFboSize = ResourceImage::GetImageSize(imageName);
+  Vector2 FBOSize = Vector2(intFboSize.GetWidth(), intFboSize.GetHeight());
 
   FrameBufferImage framebuffer = FrameBufferImage::New(FBOSize.x, FBOSize.y );
 
index 18c5140..af86c93 100644 (file)
@@ -470,8 +470,7 @@ public:
     DrawPath( 200u );
 
     //Actor
-    ImageAttributes attributes;
-    Image img = ResourceImage::New(ACTOR_IMAGE, attributes );
+    Image img = ResourceImage::New(ACTOR_IMAGE);
     mActor = ImageActor::New( img );
     mActor.SetRelayoutEnabled( false );
     mActor.SetAnchorPoint( AnchorPoint::CENTER );
index ac735bf..278dddc 100644 (file)
@@ -149,7 +149,9 @@ void RadialMenuExample::OnInit(Application& app)
                       Toolkit::Alignment::HorizontalRight,
                       DemoHelper::DEFAULT_PLAY_PADDING );
 
-  Vector2 imgSize = ResourceImage::GetImageSize(TEST_OUTER_RING_FILENAME);
+
+  const Uint16Pair intImgSize = ResourceImage::GetImageSize(TEST_OUTER_RING_FILENAME);
+  Vector2 imgSize = Vector2( intImgSize.GetWidth(), intImgSize.GetHeight() );
   Vector2 stageSize = stage.GetSize();
   float minStageDimension = std::min(stageSize.width, stageSize.height);
 
@@ -248,8 +250,8 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName,
   mImageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
   // Create the stencil
-  Vector2 imageSize = ResourceImage::GetImageSize(imageName);
-  float diameter = std::max(imageSize.width, imageSize.height);
+  const Uint16Pair imageSize = ResourceImage::GetImageSize(imageName);
+  float diameter = std::max(imageSize.GetWidth(), imageSize.GetHeight());
   RadialSweepView radialSweepView = RadialSweepView::New();
   radialSweepView.SetDiameter( diameter );
   radialSweepView.SetInitialAngle( initialAngle );
index cf43e1f..dfcf9d8 100644 (file)
@@ -71,19 +71,14 @@ struct LightOffsetConstraint
 /**
  * @brief Load an image, scaled-down to no more than the stage dimensions.
  *
- * Uses image scaling mode ImageAttributes::ScaleToFill to resize the image at
+ * Uses image scaling mode SCALE_TO_FILL to resize the image at
  * load time to cover the entire stage with pixels with no borders,
- * and filter mode ImageAttributes::BoxThenLinear to sample the image with
- * maximum quality.
+ * and filter mode BOX_THEN_LINEAR to sample the image with maximum quality.
  */
 ResourceImage LoadStageFillingImage( const char * const imagePath )
 {
   Size stageSize = Stage::GetCurrent().GetSize();
-  ImageAttributes attributes;
-  attributes.SetSize( stageSize.x, stageSize.y );
-  attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-  attributes.SetScalingMode( ImageAttributes::ScaleToFill );
-  return ResourceImage::New( imagePath, attributes );
+  return ResourceImage::New( imagePath, ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
 }
 
 } // namespace
index 4fa6c22..aa6f0d6 100644 (file)
@@ -564,12 +564,8 @@ private:
    */
   ImageActor CreateImage( const std::string& filename, unsigned int width = IMAGE_THUMBNAIL_WIDTH, unsigned int height = IMAGE_THUMBNAIL_HEIGHT )
   {
-    ImageAttributes attributes;
+    Image img = ResourceImage::New(filename, ImageDimensions( width, height ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
 
-    attributes.SetSize(width, height);
-    attributes.SetScalingMode(ImageAttributes::ScaleToFill);
-    attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
-    Image img = ResourceImage::New(filename, attributes);
     ImageActor actor = ImageActor::New(img);
     actor.SetRelayoutEnabled( false );
     actor.SetName( filename );
index f5fa893..915dbd5 100644 (file)
@@ -139,11 +139,7 @@ Dali::Layer CreateView( Dali::Application& application,
   // Set background image, loading it at screen resolution:
   if ( !backgroundImagePath.empty() )
   {
-    Dali::ImageAttributes backgroundAttributes;
-    backgroundAttributes.SetSize( stage.GetSize() );
-    backgroundAttributes.SetFilterMode( Dali::ImageAttributes::BoxThenLinear );
-    backgroundAttributes.SetScalingMode( Dali::ImageAttributes::ScaleToFill );
-    Dali::Image backgroundImage = Dali::ResourceImage::New( backgroundImagePath, backgroundAttributes );
+    Dali::Image backgroundImage = Dali::ResourceImage::New( backgroundImagePath, Dali::ImageDimensions( stage.GetSize().x, stage.GetSize().y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
     Dali::ImageActor backgroundImageActor = Dali::ImageActor::New( backgroundImage );
     view.SetBackground( backgroundImageActor );
   }