X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fimages%2Fimage-operations.h;h=8642976cfd4d91b1d207b78aca5a1a09e0e5fab0;hb=HEAD;hp=9673cafcc76575a81e30ca322de2f4524ab968df;hpb=55602e7fde8b3c1a1be39b841a4607afc4d35968;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/images/image-operations.h b/dali/public-api/images/image-operations.h index 9673caf..8642976 100644 --- a/dali/public-api/images/image-operations.h +++ b/dali/public-api/images/image-operations.h @@ -1,8 +1,8 @@ -#ifndef __DALI_IMAGE_OPERATIONS_H__ -#define __DALI_IMAGE_OPERATIONS_H__ +#ifndef DALI_IMAGE_OPERATIONS_H +#define DALI_IMAGE_OPERATIONS_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -25,14 +25,19 @@ namespace Dali { +/** + * @addtogroup dali_core_images + * @{ + */ /** * @brief The integer dimensions of an image or a region of an image packed into * 16 bits per component. * * This can only be used for images of up to 65535 x 65535 pixels. + * @SINCE_1_0.0 */ -typedef Uint16Pair ImageDimensions; +using ImageDimensions = Dali::Uint16Pair; /** * @brief Fitting options, used when resizing images to fit desired dimensions. @@ -40,25 +45,37 @@ typedef Uint16Pair ImageDimensions; * A fitting mode controls the region of a loaded image to be mapped to the * desired image rectangle. * All fitting modes preserve the aspect ratio of the image contents. + * @SINCE_1_0.0 */ namespace FittingMode { - enum Type - { - SHRINK_TO_FIT, ///< Fit full image inside desired width & height, potentially not - /// filling one of either the desired image width or height with - /// pixels. - SCALE_TO_FILL, ///< Image fills whole desired width & height with image data. The - /// image is centred in the desired dimensions, exactly touching - /// in one dimension, with image regions outside the other desired - /// dimension cropped away. - FIT_WIDTH, ///< Image fills whole width. Height is scaled proportionately to - /// maintain aspect ratio. - FIT_HEIGHT ///< Image fills whole height. Width is scaled proportionately to - /// maintain aspect ratio. - }; - const Type DEFAULT = SHRINK_TO_FIT; -} +/** + * @brief Enumeration for FittingMode type. + * @SINCE_1_0.0 + */ +enum Type +{ + SHRINK_TO_FIT, ///< Fit full image inside desired width & height, potentially not + /// filling one of either the desired image width or height with + /// pixels. + /// @SINCE_1_0.0 + SCALE_TO_FILL, ///< Image fills whole desired width & height with image data. The + /// image is centred in the desired dimensions, exactly touching + /// in one dimension, with image regions outside the other desired + /// dimension cropped away. + /// @SINCE_1_0.0 + FIT_WIDTH, ///< Image fills whole width. Height is scaled proportionately to + /// maintain aspect ratio. + /// @SINCE_1_0.0 + FIT_HEIGHT, ///< Image fills whole height. Width is scaled proportionately to + /// maintain aspect ratio. + /// @SINCE_1_0.0 + VISUAL_FITTING /// < Image is scaled to fit within the desired dimensions. + /// maintain aspect ratio. + /// @SINCE_2_3.24 +}; +const Type DEFAULT = SHRINK_TO_FIT; +} // namespace FittingMode /** * @brief Filtering options, used when resizing images to sample original pixels. @@ -70,33 +87,48 @@ namespace FittingMode * exactly matches the rectangle specified by the desired dimensions and * FittingMode, but all other filter modes do if the desired dimensions are * `<=` the raw dimensions of the input image file. + * @SINCE_1_0.0 */ namespace SamplingMode { - enum Type - { - BOX, ///< Iteratively box filter to generate an image of 1/2, 1/4, - /// 1/8, etc width and height and approximately the desired - /// size. This is the default. - NEAREST, ///< For each output pixel, read one input pixel. - LINEAR, ///< For each output pixel, read a quad of four input pixels - /// and write a weighted average of them. - BOX_THEN_NEAREST, ///< Iteratively box filter to generate an image of 1/2, 1/4, - /// 1/8 etc width and height and approximately the desired - /// size, then for each output pixel, read one pixel from the - /// last level of box filtering. - BOX_THEN_LINEAR, ///< Iteratively box filter to almost the right size, then for - /// each output pixel, read four pixels from the last level of - /// box filtering and write their weighted average. - NO_FILTER, ///< No filtering is performed. If the SCALE_TO_FILL scaling mode - /// is enabled, the borders of the image may be trimmed to - /// match the aspect ratio of the desired dimensions. - DONT_CARE ///< For caching algorithms where a client strongly prefers a - /// cache-hit to reuse a cached image. - }; - const Type DEFAULT = BOX; -} +/** + * @brief Enumeration for SamplingMode type. + * @SINCE_1_0.0 + */ +enum Type +{ + BOX, ///< Iteratively box filter to generate an image of 1/2, 1/4, + /// 1/8, etc width and height and approximately the desired + /// size. This is the default. + /// @SINCE_1_0.0 + NEAREST, ///< For each output pixel, read one input pixel. + /// @SINCE_1_0.0 + LINEAR, ///< For each output pixel, read a quad of four input pixels + /// and write a weighted average of them. + /// @SINCE_1_0.0 + BOX_THEN_NEAREST, ///< Iteratively box filter to generate an image of 1/2, 1/4, + /// 1/8 etc width and height and approximately the desired + /// size, then for each output pixel, read one pixel from the + /// last level of box filtering. + /// @SINCE_1_0.0 + BOX_THEN_LINEAR, ///< Iteratively box filter to almost the right size, then for + /// each output pixel, read four pixels from the last level of + /// box filtering and write their weighted average. + /// @SINCE_1_0.0 + NO_FILTER, ///< No filtering is performed. If the SCALE_TO_FILL scaling mode + /// is enabled, the borders of the image may be trimmed to + /// match the aspect ratio of the desired dimensions. + /// @SINCE_1_0.0 + DONT_CARE ///< For caching algorithms where a client strongly prefers a + /// cache-hit to reuse a cached image. + /// @SINCE_1_0.0 +}; +const Type DEFAULT = BOX; +} // namespace SamplingMode +/** + * @} + */ } // namespace Dali -#endif // __DALI_IMAGE_OPERATIONS_H__ +#endif // DALI_IMAGE_OPERATIONS_H