#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
-#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
#include <platform-abstractions/tizen/image-loaders/loader-jpeg.h>
#include <platform-abstractions/tizen/image-loaders/loader-png.h>
+#include <platform-abstractions/tizen/tizen-platform-abstraction.h>
#include <image-encoder.h>
+
namespace Dali
{
DALI_LOG_ERROR("Encoding pixels failed\n");
return false;
}
- return TizenPlatform::ResourceLoader::SaveFile( filename, pixbufEncoded.Begin(), pixbufEncoded.Count() );
+ return TizenPlatform::SaveFile( filename, pixbufEncoded.Begin(), pixbufEncoded.Count() );
}
} // namespace Dali
#include "image-loaders/image-loader.h"
#include <resource-loader/network/file-download.h>
#include <platform-abstractions/portable/file-closer.h>
-#include <platform-abstractions/tizen/resource-loader/resource-loading-client.h>
namespace Dali
{
PixelData LoadImageFromFile( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
{
Integration::BitmapResourceType resourceType( size, fittingMode, samplingMode, orientationCorrection );
- IntrusivePtr<Dali::RefObject> resource = TizenPlatform::ImageLoader::LoadResourceSynchronously( resourceType, url );
+ IntrusivePtr<Dali::RefObject> resource = TizenPlatform::ImageLoader::LoadImageSynchronously( resourceType, url );
if( resource )
{
resourceType,
url,
fp,
- TizenPlatform::StubbedResourceLoadingClient(),
bitmap );
if ( result && bitmap )
#include <render-surface.h>
// Allow this to be encoded and saved:
-#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
#include <bitmap-saver.h>
namespace Dali
#include <dali-test-suite-utils.h>
-class StubImageLoaderClient : public Dali::TizenPlatform::ResourceLoadingClient
-{
-public:
- StubImageLoaderClient() {}
- ~StubImageLoaderClient() {}
-
- virtual void InterruptionPoint() const {}
-};
-
AutoCloseFile::AutoCloseFile( FILE *fp )
: filePtr( fp )
{
Dali::Integration::BitmapPtr bitmapPtr( bitmap );
// Load Bitmap and check its return values.
- DALI_TEST_CHECK( functions.loader( StubImageLoaderClient(), input, *bitmap ) );
+ DALI_TEST_CHECK( functions.loader( input, *bitmap ) );
DALI_TEST_EQUALS( image.width, bitmap->GetImageWidth(), TEST_LOCATION );
DALI_TEST_EQUALS( image.height, bitmap->GetImageHeight(), TEST_LOCATION );
Dali::Integration::BitmapPtr bitmapPointer( bitmap );
// Load Bitmap and check its return values.
- DALI_TEST_CHECK( functions.loader( StubImageLoaderClient(), input, *bitmap ) );
+ DALI_TEST_CHECK( functions.loader( input, *bitmap ) );
DALI_TEST_EQUALS( image.width, bitmap->GetImageWidth(), TEST_LOCATION );
DALI_TEST_EQUALS( image.height, bitmap->GetImageHeight(), TEST_LOCATION );
Dali::Integration::BitmapPtr bitmapPtr( bitmap );
const Dali::TizenPlatform::ImageLoader::Input input( fp );
- DALI_TEST_CHECK( functions.loader( StubImageLoaderClient(), input, *bitmap ) );
+ DALI_TEST_CHECK( functions.loader( input, *bitmap ) );
Dali::PixelBuffer* bufferPtr( bitmapPtr->GetBuffer() );
#include <dali/dali.h>
#include <dali/integration-api/bitmap.h>
-#include "platform-abstractions/tizen/resource-loader/resource-loading-client.h"
#include "platform-abstractions/tizen/image-loaders/image-loader-input.h"
// Simple structure to close the file when finished with it.
*/
struct LoadFunctions
{
- typedef bool (*LoadBitmapFunction)( const Dali::TizenPlatform::ResourceLoadingClient& client, const Dali::TizenPlatform::ImageLoader::Input& input, Dali::Integration::Bitmap& );
+ typedef bool (*LoadBitmapFunction)( const Dali::TizenPlatform::ImageLoader::Input& input, Dali::Integration::Bitmap& );
typedef bool (*LoadBitmapHeaderFunction)( const Dali::TizenPlatform::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
LoadFunctions( LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader );
TestPlatformAbstraction::TestPlatformAbstraction()
: mTrace(),
mIsLoadingResult( false ),
- mSize(),
mClosestSize(),
mLoadFileResult(),
mSaveFileResult( false ),
return closestSize;
}
-Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath )
+Integration::ResourcePointer TestPlatformAbstraction::LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath )
{
mTrace.PushCall("LoadResourceSynchronously", "");
return mSynchronouslyLoadedResource;
}
-Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size )
+Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size )
{
mTrace.PushCall("DecodeBuffer", "");
return mDecodedBitmap;
// INTERNAL INCLUDES
#include <dali/integration-api/platform-abstraction.h>
+#include <dali/public-api/math/vector2.h>
#include "test-trace-call-stack.h"
/**
* @copydoc PlatformAbstraction::LoadResourceSynchronously()
*/
- virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
+ virtual Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath );
/**
* @copydoc PlatformAbstraction::DecodeBuffer()
*/
- virtual Integration::BitmapPtr DecodeBuffer( const Dali::Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
+ virtual Integration::BitmapPtr DecodeBuffer( const Dali::Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size );
/**
* @copydoc PlatformAbstraction::LoadShaderBinaryFile()
mutable TraceCallStack mTrace;
bool mIsLoadingResult;
- Vector2 mSize;
Vector2 mClosestSize;
LoadFileResult mLoadFileResult;
} // Dali
-#endif /* __DALI_TET_PLATFORM_ABSTRACTION_H__ */
+#endif /* __DALI_TEST_PLATFORM_ABSTRACTION_H__ */
}
/** Live platform abstraction recreated for each test case. */
-Integration::PlatformAbstraction * gAbstraction = 0;
+TizenPlatform::TizenPlatformAbstraction* gAbstraction = 0;
/** A variety of parameters to reach different code paths in image loading code. */
std::vector<ImageParameters> gCancelAttributes;
void utc_dali_loading_startup(void)
{
test_return_value = TET_UNDEF;
- gAbstraction = CreatePlatformAbstraction();
+ gAbstraction = TizenPlatform::CreatePlatformAbstraction();
// Setup some loading parameters to engage post-processing stages:
} // anon namespace
/** Live platform abstraction recreated for each test case. */
-extern Integration::PlatformAbstraction * gAbstraction;
+extern TizenPlatform::TizenPlatformAbstraction* gAbstraction;
/** A variety of parameters to reach different code paths in the image loading. */
typedef std::pair<ImageDimensions, std::pair<FittingMode::Type, std::pair<SamplingMode::Type, bool> > > ImageParameters;
$(tizen_platform_abstraction_src_dir)/tizen-platform-abstraction.cpp \
$(tizen_platform_abstraction_src_dir)/tizen-logging.cpp \
\
- $(tizen_platform_abstraction_src_dir)/resource-loader/resource-loader.cpp \
- \
$(tizen_platform_abstraction_src_dir)/resource-loader/network/file-download.cpp \
$(tizen_platform_abstraction_src_dir)/resource-loader/network/http-utils.cpp \
\
- $(tizen_platform_abstraction_src_dir)/resource-loader/debug/resource-loader-debug.cpp \
- \
$(tizen_platform_abstraction_src_dir)/image-loaders/loader-astc.cpp \
$(tizen_platform_abstraction_src_dir)/image-loaders/loader-bmp.cpp \
$(tizen_platform_abstraction_src_dir)/image-loaders/loader-gif.cpp \
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
namespace
{
-typedef bool (*LoadBitmapFunction)( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+typedef bool (*LoadBitmapFunction)( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
typedef bool (*LoadBitmapHeaderFunction)( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
#if defined(DEBUG_ENABLED)
namespace ImageLoader
{
-bool ConvertStreamToBitmap( const ResourceType& resourceType, std::string path, FILE * const fp, const ResourceLoadingClient& client, BitmapPtr& ptr )
+bool ConvertStreamToBitmap( const BitmapResourceType& resource, std::string path, FILE * const fp, BitmapPtr& ptr )
{
DALI_LOG_TRACE_METHOD( gLogFilter );
- DALI_ASSERT_DEBUG( ResourceBitmap == resourceType.id );
bool result = false;
BitmapPtr bitmap = 0;
bitmap = Bitmap::New( profile, ResourcePolicy::OWNED_DISCARD );
DALI_LOG_SET_OBJECT_STRING( bitmap, path );
- const BitmapResourceType& resType = static_cast<const BitmapResourceType&>( resourceType );
- const ScalingParameters scalingParameters( resType.size, resType.scalingMode, resType.samplingMode );
- const ImageLoader::Input input( fp, scalingParameters, resType.orientationCorrection );
-
- // Check for cancellation now we have hit the filesystem, done some allocation, and burned some cycles:
- // This won't do anything from synchronous API, it's only useful when called from another thread.
- client.InterruptionPoint(); // Note: By design, this can throw an exception
+ const ScalingParameters scalingParameters( resource.size, resource.scalingMode, resource.samplingMode );
+ const ImageLoader::Input input( fp, scalingParameters, resource.orientationCorrection );
// Run the image type decoder:
- result = function( client, input, *bitmap );
+ result = function( input, *bitmap );
if (!result)
{
bitmap = 0;
}
- // Apply the requested image attributes if not interrupted:
- client.InterruptionPoint(); // Note: By design, this can throw an exception
- bitmap = Internal::Platform::ApplyAttributesToBitmap( bitmap, resType.size, resType.scalingMode, resType.samplingMode );
+ bitmap = Internal::Platform::ApplyAttributesToBitmap( bitmap, resource.size, resource.scalingMode, resource.samplingMode );
}
else
{
return result;
}
-ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath )
+ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resource, const std::string& path )
{
- ResourcePointer resource;
+ ResourcePointer result;
BitmapPtr bitmap = 0;
- Internal::Platform::FileCloser fc( resourcePath.c_str(), "rb");
+ Internal::Platform::FileCloser fc( path.c_str(), "rb");
FILE * const fp = fc.GetFile();
if( fp != NULL )
{
- bool result = ConvertStreamToBitmap( resourceType, resourcePath, fp, StubbedResourceLoadingClient(), bitmap );
- if( result && bitmap )
+ bool success = ConvertStreamToBitmap( resource, path, fp, bitmap );
+ if( success && bitmap )
{
- resource.Reset(bitmap.Get());
+ result.Reset(bitmap.Get());
}
}
- return resource;
+ return result;
}
///@ToDo: Rename GetClosestImageSize() functions. Make them use the orientation correction and scaling information. Requires jpeg loader to tell us about reorientation. [Is there still a requirement for this functionality at all?]
#define __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
#include <dali/integration-api/resource-types.h>
#include <dali/integration-api/bitmap.h>
-// INTERNAL INCLUDES
-#include "resource-loading-client.h"
-
namespace Dali
{
namespace Integration
{
/**
* Convert a file stream into a bitmap.
- * @param[in] resourceType The type of resource to convert.
+ * @param[in] resource The resource to convert.
* @param[in] path The path to the resource.
* @param[in] fp File Pointer. Closed on exit.
- * @param[in] client The component that is initiating the conversion.
* @param[out] bitmap Pointer to write bitmap to
* @return true on success, false on failure
*/
-bool ConvertStreamToBitmap( const Integration::ResourceType& resourceType, std::string path, FILE * const fp, const ResourceLoadingClient& client, Integration::BitmapPtr& ptr);
+bool ConvertStreamToBitmap( const Integration::BitmapResourceType& resource, std::string path, FILE * const fp, Integration::BitmapPtr& ptr );
/**
* Convert a bitmap and write to a file stream.
*/
bool ConvertBitmapToStream( std::string path, FILE * const fp, Integration::BitmapPtr& ptr );
+/**
+ * Loads an image synchronously
+ * @param resource details of the image
+ * @param path to the image
+ * @return bitmap
+ */
+Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resource, const std::string& path );
-Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
-
+/**
+ * @returns the closest image size
+ */
ImageDimensions GetClosestImageSize( const std::string& filename,
ImageDimensions size,
FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection );
+/**
+ * @returns the closest image size
+ */
ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
ImageDimensions size,
FittingMode::Type fittingMode,
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
}
// File loading API entry-point:
-bool LoadBitmapFromAstc( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromAstc( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
FILE* const filePointer = input.file;
if( !filePointer )
#define __DALI_TIZEN_PLATFORM_LOADER_ASTC_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
* Loads a compressed bitmap image from a ASTC file without decoding it.
* This function checks the header first
* and if it is not a ASTC file, or the header contents are invalid, it will return a failure.
- * @param[in] client todor
- * @param[in] input Information about the input image (including file pointer)
- * @param[in/out] bitmap The bitmap class where the decoded image will be stored
- * @return True if file loaded successfully, false otherwise
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
+ * @return True if file loaded successfully, false otherwise
*/
-bool LoadBitmapFromAstc( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+bool LoadBitmapFromAstc( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
/**
* Loads the header of a ASTC file and fills in the width and height appropriately.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
return ret;
}
-bool LoadBitmapFromBmp( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromBmp( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
DALI_ASSERT_DEBUG( bitmap.GetPackedPixelsProfile() != 0 && "Need a packed pixel bitmap to load into." );
FILE* const fp = input.file;
#define __DALI_TIZEN_PLATFORM_LOADER_BMP_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
/**
* Loads the bitmap from an BMP file. This function checks the header first
* and if it is not a BMP file, then it returns straight away.
- * @param[in] fp Pointer to the Image file
- * @param[in] bitmap The bitmap class where the decoded image will be stored
- * @param[in] attributes Describes the dimensions, pixel format and other details for loading the image data
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
* @return true if file decoded successfully, false otherwise
*/
-bool LoadBitmapFromBmp( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+bool LoadBitmapFromBmp( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
/**
* Loads the header of a BMP file and fills in the width and height appropriately.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
return LoadGifHeader(fp, width, height, &gifInfo);
}
-bool LoadBitmapFromGif( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromGif( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
FILE* const fp = input.file;
// Load the GIF Header file.
#define __DALI_TIZEN_PLATFORM_LOADER_GIF_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
* Loads the bitmap from a GIF file. This function checks the header first
* and if it is not a GIF file, then it returns straight away.
* @note For animated GIFs, only the first image is displayed
- * @param[in] fp Pointer to the Image file
- * @param[in] bitmap The bitmap class where the decoded image will be stored
- * @param[in] attributes Describes the dimensions, pixel format and other details for loading the image data
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
* @return true if file decoded successfully, false otherwise
*/
-bool LoadBitmapFromGif( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+bool LoadBitmapFromGif( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
/**
* Loads the header of a GIF file and fills in the width and height appropriately.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
return true;
}
-bool LoadBitmapFromIco( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromIco( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
IcoData chosen;
Dali::Vector<unsigned char> map;
#define __DALI_TIZEN_PLATFORM_LOADER_ICO_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
const unsigned char MAGIC_BYTE_1 = 0x00;
const unsigned char MAGIC_BYTE_2 = 0x00;
}
+/**
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
+ * @return true if file decoded successfully, false otherwise
+ */
+bool LoadBitmapFromIco( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
-bool LoadBitmapFromIco( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
-
+/**
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] width of image
+ * @param[out] height of image
+ * @return true if header loaded successfully, false otherwise
+ */
bool LoadIcoHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
// INTERNAL HEADERS
#include "loader-jpeg.h"
-#include "resource-loading-client.h"
#include <dali/integration-api/bitmap.h>
-#include <resource-loader/debug/resource-loader-debug.h>
#include "platform-capabilities.h"
#include "image-operations.h"
return true;
}
-bool LoadBitmapFromJpeg( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromJpeg( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
const int flags= 0;
FILE* const fp = input.file;
DALI_LOG_ERROR("Error seeking to start of file\n");
}
- // Allow early cancellation between the load and the decompress:
- client.InterruptionPoint();
-
AutoJpg autoJpg(tjInitDecompress());
if(autoJpg.GetHandle() == NULL)
unsigned char * const bitmapPixelBuffer = bitmap.GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGB888, scaledPostXformWidth, scaledPostXformHeight);
- // Allow early cancellation before decoding:
- client.InterruptionPoint();
-
if( tjDecompress2( autoJpg.GetHandle(), jpegBufferPtr, jpegBufferSize, bitmapPixelBuffer, scaledPreXformWidth, 0, scaledPreXformHeight, DECODED_PIXEL_LIBJPEG_TYPE, flags ) == -1 )
{
std::string errorString = tjGetErrorStr();
const unsigned int bufferWidth = GetTextureDimension( scaledPreXformWidth );
const unsigned int bufferHeight = GetTextureDimension( scaledPreXformHeight );
- if( transform != JPGFORM_NONE )
- {
- // Allow early cancellation before shuffling pixels around on the CPU:
- client.InterruptionPoint();
- }
-
bool result = false;
switch(transform)
{
#define __DALI_TIZEN_PLATFORM_LOADER_JPEG_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
/**
* Loads the bitmap from an JPEG file. This function checks the header first
* and if it is not a JPEG file, then it returns straight away.
- * @param[in] fp Pointer to the Image file
- * @param[in] bitmap The bitmap class where the decoded image will be stored
- * @param[in] attributes Describes the dimensions, pixel format and other details for loading the image data
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
* @return true if file decoded successfully, false otherwise
*/
-bool LoadBitmapFromJpeg( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+bool LoadBitmapFromJpeg( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
/**
* Loads the header of a JPEG file and fills in the width and height appropriately.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
}
// File loading API entry-point:
-bool LoadBitmapFromKtx( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromKtx( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
DALI_COMPILE_TIME_ASSERT( sizeof(Byte) == 1);
DALI_COMPILE_TIME_ASSERT( sizeof(uint32_t) == 4);
#define __DALI_TIZEN_PLATFORM_LOADER_KTX_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
* Loads a compressed bitmap from a KTX file without decoding it.
* This function checks the header first
* and if it is not a KTX file, then it returns straight away.
- * @param[in] fp Pointer to the Image file
- * @param[in] bitmap The bitmap class where the decoded image will be stored
- * @param[in] attributes Describes the dimensions, pixel format and other details for loading the image data
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
* @return true if file loaded successfully, false otherwise
*/
-bool LoadBitmapFromKtx( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+bool LoadBitmapFromKtx( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
/**
* Loads the header of a KTX file and fills in the width and height appropriately.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
return success;
}
-bool LoadBitmapFromPng( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromPng( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
png_structp png = NULL;
png_infop info = NULL;
#define __DALI_TIZEN_PLATFORM_LOADER_PNG_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
/**
* Loads the bitmap from an PNG file. This function checks the header first
* and if it is not a PNG file, then it returns straight away.
- * @param[in] fp Pointer to the Image file
- * @param[in] bitmap The bitmap class where the decoded image will be stored
- * @param[in] attributes Describes the dimensions, pixel format and other details for loading the image data
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
* @return true if file decoded successfully, false otherwise
*/
-bool LoadBitmapFromPng( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+bool LoadBitmapFromPng( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
/**
* Loads the header of a PNG file and fills in the width and height appropriately.
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
}// end unnamed namespace
-bool LoadBitmapFromWbmp( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromWbmp( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
FILE* const fp = input.file;
if(fp == NULL)
#define __DALI_TIZEN_PLATFORM_LOADER_WBMP_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
class ResourceLoadingClient;
-bool LoadBitmapFromWbmp( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+/**
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
+ * @return true if file decoded successfully, false otherwise
+ */
+bool LoadBitmapFromWbmp( const ImageLoader::Input& input, Integration::Bitmap& bitmap );
+/**
+ * @param[in] input Information about the input image (including file pointer)
+ * @param[out] width of image
+ * @param[out] height of image
+ * @return true if header loaded successfully, false otherwise
+ */
bool LoadWbmpHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
}
+++ /dev/null
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "resource-loader-debug.h"
-
-#if defined(DEBUG_ENABLED)
-
-namespace Dali
-{
-namespace TizenPlatform
-{
-using namespace Dali::Integration;
-
-/**
- * Filter for resource loader debug. Change levels here to turn on debugging
- */
-Debug::Filter* gLoaderFilter = Debug::Filter::New(Debug::Concise, false, "LOG_RESOURCE_LOADER");
-
-} //TizenPlatform
-} //Dali
-
-#endif
+++ /dev/null
-#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_DEBUG_H__
-#define __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_DEBUG_H__
-
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/integration-api/debug.h>
-#if defined(DEBUG_ENABLED)
-
-#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
-
-
-namespace Dali
-{
-namespace TizenPlatform
-{
-
-extern Debug::Filter* gLoaderFilter;
-
-} // TizenPlatform
-} // Dali
-
-#endif // defined(DEBUG_ENABLED)
-#endif //__DALI_TIZEN_PLATFORM_RESOURCE_LOADER_DEBUG_H__
+++ /dev/null
-/*
- * Copyright (c) 2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include "resource-loader.h"
-
-// EXTERNAL HEADERS
-#include <iostream>
-#include <fstream>
-#include <queue>
-#include <cstring>
-#include <dali/devel-api/common/map-wrapper.h>
-#include <dali/devel-api/threading/mutex.h>
-
-// INTERNAL HEADERS
-#include <dali/integration-api/bitmap.h>
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/devel-api/common/set-wrapper.h>
-#include <dali/public-api/math/vector2.h>
-#include "debug/resource-loader-debug.h"
-
-using namespace Dali::Integration;
-
-namespace Dali
-{
-
-namespace TizenPlatform
-{
-
-/********************************************************************************/
-/**************************** RESOURCE LOADER METHODS ************************/
-/********************************************************************************/
-ResourceLoader::ResourceLoader()
-{
-}
-
-ResourceLoader::~ResourceLoader()
-{
-}
-
-bool ResourceLoader::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes )
-{
- DALI_LOG_TRACE_METHOD(gLoaderFilter);
-
- DALI_ASSERT_DEBUG( 0 != filename.length());
-
- bool result = false;
-
- std::filebuf buf;
- buf.open(filename.c_str(), std::ios::out | std::ios_base::trunc | std::ios::binary);
- if( buf.is_open() )
- {
- std::ostream stream(&buf);
-
- // determine size of buffer
- int length = static_cast<int>(numBytes);
-
- // write contents of buffer to the file
- stream.write(reinterpret_cast<const char*>(buffer), length);
-
- if( !stream.bad() )
- {
- DALI_LOG_INFO(gLoaderFilter, Debug::Verbose, "ResourceLoader::SaveFile(%s) - wrote %d bytes\n", filename.c_str(), length);
- result = true;
- }
- }
-
-#if defined(DEBUG_BUILD)
- if( !result )
- {
- DALI_LOG_INFO(gLoaderFilter, Debug::Verbose, "ResourceLoader::SaveFile(%s) - failed to load\n", filename.c_str());
- }
-#endif
-
- return result;
-}
-
-} // namespace TizenPlatform
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_H__
-#define __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_H__
-
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/integration-api/platform-abstraction.h>
-#include <dali/public-api/common/dali-vector.h>
-
-#include <string>
-
-namespace Dali
-{
-
-namespace Integration
-{
-namespace Log
-{
-class Filter;
-}
-}
-
-namespace TizenPlatform
-{
-
-/**
- * Contains information about a successfully loaded resource
- */
-struct LoadedResource
-{
- /**
- * Constructor
- * @param[in] loadedId The ID of the resource
- * @param[in] loadedType The resource type
- * @param[in] loadedResource A pointer to the loaded resource data
- */
- LoadedResource(Integration::ResourceId loadedId,
- Integration::ResourceTypeId loadedType,
- Integration::ResourcePointer loadedResource)
- : id(loadedId),
- type(loadedType),
- resource(loadedResource)
- {
- }
-
- /// Copy constructor
- LoadedResource(const LoadedResource& loaded)
- : id(loaded.id),
- type(loaded.type),
- resource(loaded.resource)
- {
- }
-
- /// Assignment operator
- LoadedResource& operator=(const LoadedResource& rhs)
- {
- if( this != &rhs )
- {
- id = rhs.id;
- type = rhs.type;
- resource = rhs.resource;
- }
- return *this;
- }
-
- Integration::ResourceId id; ///< Integer ID
- Integration::ResourceTypeId type; ///< Type enum (bitmap, ...)
- Integration::ResourcePointer resource; ///< Reference counting pointer to the loaded / decoded representation of the resource.
-};
-
-/**
- * Contains information about a failed resource load/save request
- */
-struct FailedResource
-{
-};
-
-/**
- * This implements the resource loading part of the PlatformAbstraction API.
- * The requests for a specific resource type are farmed-out to a resource
- * requester for that type which handles them in their own dedicated loading
- * threads.
- */
-class ResourceLoader
-{
-public:
-
- /**
- * Create a resource loader.
- * There should exactly one of these objects per Dali Core.
- */
- ResourceLoader();
-
- /**
- * Non-virtual destructor.
- * ResourceLoader is NOT intended as a base class.
- */
- ~ResourceLoader();
-
- // From PlatformAbstraction
-
- /**
- * @copydoc TizenPlatformAbstraction::SaveFile()
- */
- static bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
-
-private:
- // Undefined
- ResourceLoader( const ResourceLoader& resourceLoader );
-
- // Undefined
- ResourceLoader& operator=( const ResourceLoader& resourceLoader );
-
-private:
-
-};
-
-} // namespace TizenPlatform
-
-} // namespace Dali
-
-#endif // __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_H_
+++ /dev/null
-#ifndef _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_
-#define _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-
-// EXTERNAL INCLUDES
-
-namespace Dali
-{
-namespace TizenPlatform
-{
-
-/**
- * @brief Abstract interface to the caller of a low-level resource loading
- * function such as a loader for an image format.
- */
-class ResourceLoadingClient
-{
-public:
- /**
- * @brief Check whether the current request has been cancelled.
- *
- * This will throw an exception to unwind the stack if the current request
- * has been cancelled.
- *
- * @note Only place calls to this function at exception-safe locations in loader code.
- **/
- virtual void InterruptionPoint() const = 0;
-
-protected:
- /** Construction is restricted to derived / implementing classes. */
- ResourceLoadingClient() {}
- /** Destruction of an object through this interface is not allowed. */
- ~ResourceLoadingClient() {}
-
-private:
- ResourceLoadingClient( const ResourceLoadingClient& rhs );
- ResourceLoadingClient& operator =( ResourceLoadingClient& rhs );
-};
-
-/**
- * @brief Default implementation of a caller of a low-level resource loading
- * function which does nothing.
- */
-class StubbedResourceLoadingClient : public ResourceLoadingClient
-{
-public:
- /**
- * @brief Check whether the current request has been cancelled.
- *
- * This does nothing and so can never throw an exception.
- **/
- virtual void InterruptionPoint() const {}
-
- /** Construction is a NOP. */
- StubbedResourceLoadingClient() {}
- /** Destruction has no work to do. */
- ~StubbedResourceLoadingClient() {}
-
-private:
- StubbedResourceLoadingClient( const StubbedResourceLoadingClient& rhs );
- StubbedResourceLoadingClient& operator =( StubbedResourceLoadingClient& rhs );
-};
-
-} /* namespace TizenPlatform */
-} /* namespace Dali */
-
-#endif /* _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_ */
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
*
*/
+// CLASS HEADER
#include "tizen-platform-abstraction.h"
-#ifndef DALI_PROFILE_UBUNTU
-#include <vconf.h>
-#endif // DALI_PROFILE_UBUNTU
+// EXTERNAL INCLUDES
#include <dirent.h>
-
+#include <fstream>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/bitmap.h>
#include <dali/integration-api/resource-types.h>
// INTERNAL INCLUDES
-#include "resource-loader/resource-loader.h"
#include "image-loaders/image-loader.h"
#include "portable/file-closer.h"
namespace Dali
{
-Integration::PlatformAbstraction* CreatePlatformAbstraction()
-{
- return new TizenPlatform::TizenPlatformAbstraction();
-}
-
-
namespace TizenPlatform
{
TizenPlatformAbstraction::TizenPlatformAbstraction()
-: mResourceLoader(new ResourceLoader),
- mDataStoragePath( "" )
+: mDataStoragePath( "" )
{
}
TizenPlatformAbstraction::~TizenPlatformAbstraction()
{
- delete mResourceLoader;
-}
-
-int TizenPlatformAbstraction::GetDefaultFontSize() const
-{
- int fontSize( -1 );
-
-#ifndef DALI_PROFILE_UBUNTU
- vconf_get_int( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &fontSize );
-#endif // DALI_PROFILE_UBUNTU
-
- return fontSize;
}
ImageDimensions TizenPlatformAbstraction::GetClosestImageSize( const std::string& filename,
return ImageLoader::GetClosestImageSize( resourceBuffer, size, fittingMode, samplingMode, orientationCorrection );
}
-Integration::ResourcePointer TizenPlatformAbstraction::LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath)
+Integration::ResourcePointer TizenPlatformAbstraction::LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath)
{
- return ImageLoader::LoadResourceSynchronously( resourceType, resourcePath );
+ return ImageLoader::LoadImageSynchronously( resource, resourcePath );
}
-Integration::BitmapPtr TizenPlatformAbstraction::DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size )
+Integration::BitmapPtr TizenPlatformAbstraction::DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size )
{
Integration::BitmapPtr bitmap = 0;
FILE * const fp = fileCloser.GetFile();
if( fp )
{
- bool result = ImageLoader::ConvertStreamToBitmap( resourceType, "", fp, StubbedResourceLoadingClient(), bitmap );
+ bool result = ImageLoader::ConvertStreamToBitmap( resource, "", fp, bitmap );
if ( !result || !bitmap )
{
bitmap.Reset();
std::string path;
// First check the system location where shaders are stored at install time:
- if( mResourceLoader )
- {
- path = DALI_SHADERBIN_DIR;
- path += filename;
- result = mResourceLoader->LoadFile( path, buffer );
- }
+ path = DALI_SHADERBIN_DIR;
+ path += filename;
+ result = LoadFile( path, buffer );
// Fallback to the cache of shaders stored after previous runtime compilations:
// On desktop this looks in the current working directory that the app was launched from.
{
path = mDataStoragePath;
path += filename;
- result = mResourceLoader->LoadFile( path, buffer );
+ result = LoadFile( path, buffer );
}
#endif
#ifdef SHADERBIN_CACHE_ENABLED
- // Fallback to the cache of shaders stored after previous runtime compilations:
- // On desktop this looks in the current working directory that the app was launched from.
- if( mResourceLoader )
- {
- std::string path = mDataStoragePath;
- path += filename;
- result = mResourceLoader->SaveFile( path, buffer, numBytes );
- }
+ // Use the cache of shaders stored after previous runtime compilations:
+ // On desktop this looks in the current working directory that the app was launched from.
+ std::string path = mDataStoragePath;
+ path += filename;
+ result = SaveFile( path, buffer, numBytes );
+
#endif
return result;
mDataStoragePath = path;
}
+TizenPlatformAbstraction* CreatePlatformAbstraction()
+{
+ return new TizenPlatformAbstraction();
+}
+
+bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes )
+{
+ DALI_ASSERT_DEBUG( 0 != filename.length());
+
+ bool result = false;
+
+ std::filebuf buf;
+ buf.open(filename.c_str(), std::ios::out | std::ios_base::trunc | std::ios::binary);
+ if( buf.is_open() )
+ {
+ std::ostream stream(&buf);
+
+ // determine size of buffer
+ int length = static_cast<int>(numBytes);
+
+ // write contents of buffer to the file
+ stream.write(reinterpret_cast<const char*>(buffer), length);
+
+ if( !stream.bad() )
+ {
+ result = true;
+ }
+ }
+
+ return result;
+}
+
} // namespace TizenPlatform
} // namespace Dali
namespace Dali
{
-/**
- * Construct a platform abstraction and return it.
- */
-Integration::PlatformAbstraction* CreatePlatformAbstraction();
-
namespace TizenPlatform
{
bool orientationCorrection );
/**
- * @copydoc PlatformAbstraction::LoadResourceSynchronously()
+ * @copydoc PlatformAbstraction::LoadImageSynchronously()
*/
- virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
+ virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath);
/**
* @copydoc PlatformAbstraction::DecodeBuffer()
*/
- virtual Integration::BitmapPtr DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
-
- /**
- * @copydoc PlatformAbstraction::GetDefaultFontSize()
- */
- virtual int GetDefaultFontSize() const;
+ virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size );
/**
* @copydoc PlatformAbstraction::LoadShaderBinaryFile()
TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
- ResourceLoader* mResourceLoader;
std::string mDataStoragePath;
+
};
+/**
+ * Construct a platform abstraction and return it.
+ * @return TizenPlatformAbstraction instance
+ */
+TizenPlatformAbstraction* CreatePlatformAbstraction();
+
+/**
+ * Save a file to disk
+ * @param filename to create
+ * @param buffer to store
+ * @param numBytes to store
+ * @return true if successful, false otherwise
+ */
+bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
+
} // namespace TizenPlatform
+
} // namespace Dali
#endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__