@@ -231,7 +231,7 @@ void Image::LoadTiffFile(IDataBlob* pFileData, const ImageLoadInfo& LoadInfo)
231231 if (PlanarConfig == PLANARCONFIG_CONTIG || m_Desc.NumComponents == 1 )
232232 {
233233 VERIFY_EXPR (m_Desc.RowStride >= ScanlineSize);
234- auto * pDataPtr = reinterpret_cast <Uint8*>( m_pData->GetDataPtr () );
234+ Uint8 * pDataPtr = m_pData->GetDataPtr <Uint8>( );
235235 for (Uint32 row = 0 ; row < m_Desc.Height ; row++, pDataPtr += m_Desc.RowStride )
236236 {
237237 TIFFReadScanline (TiffFile, pDataPtr, row);
@@ -244,7 +244,7 @@ void Image::LoadTiffFile(IDataBlob* pFileData, const ImageLoadInfo& LoadInfo)
244244 {
245245 for (Uint16 comp = 0 ; comp < m_Desc.NumComponents ; ++comp)
246246 {
247- auto * const pDstRow = reinterpret_cast <Uint8*>( m_pData->GetDataPtr () ) + m_Desc.RowStride * row + comp;
247+ Uint8 * const pDstRow = m_pData->GetDataPtr <Uint8>( ) + m_Desc.RowStride * row + comp;
248248
249249 TIFFReadScanline (TiffFile, ScanlineData.data (), row, comp);
250250
@@ -286,7 +286,7 @@ void Image::LoadTiffFile(IDataBlob* pFileData, const ImageLoadInfo& LoadInfo)
286286static bool LoadHDRFile (IDataBlob* pSrcHdrBits, IDataBlob* pDstPixels, ImageDesc* pDstImgDesc)
287287{
288288 Int32 Width = 0 , Height = 0 , NumComponents = 0 ;
289- float * pFloatData = stbi_loadf_from_memory (static_cast < const Uint8*>( pSrcHdrBits->GetConstDataPtr () ), static_cast <Int32>(pSrcHdrBits->GetSize ()), &Width, &Height, &NumComponents, 0 );
289+ float * pFloatData = stbi_loadf_from_memory (pSrcHdrBits->GetConstDataPtr <stbi_uc>( ), static_cast <Int32>(pSrcHdrBits->GetSize ()), &Width, &Height, &NumComponents, 0 );
290290 if (pFloatData == nullptr )
291291 {
292292 LOG_ERROR_MESSAGE (" Failed to load HDR image from memory. STB supports only 32-bit rle rgbe textures" );
@@ -308,7 +308,7 @@ static bool LoadHDRFile(IDataBlob* pSrcHdrBits, IDataBlob* pDstPixels, ImageDesc
308308static bool LoadTGAFile (IDataBlob* pSrcTgaBits, IDataBlob* pDstPixels, ImageDesc* pDstImgDesc)
309309{
310310 Int32 Width = 0 , Height = 0 , NumComponents = 0 ;
311- Uint8* pFloatData = stbi_load_from_memory (static_cast < const Uint8*>( pSrcTgaBits->GetConstDataPtr () ), static_cast <Int32>(pSrcTgaBits->GetSize ()), &Width, &Height, &NumComponents, 0 );
311+ Uint8* pFloatData = stbi_load_from_memory (pSrcTgaBits->GetConstDataPtr <stbi_uc>( ), static_cast <Int32>(pSrcTgaBits->GetSize ()), &Width, &Height, &NumComponents, 0 );
312312 if (pFloatData == nullptr )
313313 {
314314 LOG_ERROR_MESSAGE (" Failed to load TGA image from memory" );
@@ -657,7 +657,7 @@ IMAGE_FILE_FORMAT CreateImageFromFile(const Char* FilePath,
657657 auto pFileData = DataBlobImpl::Create ();
658658 pFileStream->ReadBlob (pFileData);
659659
660- ImgFileFormat = Image::GetFileFormat (static_cast < const Uint8*>(pFileData-> GetDataPtr () ), pFileData->GetSize (), FilePath);
660+ ImgFileFormat = Image::GetFileFormat (pFileData-> GetConstDataPtr < Uint8>( ), pFileData->GetSize (), FilePath);
661661 if (ImgFileFormat == IMAGE_FILE_FORMAT_UNKNOWN)
662662 {
663663 LOG_ERROR_AND_THROW (" Unable to derive image format for file '" , FilePath, " \" ." );
0 commit comments