int UtcDaliImageActorPixelArea(void) { TestApplication application; tet_infoline("Positive test for Dali::ImageActor::UtcDaliImageActorPixelArea"); BitmapImage img = BitmapImage::New( 10, 10 ); ImageActor actor = ImageActor::New( img ); DALI_TEST_CHECK( actor.IsPixelAreaSet() == false ); ImageActor::PixelArea area( 1, 2, 3, 4 ); actor.SetPixelArea( area ); DALI_TEST_CHECK( actor.IsPixelAreaSet() == true ); DALI_TEST_EQUALS( 1, actor.GetPixelArea().x, TEST_LOCATION ); DALI_TEST_EQUALS( 2, actor.GetPixelArea().y, TEST_LOCATION ); DALI_TEST_EQUALS( 3, actor.GetPixelArea().width, TEST_LOCATION ); DALI_TEST_EQUALS( 4, actor.GetPixelArea().height, TEST_LOCATION ); ImageActor actor2 = ImageActor::New( img, ImageActor::PixelArea( 5, 6, 7, 8 ) ); DALI_TEST_CHECK( actor2.IsPixelAreaSet() == true ); DALI_TEST_EQUALS( 5, actor2.GetPixelArea().x, TEST_LOCATION ); DALI_TEST_EQUALS( 6, actor2.GetPixelArea().y, TEST_LOCATION ); DALI_TEST_EQUALS( 7, actor2.GetPixelArea().width, TEST_LOCATION ); DALI_TEST_EQUALS( 8, actor2.GetPixelArea().height, TEST_LOCATION ); END_TEST; }
int UtcDaliImageActorClearPixelArea(void) { TestApplication application; BitmapImage img = BitmapImage::New( 10, 10 ); ImageActor actor = ImageActor::New( img ); DALI_TEST_CHECK( actor.IsPixelAreaSet() == false ); ImageActor::PixelArea area( 1, 2, 3, 4 ); actor.SetPixelArea( area ); DALI_TEST_CHECK( actor.IsPixelAreaSet() == true ); actor.ClearPixelArea(); DALI_TEST_CHECK( actor.IsPixelAreaSet() == false ); END_TEST; }