X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fimage-loading.h;h=c920c0c1aa76167de922718c354efa3a78b6b8e7;hb=HEAD;hp=a66028d30bafa62f161dd4717a59f9658a2964cf;hpb=d9d257d7707ecaaa1915365ed29fe27654280a01;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/image-loading.h b/dali/devel-api/adaptor-framework/image-loading.h index a66028d..c920c0c 100644 --- a/dali/devel-api/adaptor-framework/image-loading.h +++ b/dali/devel-api/adaptor-framework/image-loading.h @@ -2,7 +2,7 @@ #define DALI_IMAGE_LOADING_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -19,6 +19,7 @@ // EXTERNAL INCLUDES #include +#include #include #include @@ -47,6 +48,69 @@ DALI_ADAPTOR_API Devel::PixelBuffer LoadImageFromFile( bool orientationCorrection = true); /** + * @brief Load an image and save each plane to a separate buffer synchronously from local file. + * + * @note This method is thread safe, i.e. can be called from any thread. + * If the image file doesn't support to load planes, this method returns a bitmap image instead. + * + * @param [in] url The URL of the image file to load. + * @param [out] buffers The loaded PixelBuffer object list or an empty list in case loading failed. + * @param [in] size The width and height to fit the loaded image to, 0.0 means whole image + * @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] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size. + * @param [in] orientationCorrection Reorient the image to respect any orientation metadata in its header. + */ +DALI_ADAPTOR_API void LoadImagePlanesFromFile( + const std::string& url, + std::vector& buffers, + ImageDimensions size = ImageDimensions(0, 0), + FittingMode::Type fittingMode = FittingMode::DEFAULT, + SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR, + bool orientationCorrection = true); + +/** + * @brief Load an image synchronously from encoded buffer. + * + * @note This method is thread safe, i.e. can be called from any thread. + * + * @param [in] buffer The encoded buffer of the image to load. + * The buffer is not owned by FileStream and must be valid for entire lifetime of FileStream + * @param [in] size The width and height to fit the loaded image to, 0.0 means whole image + * @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] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size. + * @param [in] orientationCorrection Reorient the image to respect any orientation metadata in its header. + * @return handle to the loaded PixelBuffer object or an empty handle in case loading failed. + */ +DALI_ADAPTOR_API Devel::PixelBuffer LoadImageFromBuffer( + const Dali::Vector& buffer, + ImageDimensions size = ImageDimensions(0, 0), + FittingMode::Type fittingMode = FittingMode::DEFAULT, + SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR, + bool orientationCorrection = true); + +/** + * @brief Load an image synchronously from encoded buffer. + * + * @note This method is thread safe, i.e. can be called from any thread. + * + * @param [in] buffer The encoded buffer of the image to load. + * The buffer is not owned by FileStream and must be valid for entire lifetime of FileStream + * @param [in] bufferSize Size of the encoded buffer. + * @param [in] size The width and height to fit the loaded image to, 0.0 means whole image + * @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] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size. + * @param [in] orientationCorrection Reorient the image to respect any orientation metadata in its header. + * @return handle to the loaded PixelBuffer object or an empty handle in case loading failed. + */ +DALI_ADAPTOR_API Devel::PixelBuffer LoadImageFromBuffer( + uint8_t* buffer, + size_t bufferSize, + ImageDimensions size = ImageDimensions(0, 0), + FittingMode::Type fittingMode = FittingMode::DEFAULT, + SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR, + bool orientationCorrection = true); + +/** * @brief Determine the size of an image that LoadImageFromFile will provide when * given the same image loading parameters. *