X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fimage-loader%2Fimage-atlas.h;h=a0305fd1b9e8561eadc33953856bc261aee75b29;hb=0a6c26e72fc8d2ad52837311b7e9069c12eec4be;hp=c85194f2e9537750908634208ca5c8eaf91dca80;hpb=41307f75478fd6c6fb5f9ae7e7de5036647f39b3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/image-loader/image-atlas.h b/dali-toolkit/devel-api/image-loader/image-atlas.h index c85194f..a0305fd 100644 --- a/dali-toolkit/devel-api/image-loader/image-atlas.h +++ b/dali-toolkit/devel-api/image-loader/image-atlas.h @@ -20,17 +20,22 @@ // EXTERNAL INCLUDES #include #include +#include #include #include #include #include #include +// INTERNAL INCLUDES +#include + namespace Dali { namespace Toolkit { + namespace Internal DALI_INTERNAL { class ImageAtlas; @@ -51,6 +56,14 @@ public: public: /** + * @brief Pack a group of pixel data into atlas. + * @param[in] pixelData The group of the pixel data to be packed into the atlas. + * @param[out] textureRects The list of texture areas where each frame is located inside the atlas. + * @return The atlas texture. + */ + static Texture PackToAtlas( const std::vector& pixelData, Dali::Vector& textureRects ); + + /** * @brief Create a new ImageAtlas. * * @param [in] width The atlas width in pixels. @@ -114,7 +127,7 @@ public: /** * @brief Upload a resource image to the atlas. * - * @note To make the atlasing efficient, an valid size should be provided. + * @note To make the atlasing efficient, a valid size should be provided. * If size is not provided, then the image file will be opened to read the actual size for loading. * Do not set a size that is bigger than the actual image size, as the up-scaling is not available, * the content of the area not covered by actual image is undefined, it will not be cleared. @@ -135,6 +148,32 @@ public: bool orientationCorrection = true ); /** + * @brief Upload a resource image to the atlas. + * + * @note To make the atlasing efficient, a valid size should be provided. + * If size is not provided, then the image file will be opened to read the actual size for loading. + * Do not set a size that is bigger than the actual image size, as the up-scaling is not available, + * the content of the area not covered by actual image is undefined, it will not be cleared. + * + * SamplingMode::BOX_THEN_LINEAR is used to sampling pixels from the input image while fitting it to desired size. + * + * @param [out] textureRect The texture area of the resource image in the atlas. + * @param [in] url The URL of the resource image file to use. + * @param [in] size The width and height to fit the loaded image to. + * @param [in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter. + * @param [in] orientationCorrection Reorient the image to respect any orientation metadata in its header. + * @param[in] atlasUploadObserver The observer to observe the upload state inside the ImageAtlas. + * @return True if there is enough space to fit this image in,false otherwise. + * @note The valid callback function here is required to have the signature of void( void ). + */ + bool Upload( Vector4& textureRect, + const std::string& url, + ImageDimensions size, + FittingMode::Type fittingMode, + bool orientationCorrection, + AtlasUploadObserver* atlasUploadObserver ); + + /** * @brief Upload a pixel buffer to atlas * * @param [out] textureRect The texture area of the resource image in the atlas.