X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=platform-abstractions%2Ftizen%2Fimage-loaders%2Floader-wbmp.cpp;h=f042ce7da4571a0b8a952508caf2ea17b7bf7f1e;hb=b1de18b51eacc983bf4087f577f0d10bbcdc2133;hp=5ca55b7e18e7c396da60af8ba7077e111f1842da;hpb=43d62b88c530b72d2d419da81beffbdb13ec25fc;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/platform-abstractions/tizen/image-loaders/loader-wbmp.cpp b/platform-abstractions/tizen/image-loaders/loader-wbmp.cpp index 5ca55b7..f042ce7 100755 --- a/platform-abstractions/tizen/image-loaders/loader-wbmp.cpp +++ b/platform-abstractions/tizen/image-loaders/loader-wbmp.cpp @@ -26,7 +26,6 @@ // INTERNAL INCLUDES #include #include -#include #include namespace Dali @@ -83,7 +82,7 @@ int extractMultiByteInteger(unsigned int *data, void *map, size_t length, size_t if ((buf & 0x80) == 0) { - DALI_LOG_INFO(gLogFilter, Debug::Verbose, "position: %d, readBufCount: %d", *position, readBufCount); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "position: %d, readBufCount: %d\n", *position, readBufCount); break; } } @@ -93,9 +92,9 @@ int extractMultiByteInteger(unsigned int *data, void *map, size_t length, size_t }// end unnamed namespace -bool LoadBitmapFromWbmp( FILE *fp, Integration::Bitmap& bitmap, ImageAttributes& attributes, const ResourceLoadingClient& client ) +bool LoadBitmapFromWbmp( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap ) { - + FILE* const fp = input.file; if(fp == NULL) { DALI_LOG_ERROR("Error loading bitmap\n"); @@ -150,7 +149,7 @@ bool LoadBitmapFromWbmp( FILE *fp, Integration::Bitmap& bitmap, ImageAttributes& if(fread(&map[0], 1, fsize, fp) != fsize) { - DALI_LOG_WARNING("image file read opeation error!"); + DALI_LOG_WARNING("image file read opeation error!\n"); return false; } @@ -210,14 +209,14 @@ bool LoadBitmapFromWbmp( FILE *fp, Integration::Bitmap& bitmap, ImageAttributes& pixels = bitmap.GetPackedPixelsProfile()->ReserveBuffer(Pixel::L8, w, h);//Pixel::RGBA8888 memcpy(pixels, (unsigned char*)&surface[0], w * h );//w * h * 4 - attributes.SetSize(w, h); return true; } -bool LoadWbmpHeader(FILE *fp, const ImageAttributes& attributes, unsigned int &width, unsigned int &height ) +bool LoadWbmpHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height ) { + FILE* const fp = input.file; if(fp == NULL) { DALI_LOG_ERROR("Error loading bitmap\n"); @@ -264,13 +263,13 @@ bool LoadWbmpHeader(FILE *fp, const ImageAttributes& attributes, unsigned int &w map.Resize(headerSize); if(fread(&map[0], 1, headerSize, fp) != headerSize) { - DALI_LOG_WARNING("image file read opeation error!"); + DALI_LOG_WARNING("image file read opeation error!\n"); return false; } - if (extractMultiByteInteger(&type, &map[0], fsize, &position) < 0) + if (extractMultiByteInteger(&type, &map[0], headerSize, &position) < 0) { - DALI_LOG_ERROR("Error: unable to read type!"); + DALI_LOG_ERROR("Error: unable to read type!\n"); return false; } position++; /* skipping one byte */ @@ -279,12 +278,12 @@ bool LoadWbmpHeader(FILE *fp, const ImageAttributes& attributes, unsigned int &w DALI_LOG_ERROR("Error: unknown format!\n"); return false; } - if (extractMultiByteInteger(&w, &map[0], fsize, &position) < 0) + if (extractMultiByteInteger(&w, &map[0], headerSize, &position) < 0) { DALI_LOG_ERROR("Error: can not read width!\n"); return false; } - if (extractMultiByteInteger(&h, &map[0], fsize, &position) < 0) + if (extractMultiByteInteger(&h, &map[0], headerSize, &position) < 0) { DALI_LOG_ERROR("Error: can not read height!\n"); return false;