Skip to content

Commit

Permalink
fixed min/max type-o and changed m_pi to PiConst
Browse files Browse the repository at this point in the history
  • Loading branch information
kablammyman committed Mar 6, 2017
1 parent a264b79 commit 38b59d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions EtcLib/Etc/EtcFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Etc
{

static const double M_PI = 3.14159265358979323846;
static const double PiConst = 3.14159265358979323846;

inline double sinc(double x)
{
Expand All @@ -15,7 +15,7 @@ inline double sinc(double x)
return 1.0;
}

return sin(M_PI * x) / (M_PI * x);
return sin(PiConst * x) / (PiConst * x);
}

//inline float sincf( float x )
Expand Down Expand Up @@ -296,10 +296,10 @@ int FilterTwoPass( RGBCOLOR *pSrcImage, int srcWidth, int srcHeight,
}

pPixel = pDestImage + (iRow * destWidth) + iCol;
pPixel->rgba[0] = (unsigned char)(__max( 0, __min( 255.0, dRed)));
pPixel->rgba[1] = (unsigned char)(__max( 0, __min( 255.0, dGreen)));
pPixel->rgba[2] = (unsigned char)(__max( 0, __min( 255.0, dBlue)));
pPixel->rgba[3] = (unsigned char)(__max( 0, __min( 255.0, dAlpha)));
pPixel->rgba[0] = (unsigned char)(std::max( 0.0, std::min( 255.0, dRed)));
pPixel->rgba[1] = (unsigned char)(std::max( 0.0, std::min( 255.0, dGreen)));
pPixel->rgba[2] = (unsigned char)(std::max( 0.0, std::min( 255.0, dBlue)));
pPixel->rgba[3] = (unsigned char)(std::max( 0.0, std::min( 255.0, dAlpha)));
}
}

Expand Down
6 changes: 3 additions & 3 deletions EtcTool/EtcSourceImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ namespace Etc
{
unsigned char* paucPixels = nullptr;

int iWidth;
int iHeight;
int iBitsPerPixel;
int iWidth = 0;
int iHeight = 0;
bool bool16BitImage = false;

#if USE_STB_IMAGE_LOAD
int iBitsPerPixel;
//if stb_iamge is available, only use it to load files other than png
char *fileExt = strrchr(m_pstrFilename, '.');

Expand Down

0 comments on commit 38b59d0

Please sign in to comment.