Skip to content

Commit 1f0fdb2

Browse files
committed
Fix { and address code review comments
Signed-off-by: Rosie Wang <yywang324@gmail.com>
1 parent 5befeb7 commit 1f0fdb2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/OpenColorIO/GpuShaderUtils.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,12 @@ std::string getMatrixValues(const T * mtx, GpuLanguage lang, bool transpose)
223223
}
224224

225225

226-
void RGBtoRGBATexture(const float* lutValues, int valueCount, std::vector<float>& float4AdaptedLutValues){
226+
void RGBtoRGBATexture(const float* lutValues, int valueCount, std::vector<float>& float4AdaptedLutValues)
227+
{
227228
if(valueCount % 3 != 0)
229+
{
228230
throw Exception("Value count should be divisible by 3.");
231+
}
229232

230233
valueCount = valueCount * 4 / 3;
231234
if(lutValues != nullptr)
@@ -235,7 +238,8 @@ void RGBtoRGBATexture(const float* lutValues, int valueCount, std::vector<float>
235238
float *rgbaLutValuesIt = float4AdaptedLutValues.data();
236239
const float *end = rgbaLutValuesIt + valueCount;
237240

238-
while(rgbaLutValuesIt != end) {
241+
while(rgbaLutValuesIt != end)
242+
{
239243
*rgbaLutValuesIt++ = *rgbLutValuesIt++;
240244
*rgbaLutValuesIt++ = *rgbLutValuesIt++;
241245
*rgbaLutValuesIt++ = *rgbLutValuesIt++;

src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ void GetLut1DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator,
186186
CreatePaddedLutChannels(width, height, lutData->getArray().getValues(), values);
187187
channel = GpuShaderCreator::TEXTURE_RGB_CHANNEL;
188188
break;
189-
case 4: {
189+
case 4:
190+
{
190191
std::vector<float> paddedChannels;
191-
values.reserve(width * height * 3);
192+
paddedChannels.reserve(width * height * 3);
192193
CreatePaddedLutChannels(width, height, lutData->getArray().getValues(), paddedChannels);
193194
// Insert a place holder alpha channel with value of 1. This is to support RGBA
194195
// texture format for Metal shading language.

0 commit comments

Comments
 (0)