From: Tom Robinson Date: Thu, 26 Nov 2015 17:23:09 +0000 (+0000) Subject: Implement image fitting modes X-Git-Tag: dali_1.1.14~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=872f3e4c7aec913d4a03bec729bd428ff0ab2bc6;p=platform%2Fcore%2Fuifw%2Fdali-core.git Implement image fitting modes Change-Id: I5153fdbe4538090c471771d57e170f21dcf3543e --- diff --git a/automated-tests/src/dali/utc-Dali-Uint16Pair.cpp b/automated-tests/src/dali/utc-Dali-Uint16Pair.cpp index e30e5cdd3..ef2400b9b 100644 --- a/automated-tests/src/dali/utc-Dali-Uint16Pair.cpp +++ b/automated-tests/src/dali/utc-Dali-Uint16Pair.cpp @@ -108,6 +108,54 @@ int UtcDaliUint16PairGetYP(void) END_TEST; } +int UtcDaliUint16PairSetXP(void) +{ + Dali::TestApplication testApp; + + Uint16Pair v( 5, 5 ); + DALI_TEST_EQUALS( v.GetX(), 5u, TEST_LOCATION ); + v.SetX( 10 ); + DALI_TEST_EQUALS( v.GetX(), 10u, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliUint16PairSetWidthP(void) +{ + Dali::TestApplication testApp; + + Uint16Pair v( 5, 5 ); + DALI_TEST_EQUALS( v.GetWidth(), 5u, TEST_LOCATION ); + v.SetWidth( 10 ); + DALI_TEST_EQUALS( v.GetWidth(), 10u, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliUint16PairSetYP(void) +{ + Dali::TestApplication testApp; + + Uint16Pair v( 5, 5 ); + DALI_TEST_EQUALS( v.GetY(), 5u, TEST_LOCATION ); + v.SetY( 10 ); + DALI_TEST_EQUALS( v.GetY(), 10u, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliUint16PairSetHeightP(void) +{ + Dali::TestApplication testApp; + + Uint16Pair v( 5, 5 ); + DALI_TEST_EQUALS( v.GetHeight(), 5u, TEST_LOCATION ); + v.SetHeight( 10 ); + DALI_TEST_EQUALS( v.GetHeight(), 10u, TEST_LOCATION ); + + END_TEST; +} + int UtcDaliUint16PairEqualsP(void) { Dali::TestApplication testApp; diff --git a/dali/public-api/math/uint-16-pair.h b/dali/public-api/math/uint-16-pair.h index c2a482057..2bf34cbff 100644 --- a/dali/public-api/math/uint-16-pair.h +++ b/dali/public-api/math/uint-16-pair.h @@ -38,7 +38,6 @@ namespace Dali * Use this for integer dimensions and points with limited range such as image * sizes and pixel coordinates where a pair of floating point numbers is * inefficient and illogical (i.e. the data is inherently integer). - * These are immutable. If you want to change a value, make a whole new object. * One of these can be passed in a single 32 bit integer register on * common architectures. */ @@ -46,14 +45,14 @@ class Uint16Pair { public: /** - * @brief Default constructor for the (0, 0) vector. + * @brief Default constructor for the (0, 0) tuple. */ Uint16Pair() : mData(0) {} /** * @brief Constructor taking separate x and y (width and height) parameters. - * @param[in] width The width or X dimension of the vector. Make sure it is less than 65536, - * @param[in] height The height or Y dimension of the vector. Make sure it is less than 65536, + * @param[in] width The width or X dimension of the tuple. Make sure it is less than 65536, + * @param[in] height The height or Y dimension of the tuple. Make sure it is less than 65536, */ Uint16Pair( uint32_t width, uint32_t height ) { @@ -78,8 +77,9 @@ public: } /** - * @brief Sets the width - * @param width to set + * @brief Sets the width. + * @since DALi version 1.1.13 + * @param[in] width The x dimension to be stored in this 2-tuple. */ void SetWidth( uint16_t width ) { @@ -95,13 +95,15 @@ public: } /** - * @brief Sets the height - * @param height to set + * @brief Sets the height. + * @since DALi version 1.1.13 + * @param[in] height The y dimension to be stored in this 2-tuple. */ void SetHeight( uint16_t height ) { mComponents[1] = height; } + /** * @returns the y dimension stored in this 2-tuple. */ @@ -110,6 +112,16 @@ public: return mComponents[1]; } + /** + * @brief Sets the x dimension (same as width). + * @since DALi version 1.1.14 + * @param[in] x The x dimension to be stored in this 2-tuple. + */ + void SetX( uint16_t x ) + { + mComponents[0] = x; + } + /** * @returns the x dimension stored in this 2-tuple. */ @@ -118,6 +130,16 @@ public: return mComponents[0]; } + /** + * @brief Sets the y dimension (same as height). + * @since DALi version 1.1.14 + * @param[in] y The y dimension to be stored in this 2-tuple. + */ + void SetY( uint16_t y ) + { + mComponents[1] = y; + } + /** * @returns the y dimension stored in this 2-tuple. */