Commit 13eed5c5 authored by zmoelnig's avatar zmoelnig
Browse files

more c++casts

git-svn-id: https://pd-gem.svn.sourceforge.net/svnroot/pd-gem/trunk/Gem@3074 49b2a0ca-c541-4d49-a7ef-d785e4371512
parent 955bbb90
......@@ -169,19 +169,21 @@ bool filmQT :: open(char*filename, int format) {
m_curFrame = -1;
m_numTracks = (int)GetMovieTrackCount(m_movie);
m_numTracks = static_cast<int>(GetMovieTrackCount(m_movie));
// Get the length of the movie
movieDur = (long)GetMovieDuration(m_movie);
movieScale = (long)GetMovieTimeScale(m_movie);
movieDur = static_cast<long>(GetMovieDuration(m_movie));
movieScale = static_cast<long>(GetMovieTimeScale(m_movie));
whichMediaType = VisualMediaCharacteristic;
// shouldn't the flags be OR'ed instead of ADDed ? (jmz)
flags = nextTimeMediaSample | nextTimeEdgeOK;
GetMovieNextInterestingTime( m_movie, flags, (TimeValue)1, &whichMediaType, 0,
(Fixed)1<<16, NULL, &duration);
GetMovieNextInterestingTime( m_movie, flags,
static_cast<TimeValue>(1),
&whichMediaType, 0,
static_cast<Fixed>(1<<16), NULL, &duration);
m_numFrames = movieDur/duration;
// Get the bounds for the movie
......@@ -281,7 +283,7 @@ int filmQT :: changeImage(int imgNum, int trackNum){
* this is good because the decoder-class need not care about auto-play anylonger
* this is bad, because we might do it more sophisticated in the decoder-class
*/
m_movieTime = (long)(m_curFrame * duration);
m_movieTime = static_cast<long>(m_curFrame * duration);
return FILM_ERROR_SUCCESS;
}
......
......@@ -89,9 +89,9 @@ static void sum_leaf_centers( FidtrackerX *ft, FidSegRegion *r, int width, int h
y = ((r->top + r->bottom) * .5f);
if( ft->pixelwarp ){
int xx = (int)x;
int xx = static_cast<int>(x);
float xf = x - xx;
int yy = (int)y;
int yy = static_cast<int>(y);
float yf = y - yy;
// bilinear interpolated pixel warp
......@@ -142,8 +142,9 @@ static void sum_leaf_centers( FidtrackerX *ft, FidSegRegion *r, int width, int h
int _USERENTRY depth_string_cmp(const void *a, const void *b)
{
FidSegRegion **aa = (FidSegRegion**)a;
FidSegRegion **bb = (FidSegRegion**)b;
// FIXXME const_cast supidness
const FidSegRegion **aa = reinterpret_cast<const FidSegRegion**>(const_cast<void*>(a));
const FidSegRegion **bb = reinterpret_cast<const FidSegRegion**>(const_cast<void*>(b));
if( !(*aa)->depth_string ){
if( !(*bb)->depth_string )
......@@ -168,7 +169,7 @@ static char *build_left_heavy_depth_string( FidtrackerX *ft, FidSegRegion *r )
assert( ft->next_depth_string < ft->depth_string_count );
result = &ft->depth_strings[ ft->depth_string_length * (ft->next_depth_string++) ];
result[0] = (char)('0' + r->depth);
result[0] = static_cast<char>('0' + r->depth);
result[1] = '\0';
p = &result[1];
......@@ -247,15 +248,15 @@ static void compute_fiducial_statistics( FidtrackerX *ft, FiducialX *f,
sum_leaf_centers( ft, r, width, height );
all_x = (double)(ft->black_x_sum + ft->white_x_sum) / (double)(ft->black_leaf_count + ft->white_leaf_count);
all_y = (double)(ft->black_y_sum + ft->white_y_sum) / (double)(ft->black_leaf_count + ft->white_leaf_count);
all_x = static_cast<double>(ft->black_x_sum + ft->white_x_sum) / static_cast<double>(ft->black_leaf_count + ft->white_leaf_count);
all_y = static_cast<double>(ft->black_y_sum + ft->white_y_sum) / static_cast<double>(ft->black_leaf_count + ft->white_leaf_count);
black_x = (double)ft->black_x_sum / (double)ft->black_leaf_count;
black_y = (double)ft->black_y_sum / (double)ft->black_leaf_count;
black_x = static_cast<double>(ft->black_x_sum) / static_cast<double>(ft->black_leaf_count);
black_y = static_cast<double>(ft->black_y_sum) / static_cast<double>(ft->black_leaf_count);
f->x = (float)all_x;
f->y = (float)all_y;
f->angle = (float)((M_PI * 2) - calculate_angle( all_x - black_x, all_y - black_y ));
f->x = static_cast<float>(all_x);
f->y = static_cast<float>(all_y);
f->angle = static_cast<float>((M_PI * 2) - calculate_angle( all_x - black_x, all_y - black_y ));
/*
print_unordered_depth_string( r );
......@@ -271,7 +272,7 @@ static void compute_fiducial_statistics( FidtrackerX *ft, FiducialX *f,
ft->next_depth_string = 0;
depth_string = build_left_heavy_depth_string( ft, r );
ft->temp_coloured_depth_string[0] = (char)( r->colour ? 'w' : 'b' );
ft->temp_coloured_depth_string[0] = ( r->colour ? 'w' : 'b' );
ft->temp_coloured_depth_string[1] = '\0';
strcat( ft->temp_coloured_depth_string, depth_string );
......@@ -294,7 +295,7 @@ static void compute_fiducial_statistics( FidtrackerX *ft, FiducialX *f,
static void set_depth( FidSegRegion *r, short depth )
{
int i;
short child_depth = (short)(depth + 1);
short child_depth = static_cast<short>(depth + 1);
r->depth = depth;
......@@ -355,8 +356,8 @@ static void propagate_descendent_count_and_max_depth_upwards(
assert( r1_adjacent_contains_r2( adjacent, r ) );
if( adjacent->level == TRAVERSED ){
r->descendent_count += (short)(adjacent->descendent_count + 1);
r->depth = (short)MAX( r->depth, (adjacent->depth + 1) );
r->descendent_count += static_cast<short>(adjacent->descendent_count + 1);
r->depth = static_cast<short>(MAX( r->depth, (adjacent->depth + 1) ));
}else{
assert( parent == 0 );
parent = adjacent;
......
......@@ -70,8 +70,8 @@ static FidSegRegionReference* new_region( Segmenter *s, int x, int y, int colour
r->colour = colour;
r->left = r->right = (short)x;
r->top = r->bottom = (short)y;
r->left = r->right = static_cast<short>(x);
r->top = r->bottom = static_cast<short>(y);
r->flags = NO_REGION_FLAG;
......@@ -371,11 +371,11 @@ static void build_regions( Segmenter *s, const unsigned char *source, int width,
}else{ // source_image_[i] != source_image_[i-1]
if( current_row[x-1]->region->right < x - 1 )
current_row[x-1]->region->right = (short)( x - 1 );
current_row[x-1]->region->right = static_cast<short>( x - 1 );
if( source[i] == previous_row[x]->region->colour ){
current_row[x] = previous_row[x];
current_row[x]->region->bottom = (short)y;
current_row[x]->region->bottom = static_cast<short>(y);
}else{
current_row[x] = new_region( s, x, y, source[i] );
......
......@@ -19,7 +19,7 @@
static int find_maximum_tree_depth( const std::string& s )
{
int result = 0;
for( int i=1; i < (int)s.size(); ++i ){ // skip first character which is the black/white flag
for( std::string::size_type i=1; i < s.size(); ++i ){ // skip first character which is the black/white flag
int d = s[i] - '0';
if( d > result )
......@@ -36,7 +36,7 @@ static int find_maximum_descendent_count( const std::string& s )
std::vector<int> adjacenciesAtLevel( s.size(), 0 );
int currentLevel = 0;
for( int i=1; i < (int)s.size(); ++i ){ // skip first character which is the black/white flag
for( std::string::size_type i=1; i < s.size(); ++i ){ // skip first character which is the black/white flag
int d = s[i] - '0';
......@@ -117,14 +117,14 @@ public:
if( s.empty() )
continue;
int depthSequenceLength;
int depthSequenceLength;
// ensure that the depth sequence has a root colour prefix
// of 'w' (white) or 'b' (black). if not, prepend one.
if( s[0] == 'w' || s[0] == 'b' ){
depthSequenceLength = (int)( s.size() - 1 );
depthSequenceLength = ( s.size() - 1 );
}else{
depthSequenceLength = (int)( s.size() );
depthSequenceLength = ( s.size() );
s = 'w' + s;
}
......@@ -168,7 +168,7 @@ public:
~TreeIdMapImplementation()
{
while( !strings_.empty() ){
delete [] (char*)strings_.back();
delete [] reinterpret_cast<const char*>(strings_.back());
strings_.pop_back();
}
}
......@@ -191,12 +191,12 @@ void initialize_treeidmap_from_file( TreeIdMap* treeidmap, const char *file_name
void terminate_treeidmap( TreeIdMap* treeidmap )
{
delete (TreeIdMapImplementation*)treeidmap->implementation_;
delete static_cast<TreeIdMapImplementation*>(treeidmap->implementation_);
treeidmap->implementation_ = 0;
}
// returns -1 for unfound id
int treestring_to_id( TreeIdMap* treeidmap, const char *treestring )
{
return ((TreeIdMapImplementation*)treeidmap->implementation_)->treestring_to_id( treestring );
return (static_cast<TreeIdMapImplementation*>(treeidmap->implementation_))->treestring_to_id( treestring );
}
......@@ -30,7 +30,7 @@ CPPEXTERN_NEW_WITH_ONE_ARG(pix_a_2grey, t_floatarg, A_DEFFLOAT)
/////////////////////////////////////////////////////////
pix_a_2grey :: pix_a_2grey(t_floatarg alpha)
{
m_mode = (int)(alpha * 255.f);
m_mode = static_cast<int>(alpha * 255.f);
inlet_new(this->x_obj, &this->x_obj->ob_pd, gensym("float"), gensym("ft1"));
}
......@@ -52,7 +52,7 @@ void pix_a_2grey :: alphaMess(float alphaval)
if (alphaval < -1.f)
alphaval = -1.f;
m_mode = (int)(alphaval*255.f);
m_mode = static_cast<int>(alphaval*255.f);
setPixModified();
}
......@@ -104,5 +104,5 @@ void pix_a_2grey :: obj_setupCallback(t_class *classPtr)
void pix_a_2grey :: alphaMessCallback(void *data, t_floatarg alphaval)
{
GetMyClass(data)->alphaMess((float)alphaval);
GetMyClass(data)->alphaMess(alphaval);
}
......@@ -71,9 +71,9 @@ void pix_add :: processRGBA_Gray(imageStruct &image, imageStruct &right)
while(datasize--) {
register int alpha = *rightPix++;
leftPix[chRed] = CLAMP_HIGH((int)leftPix[chRed] + alpha);
leftPix[chGreen] = CLAMP_HIGH((int)leftPix[chGreen] + alpha);
leftPix[chBlue] = CLAMP_HIGH((int)leftPix[chBlue] + alpha);
leftPix[chRed] = CLAMP_HIGH(leftPix[chRed] + alpha);
leftPix[chGreen] = CLAMP_HIGH(leftPix[chGreen] + alpha);
leftPix[chBlue] = CLAMP_HIGH(leftPix[chBlue] + alpha);
leftPix += 4;
}
}
......@@ -109,8 +109,8 @@ void pix_add :: processYUV_YUV(imageStruct &image, imageStruct &right)
#ifdef __MMX__
void pix_add :: processRGBA_MMX(imageStruct &image, imageStruct &right){
int datasize = image.xsize * image.ysize * image.csize;
__m64*leftPix = (__m64*)image.data;
__m64*rightPix = (__m64*)right.data;
__m64*leftPix = reinterpret_cast<__m64*>(image.data);
__m64*rightPix = reinterpret_cast<__m64*>(right.data);
datasize=datasize/sizeof(__m64)+(datasize%sizeof(__m64)!=0);
......@@ -124,8 +124,8 @@ void pix_add :: processRGBA_MMX(imageStruct &image, imageStruct &right){
}
void pix_add :: processYUV_MMX (imageStruct &image, imageStruct &right){
int datasize = image.xsize * image.ysize * image.csize;
__m64*leftPix = (__m64*)image.data;
__m64*rightPix = (__m64*)right.data;
__m64*leftPix = reinterpret_cast<__m64*>(image.data);
__m64*rightPix = reinterpret_cast<__m64*>(right.data);
datasize=datasize/sizeof(__m64)+(datasize%sizeof(__m64)!=0);
__m64 mask = _mm_setr_pi8(0x40, 0x00, 0x40, 0x00,
......@@ -206,52 +206,51 @@ void pix_add :: processYUV_Altivec(imageStruct &image, imageStruct &right)
//Load it into the vector unit
d = shortBuffer.v;
d = (vector signed short)vec_splat((vector signed short)d,0);
#ifndef PPC970
UInt32 prefetchSize = GetPrefetchConstant( 16, 1, 256 );
vec_dst( inData, prefetchSize, 0 );
vec_dst( rightData, prefetchSize, 1 );
#endif
d = static_cast<vector signed short>(vec_splat(static_cast<vector signed short>(d),0));
#ifndef PPC970
UInt32 prefetchSize = GetPrefetchConstant( 16, 1, 256 );
vec_dst( inData, prefetchSize, 0 );
vec_dst( rightData, prefetchSize, 1 );
#endif
for ( h=0; h<image.ysize; h++){
for (w=0; w<width; w++)
for (w=0; w<width; w++)
{
#ifndef PPC970
vec_dst( inData, prefetchSize, 0 );
vec_dst( rightData, prefetchSize, 1 );
#endif
//interleaved U Y V Y chars
#ifndef PPC970
vec_dst( inData, prefetchSize, 0 );
vec_dst( rightData, prefetchSize, 1 );
#endif
//interleaved U Y V Y chars
//vec_mule UV * 2 to short vector U V U V shorts
UVImage = (vector signed short)vec_mule(one,inData[0]);
UVRight = (vector signed short)vec_mule(c,rightData[0]);
//vec_mule UV * 2 to short vector U V U V shorts
UVImage = static_cast<vector signed short>(vec_mule(one,inData[0]));
UVRight = static_cast<vector signed short>(vec_mule(c,rightData[0]));
//vec_mulo Y * 1 to short vector Y Y Y Y shorts
YImage = (vector signed short)vec_mulo(c,inData[0]);
YRight = (vector signed short)vec_mulo(c,rightData[0]);
//vec_mulo Y * 1 to short vector Y Y Y Y shorts
YImage = static_cast<vector signed short>(vec_mulo(c,inData[0]));
YRight = static_cast<vector signed short>(vec_mulo(c,rightData[0]));
//vel_subs UV - 255
UVRight = static_cast<vector signed short>(vec_subs(UVRight, d));
//vel_subs UV - 255
UVRight = (vector signed short)vec_subs(UVRight, d);
//vec_adds UV
UVTemp = vec_adds(UVImage,UVRight);
//vec_adds UV
UVTemp = vec_adds(UVImage,UVRight);
//vec_adds Y
YTemp = vec_adds(YImage,YRight);
//vec_adds Y
YTemp = vec_adds(YImage,YRight);
hiImage = vec_mergeh(UVTemp,YTemp);
loImage = vec_mergel(UVTemp,YTemp);
hiImage = vec_mergeh(UVTemp,YTemp);
loImage = vec_mergel(UVTemp,YTemp);
//vec_mergel + vec_mergeh Y and UV
inData[0] = vec_packsu(hiImage, loImage);
//vec_mergel + vec_mergeh Y and UV
inData[0] = vec_packsu(hiImage, loImage);
inData++;
rightData++;
inData++;
rightData++;
}
#ifndef PPC970
#ifndef PPC970
vec_dss( 0 );
vec_dss( 1 );
#endif
#endif
} /*end of working altivec function */
}
void pix_add :: processRGBA_Altivec(imageStruct &image, imageStruct &right)
......@@ -310,7 +309,7 @@ void pix_add :: processDualImage(imageStruct &image, imageStruct &right){
leftPix+=8;rightPix+=8;
}
while(restsize--){
*leftPix = CLAMP_HIGH((int)(*leftPix + *rightPix));
*leftPix = CLAMP_HIGH(static_cast<int>(*leftPix + *rightPix));
leftPix++; rightPix++;
}
}
......
......@@ -115,12 +115,12 @@ void pix_biquad :: processRGBAImage(imageStruct &image)
// fast, because calculations are done in int !
int ifb0,ifb1,ifb2,iff1,iff2,iff3;
int ioutput;
ifb0 = (int)(256. * fb0);
ifb1 = (int)(256. * fb1);
ifb2 = (int)(256. * fb2);
iff1 = (int)(256. * ff1);
iff2 = (int)(256. * ff2);
iff3 = (int)(256. * ff3);
ifb0 = static_cast<int>(256. * fb0);
ifb1 = static_cast<int>(256. * fb1);
ifb2 = static_cast<int>(256. * fb2);
iff1 = static_cast<int>(256. * ff1);
iff2 = static_cast<int>(256. * ff2);
iff3 = static_cast<int>(256. * ff3);
int max=0;//JMZ
......@@ -173,12 +173,12 @@ void pix_biquad :: processYUVImage(imageStruct &image)
// fast, because calculations are done in int !
int ifb0,ifb1,ifb2,iff1,iff2,iff3;
int Youtput,UVoutput,Youtput1,UVoutput1;
ifb0 = (int)(256. * fb0);
ifb1 = (int)(256. * fb1);
ifb2 = (int)(256. * fb2);
iff1 = (int)(256. * ff1);
iff2 = (int)(256. * ff2);
iff3 = (int)(256. * ff3);
ifb0 = static_cast<int>(256. * fb0);
ifb1 = static_cast<int>(256. * fb1);
ifb2 = static_cast<int>(256. * fb2);
iff1 = static_cast<int>(256. * ff1);
iff2 = static_cast<int>(256. * ff2);
iff3 = static_cast<int>(256. * ff3);
//it's unrolled but GCC still can't schedule this well at all
//needs some manual scheduling...
......@@ -643,5 +643,5 @@ void pix_biquad :: setMessCallback(void *data)
void pix_biquad :: modeMessCallback(void *data, float value)
{
GetMyClass(data)->m_mode = (int)value;
GetMyClass(data)->m_mode = static_cast<int>(value);
}
......@@ -79,7 +79,6 @@ void pix_blob :: processRGBAImage(imageStruct &image)
float gain_r = 0.3, gain_g = 0.3, gain_b = 0.3, gain_a = 0.1;
float sum = 0.0, sum_x = 0.0, sum_y = 0.0;
float /*blob_x = 0., blob_y = 0.,*/ blob_z = 0.;
switch (m_method) {
case 1:
......@@ -130,7 +129,6 @@ void pix_blob :: processRGBAImage(imageStruct &image)
}
}
blob_z = sum;
outlet_float(m_zOut, sum/(image.xsize*image.ysize*255*(gain_r+gain_g+gain_b+gain_a)));
if (sum) {
outlet_float(m_yOut, 1 - sum_y/(image.ysize*sum));
......@@ -142,8 +140,9 @@ void pix_blob :: processGrayImage(imageStruct &image)
unsigned char *pixels = image.data;
int rows = image.ysize;
float sum = 0.0, sum_x = 0.0, sum_y = 0.0;
float /*blob_x = 0., blob_y = 0.,*/ blob_z = 0.;
// float sum = 0.0, sum_x = 0.0, sum_y = 0.0;
int sum = 0, sum_x = 0, sum_y = 0;
while (rows--) {
int cols = image.xsize;
while (cols--) {
......@@ -154,11 +153,13 @@ void pix_blob :: processGrayImage(imageStruct &image)
}
}
blob_z = sum;
outlet_float(m_zOut, sum/(image.xsize*image.ysize*255));
t_float sumf=sum/(image.xsize*image.ysize*255.);
outlet_float(m_zOut, sumf);
if (sum) {
outlet_float(m_yOut, 1 - sum_y/(image.ysize*sum));
outlet_float(m_xOut, 1 - sum_x/(image.xsize*sum));
t_float sumxf=(static_cast<t_float>(sum_x)/(sum*image.xsize));
t_float sumyf=(static_cast<t_float>(sum_y)/(sum*image.ysize));
outlet_float(m_yOut, 1 - sumyf);
outlet_float(m_xOut, 1 - sumxf);
}
}
void pix_blob :: processYUVImage(imageStruct &image)
......@@ -166,9 +167,7 @@ void pix_blob :: processYUVImage(imageStruct &image)
unsigned char *pixels = image.data;
int rows = image.ysize;
//float sum = 0.0, sum_x = 0.0, sum_y = 0.0;
int sum = 0, sum_x = 0,sum_y = 0;
//float /*blob_x = 0., blob_y = 0.,*/ blob_z = 0.;
int sum = 0, sum_x = 0,sum_y = 0;
while (rows--) {
int cols = image.xsize;
while (cols--) {
......@@ -180,12 +179,15 @@ void pix_blob :: processYUVImage(imageStruct &image)
}
}
// blob_z = sum;
outlet_float(m_zOut, (float)sum/(float)(image.xsize*image.ysize*255));
t_float sumf=sum/(image.xsize*image.ysize*255.);
outlet_float(m_zOut, sumf);
if (sum) {
outlet_float(m_yOut, 1 - (float)sum_y/(float)(image.ysize*sum));
outlet_float(m_xOut, 1 - (float)sum_x/(float)(image.xsize*sum));
t_float sumxf=(static_cast<t_float>(sum_x)/(sum*image.xsize));
t_float sumyf=(static_cast<t_float>(sum_y)/(sum*image.ysize));
outlet_float(m_yOut, 1 - sumyf);
outlet_float(m_xOut, 1 - sumxf);
}
}
/////////////////////////////////////////////////////////
......
......@@ -70,8 +70,8 @@ void pix_blur :: processRGBAImage(imageStruct &image)
saved = new unsigned int [m_blurSize];
}
rightGain = (int)(m_blurf * 255.);
imageGain = (int)(255. - (m_blurf * 255.));
rightGain = static_cast<int>(m_blurf * 255.);
imageGain = static_cast<int>(255. - (m_blurf * 255.));
hlength = image.xsize;
......@@ -109,8 +109,8 @@ void pix_blur :: processGrayImage(imageStruct &image)
saved = new unsigned int [m_blurSize];
}
rightGain = (int)(m_blurf * 255.);
imageGain = (int)(255. - (m_blurf * 255.));
rightGain = static_cast<int>(m_blurf * 255.);
imageGain = static_cast<int>(255. - (m_blurf * 255.));
src=m_blurH*m_blurW;
while(src--){
Grey = ((pixels[src+chGray] * imageGain)) + ((saved[src+chGray] * rightGain));
......@@ -176,8 +176,8 @@ return;
register int rightGain,imageGain;
register int y1res,y2res;
src = 0;
rightGain = (int)(m_blurf * 255.);
imageGain = (int)(255. - (m_blurf * 255.));
rightGain = static_cast<int>(m_blurf * 255.);
imageGain = static_cast<int>(255. - (m_blurf * 255.));
hlength = image.xsize/2;
//unroll this, add register temps and schedule the ops better to remove the data depedencies
......@@ -193,14 +193,14 @@ for (h=0; h<image.ysize-1; h++){
image.data[src+1] =(unsigned char)CLAMP(y1res);
image.data[src+1] =static_cast<unsigned char>(CLAMP(y1res));
saved[src+3] = y2res;
y2res = y2res >> 8;
image.data[src+3] = (unsigned char)CLAMP(y2res);
image.data[src+3] = static_cast<unsigned char>(CLAMP(y2res));
src+=4;
}
......@@ -402,8 +402,6 @@ void pix_blur :: obj_setupCallback(t_class *classPtr)
void pix_blur :: blurCallback(void *data, t_floatarg value)
{
// GetMyClass(data)->m_blur=((long)value);
GetMyClass(data)->m_blurf=(value);
GetMyClass(data)->m_blurf=(value);
}
......@@ -101,16 +101,16 @@ void pix_colorreduce :: processRGBAImage(imageStruct &image)
Pete_ColorReduce_Init();
init = 1;
}
pSource = (U32*)image.data;
pSource = reinterpret_cast<U32*>(image.data);
myImage.xsize = image.xsize;
myImage.ysize = image.ysize;
myImage.csize = image.csize;
myImage.type = image.type;
myImage.reallocate();
pOutput = (U32*)myImage.data;
pOutput = reinterpret_cast<U32*>(myImage.data);
const int nColors=(int)m_TargetColorCount;
const int nColors=static_cast<int>(m_TargetColorCount);
const float PalettePersistence=m_PalettePersistence;
const float BoundarySmoothing=m_BoundarySmoothing;
......@@ -278,15 +278,15 @@ inline U32 pix_colorreduce :: Pete_ColorReduce_GetClosestColor(U32 Color,SPete_C
const float OneMinusLerpValue=(1.0f-WeightedLerpValue);
const int nSmoothedRed=(int)(
const int nSmoothedRed=static_cast<int>(
(nClosestRed*WeightedLerpValue)+
(nNextClosestRed*OneMinusLerpValue));
const int nSmoothedGreen=(int)(
const int nSmoothedGreen=static_cast<int>(
(nClosestGreen*WeightedLerpValue)+
(nNextClosestGreen*OneMinusLerpValue));
const int nSmoothedBlue=(int)(
const int nSmoothedBlue=static_cast<int>(
(nClosestBlue*WeightedLerpValue)+
(nNextClosestBlue*OneMinusLerpValue));