/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
if(asset)
{
length = AAsset_getLength(asset);
- memblock.Resize(length + 1); // 1 for extra zero at the end
+ memblock.ResizeUninitialized(length + 1);
+ memblock[length] = 0; // 1 for extra zero at the end
char* buffer = reinterpret_cast<char*>(memblock.Begin());
errorCode = (AAsset_read(asset, buffer, length) != length) ? 0 : 1;
{
fseek(file, 0, SEEK_END);
length = ftell(file);
- //Dali::Vector.Resize would lead to calling PushBack for each byte, waste of CPU resource
memblock.ResizeUninitialized(length + 1);
//put last byte as 0, in case this is a text file without null-terminator
memblock[length] = 0;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
{
fileSize = file->tellg();
- memblock.Resize(fileSize);
+ memblock.ResizeUninitialized(fileSize);
file->seekg(0, std::ios::beg);
file->read(reinterpret_cast<char*>(memblock.Begin()), fileSize);
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
{
dataSize += chunks[i].data.capacity();
}
- dataBuffer.Resize(dataSize);
+ dataBuffer.ResizeUninitialized(dataSize);
size_t offset = 0;
for(size_t i = 0; i < chunks.size(); ++i)
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#else
if(tjDecompressHeader2(jpeg.get(), jpegBufferPtr, jpegBufferSize, &preXformImageWidth, &preXformImageHeight, &chrominanceSubsampling) == -1)
{
- //DALI_LOG_ERROR("%s\n", tjGetErrorStr());
+ DALI_LOG_ERROR("%s\n", tjGetErrorStr());
// Do not set width and height to 0 or return early as this sometimes fails only on determining subsampling type.
}
#endif
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.