#include <dali/integration-api/resource-cache.h>
#include <dali/integration-api/resource-types.h>
-#include <dali/integration-api/bitmap.h>
#include "resource-thread-base.h"
namespace Dali
{
-namespace Integration
-{
-namespace Log
-{
-class Filter;
-}
-}
-
namespace SlpPlatform
{
* Constructor
* @param[in] resourceLoader A reference to the ResourceLoader
*/
- ResourceThreadImage(ResourceLoader& resourceLoader);
+ ResourceThreadImage(ResourceLoader& resourceLoader, bool forRemoteImage);
/**
* Destructor
*/
virtual ~ResourceThreadImage();
- /**
- * @copydoc ResourceLoader::LoadResourceSynchronously()
- * Note, this is not threaded, but is called synchronously.
- */
- Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
-
- /**
- * @copydoc ResourceLoader::GetClosestImageSize()
- * Note, this is not threaded, but is called synchronously.
- */
- void GetClosestImageSize( const std::string& filename,
- const ImageAttributes& attributes,
- Vector2 &closestSize );
-
- /**
- * @copydoc ResourceLoader::GetClosestImageSize()
- * Note, this is not threaded, but is called synchronously.
- */
- void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
- const ImageAttributes& attributes,
- Vector2 &closestSize );
private:
/**
virtual void Load(const Integration::ResourceRequest& request);
/**
+ * @copydoc ResourceThreadBase::Download
+ */
+ virtual void Download(const Integration::ResourceRequest& request);
+
+ /**
* @copydoc ResourceThreadBase::Decode
*/
virtual void Decode(const Integration::ResourceRequest& request);
*/
virtual void Save(const Integration::ResourceRequest& request);
-private:
/**
- * Convert the file stream into a bitmap.
- * @param[in] resourceType The type of resource to convert.
- * @param[in] path The path to the resource.
- * @param[in] fp File Pointer. Closed on exit.
- * @param[out] bitmap Pointer to write bitmap to
- * @return true on success, false on failure
+ * Download a requested image into a memory buffer.
+ * @param[in] request The requested resource/file url and attributes
+ * @param[out] dataBuffer A memory buffer object to be written with downloaded image data.
+ * @param[out] dataSize The size of the memory buffer.
*/
- bool ConvertStreamToBitmap( const Integration::ResourceType& resourceType,
- std::string path,
- FILE * const fp,
- Integration::BitmapPtr& ptr );
+ bool DownloadRemoteImageIntoMemory(const Integration::ResourceRequest& request, Dali::Vector<uint8_t>& dataBuffer, size_t& dataSize);
+ /**
+ * Load a requested image from a local file.
+ * @param[in] request The requested resource/file url and attributes
+ */
+ void LoadImageFromLocalFile(const Integration::ResourceRequest& request);
+ /**
+ * Decode a requested image from a memory buffer.
+ * @param[in] blobBytes A pointer to the memory buffer containig the requested image data.
+ * @param[in] blobSize The size of the memory buffer containing the requested image data.
+ * @param[in] request The requested resource/file url and attributes
+ */
+ void DecodeImageFromMemory(void* blobBytes, size_t blobSize, const Integration::ResourceRequest& request);
}; // class ResourceThreadImage
} // namespace SlpPlatform