summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2024-06-10 16:22:12 -0700
committerBrad Linden <brad@lindenlab.com>2024-06-10 16:22:12 -0700
commit7c42711ca3a4e67b95473aa5129dce5ff19bea15 (patch)
tree593c0bedf07bffc79ec4640b157839edf61260f5 /indra/llimage
parente0e6e7fd747121442370fc811c84aa34ed612f64 (diff)
parent9f6b8484dfb7dfa981d8a8ac3693d3f68e32bc12 (diff)
Merge remote-tracking branch 'origin/DRTVWR-600-maint-A' into project/gltf_development
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagedxt.cpp2
-rw-r--r--indra/llimage/llimagefilter.cpp28
-rw-r--r--indra/llimage/llimagetga.cpp6
-rw-r--r--indra/llimage/llpngwrapper.cpp4
4 files changed, 20 insertions, 20 deletions
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index 89299258a6..6b960f9077 100644
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
@@ -476,7 +476,7 @@ bool LLImageDXT::convertToDXR()
// virtual
S32 LLImageDXT::calcHeaderSize()
{
- return llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t));
+ return static_cast<S32>(llmax(sizeof(dxtfile_header_old_t), sizeof(dxtfile_header_t)));
}
// virtual
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index db21f50b95..0d15906afd 100644
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -781,9 +781,9 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
// Compute min and max counts minus tail
tail = llclampf(tail);
- S32 total = cumulated_histo[255];
- S32 min_c = (S32)((F32)(total) * tail);
- S32 max_c = (S32)((F32)(total) * (1.0 - tail));
+ U32 total = cumulated_histo[255];
+ U32 min_c = (U32)((F32)(total) * tail);
+ U32 max_c = (U32)((F32)(total) * (1.0 - tail));
// Find min and max values
S32 min_v = 0;
@@ -798,9 +798,9 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
}
// Compute linear lookup table
- U8 linear_red_lut[256];
- U8 linear_green_lut[256];
- U8 linear_blue_lut[256];
+ U8 linear_red_lut[256]{};
+ U8 linear_green_lut[256]{};
+ U8 linear_blue_lut[256]{};
if (max_v == min_v)
{
// Degenerated binary split case
@@ -850,16 +850,16 @@ void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
}
// Compute deltas
- S32 total = cumulated_histo[255];
- S32 delta_count = total / nb_classes;
- S32 current_count = delta_count;
- S32 delta_value = 256 / (nb_classes - 1);
- S32 current_value = 0;
+ U32 total = cumulated_histo[255];
+ U32 delta_count = total / nb_classes;
+ U32 current_count = delta_count;
+ U32 delta_value = 256 / (nb_classes - 1);
+ U32 current_value = 0;
// Compute equalized lookup table
- U8 equalize_red_lut[256];
- U8 equalize_green_lut[256];
- U8 equalize_blue_lut[256];
+ U8 equalize_red_lut[256]{};
+ U8 equalize_green_lut[256]{};
+ U8 equalize_blue_lut[256]{};
for (S32 i = 0; i < 256; i++)
{
// Blend in current_value with alpha values
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index b168f343e7..25232b77aa 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -467,7 +467,7 @@ bool LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, bool &alpha_opaqu
S32 pixels = getWidth() * getHeight();
- if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - mDataOffset)
+ if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - (S32)mDataOffset)
{ //here we have situation when data size in src less than actually needed
return false;
}
@@ -1179,7 +1179,7 @@ bool LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight
// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const std::string& path )
{
- S32 len = path.size();
+ auto len = path.size();
if( len < 5 )
{
return false;
@@ -1206,7 +1206,7 @@ bool LLImageTGA::loadFile( const std::string& path )
}
U8* buffer = allocateData(file_size);
- S32 bytes_read = fread(buffer, 1, file_size, file);
+ S32 bytes_read = static_cast<S32>(fread(buffer, 1, file_size, file));
if( bytes_read != file_size )
{
deleteData();
diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp
index a5fb7a3167..79c201b1f4 100644
--- a/indra/llimage/llpngwrapper.cpp
+++ b/indra/llimage/llpngwrapper.cpp
@@ -328,10 +328,10 @@ bool LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSiz
mWriteInfoPtr = png_create_info_struct(mWritePngPtr);
// Setup write function
- PngDataInfo dataPtr;
+ PngDataInfo dataPtr{};
dataPtr.mData = dest;
dataPtr.mOffset = 0;
- dataPtr.mDataSize = destSize;
+ dataPtr.mDataSize = static_cast<S32>(destSize);
png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush);
// Setup image params