Skip to content

Commit

Permalink
Merge master back into HeaderRefactor
Browse files Browse the repository at this point in the history
Lots of changes went on in this change set - mainly to do with warnings as errors. Currently the TEST project does not compile, but the rest do.
  • Loading branch information
SimonCSmith committed Mar 16, 2023
1 parent acbc694 commit e5be8c2
Show file tree
Hide file tree
Showing 108 changed files with 744 additions and 714 deletions.
4 changes: 2 additions & 2 deletions ChartCtrl/ChartCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void CChartCtrl::OnPaint()
}
}

BOOL CChartCtrl::OnEraseBkgnd(CDC* pDC)
BOOL CChartCtrl::OnEraseBkgnd([[maybe_unused]] CDC* pDC)
{
// To avoid flickering
// return CWnd::OnEraseBkgnd(pDC);
Expand Down Expand Up @@ -406,7 +406,7 @@ CDC* CChartCtrl::GetDC()
return &m_BackgroundDC;
}

void CChartCtrl::ReleaseDC(CDC* pDC)
void CChartCtrl::ReleaseDC([[maybe_unused]]CDC* pDC)
{
//CWnd::ReleaseDC(pDC);
// delete pDC;
Expand Down
2 changes: 1 addition & 1 deletion ChartCtrl/ChartLegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void CChartLegend::Draw(CDC *pDC)
if (!m_bIsVisible)
return;

int YPos = 2;
// int YPos = 2;
int MaxBitmapWidth = 0;
bool bDraw = false;

Expand Down
2 changes: 1 addition & 1 deletion ChartCtrl/ChartSurfaceSerie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int CChartSurfaceSerie::DrawLegend(CDC* pDC, CPoint UpperLeft, int BitmapWidth)
return 0;

//Draw Text
int TextHeigh = pDC->GetTextExtent(m_strSerieName.c_str()).cy;
// int TextHeigh = pDC->GetTextExtent(m_strSerieName.c_str()).cy;
pDC->ExtTextOut(UpperLeft.x+BitmapWidth+6,
UpperLeft.y+1,
ETO_CLIPPED,
Expand Down
1 change: 0 additions & 1 deletion DeepSkyStacker/Bayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ BAYERCOLOR GetBayerColor(size_t baseX, size_t baseY, CFATYPE CFAType, int xOffse
};
};
};
return BAYER_UNKNOWN;
}

//
Expand Down
10 changes: 5 additions & 5 deletions DeepSkyStacker/BitMapFiller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ void BitmapFillerBase::setGrey(bool grey)
this->isGray = grey;
}

void BitmapFillerBase::setWidth(int width)
void BitmapFillerBase::setWidth(int w)
{
this->width = width;
this->width = w;
}

void BitmapFillerBase::setHeight(int height)
void BitmapFillerBase::setHeight(int h)
{
this->height = height;
this->height = h;
if (pProgress != nullptr)
pProgress->Start2(pBitmap->Height());
}
Expand Down Expand Up @@ -128,7 +128,7 @@ size_t NonAvxBitmapFiller::Write(const void* source, const size_t bytesPerPixel,
if (this->isGray)
{
ZASSERTSTATE(bytesPerPixel == this->bytesPerChannel);
constexpr size_t vectorLen = 16;
// constexpr size_t vectorLen = 16;
redBuffer.resize(nrPixels);

if (this->bytesPerChannel == 1)
Expand Down
2 changes: 1 addition & 1 deletion DeepSkyStacker/BitmapExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ void FormatMethod(QString& strText, MULTIBITMAPPROCESSMETHOD Method, double fKap
return;
}

void CYMGToRGB2(double fCyan, double fYellow, double fMagenta, double fGreen2, double& fRed, double& fGreen, double& fBlue)
void CYMGToRGB2(double fCyan, double fYellow, double fMagenta, double, double& fRed, double& fGreen, double& fBlue)
{
double fR, fG, fB;

Expand Down
42 changes: 15 additions & 27 deletions DeepSkyStacker/BitmapPartFile.h
Original file line number Diff line number Diff line change
@@ -1,46 +1,34 @@
#pragma once

class CBitmapPartFile
class CBitmapPartFile final
{
public:
QString m_strFile;
QString m_tempFileName;
int m_lStartRow;
int m_lEndRow;
int m_lWidth;
int m_lNrBitmaps;
int m_lWidth{ 0 };
int m_lNrBitmaps{ 0 };

private:
void CopyFrom(const CBitmapPartFile& bp)
{
m_strFile = bp.m_strFile;
m_tempFileName = bp.m_tempFileName;
m_lStartRow = bp.m_lStartRow;
m_lEndRow = bp.m_lEndRow;
m_lWidth = bp.m_lWidth;
m_lNrBitmaps = bp.m_lNrBitmaps;
};

public:
CBitmapPartFile(const QString& szFile, int lStartRow, int lEndRow)
{
m_strFile = szFile;
m_lStartRow = lStartRow;
m_lEndRow = lEndRow;
m_lWidth = 0;
m_lNrBitmaps = 0;
};

CBitmapPartFile(const CBitmapPartFile& bp)
{
CopyFrom(bp);
};

const CBitmapPartFile& operator= (const CBitmapPartFile& bp)
{
CopyFrom(bp);
return *this;
};
CBitmapPartFile(QString&& tmpFile, const int lStartRow, const int lEndRow) noexcept :
m_tempFileName{ std::move(tmpFile) },
m_lStartRow{ lStartRow },
m_lEndRow{ lEndRow }
{};

virtual ~CBitmapPartFile()
{}
CBitmapPartFile(const CBitmapPartFile&) = default;
CBitmapPartFile(CBitmapPartFile&&) noexcept = default;
CBitmapPartFile& operator=(const CBitmapPartFile&) = default;
CBitmapPartFile& operator=(CBitmapPartFile&&) noexcept = default;
~CBitmapPartFile() = default;
};
typedef std::vector<CBitmapPartFile> BITMAPPARTFILEVECTOR;
4 changes: 2 additions & 2 deletions DeepSkyStacker/ChannelAlign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ std::shared_ptr<CMemoryBitmap> CChannelAlign::AlignChannel(CMemoryBitmap* pBitma

if (pProgress != nullptr)
{
const QString strText(QCoreApplication::translate("ChannelAlign", "Aligning Channel", "IDS_ALIGNINGCHANNEL"));
pProgress->Start2(strText, lHeight);
const QString text(QCoreApplication::translate("ChannelAlign", "Aligning Channel", "IDS_ALIGNINGCHANNEL"));
pProgress->Start2(text, lHeight);
}

for (int j = 0; j < lHeight; j++)
Expand Down
10 changes: 7 additions & 3 deletions DeepSkyStacker/CosmeticEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void CCleanCosmeticTask::process()

for (int col = 0; col < m_lWidth; ++col)
{
bool changed = false;
// bool changed = false;
double delta;
m_pDelta->GetPixel(col, row, delta);
if (delta > 200)
Expand Down Expand Up @@ -298,11 +298,12 @@ void CCleanCosmeticTask::ComputeMedian(int x, int y, int lFilterSize, double& fG
{
// Check that this is a normal pixel
bool bAdd = true;
if (m_CFAType != CFAT_NONE)
if (m_CFAType != CFATYPE_NONE)
bAdd = (GetBayerColor(i, j, m_CFAType) == BayerColor);

if (bAdd)
{
#pragma warning (suppress:4457)
double fGray;
double fDelta;

Expand Down Expand Up @@ -342,6 +343,7 @@ void CCleanCosmeticTask::ComputeMedian(int x, int y, int lFilterSize, double& fR
{
for (int j = std::max(0, y-lFilterSize); j <= std::min(m_lHeight-1, y+lFilterSize); j++)
{
#pragma warning (suppress:4457)
double fRed, fGreen, fBlue;
double fDelta;

Expand Down Expand Up @@ -393,11 +395,12 @@ void CCleanCosmeticTask::ComputeGaussian(int x, int y, int lFilterSize, double&
{
// Check that this is a normal pixel
bool bAdd = true;
if (m_CFAType != CFAT_NONE)
if (m_CFAType != CFATYPE_NONE)
bAdd = GetBayerColor(i, j, m_CFAType) == BayerColor;

if (bAdd)
{
#pragma warning (suppress:4457)
double fGray;
double fDelta;
double fDistance2 = std::pow((i-x) / static_cast<double>(lFilterSize), 2) + std::pow((j-y) / static_cast<double>(lFilterSize), 2);
Expand Down Expand Up @@ -443,6 +446,7 @@ void CCleanCosmeticTask::ComputeGaussian(int x, int y, int lFilterSize, double&
for (int j = std::max(0, y-lFilterSize); j <= std::min(m_lHeight-1, y+lFilterSize); j++)
{
// Check that this is a normal pixel
#pragma warning (suppress:4457)
double fRed, fGreen, fBlue;
double fDelta;
double fDistance2 = std::pow((i-x)/ static_cast<double>(lFilterSize), 2) + std::pow((j-y) / static_cast<double>(lFilterSize), 2);
Expand Down
4 changes: 2 additions & 2 deletions DeepSkyStacker/DSSMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
return DllExports::GdipAlloc(in_size);
}

void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine)
void* (operator new)(size_t nSize, LPCSTR, int)
{
return DllExports::GdipAlloc(nSize);
}

void operator delete(void* p, LPCSTR lpszFileName, int nLine)
void operator delete(void* p, LPCSTR, int)
{
DllExports::GdipFree(p);
}
Expand Down
28 changes: 5 additions & 23 deletions DeepSkyStacker/DarkFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ inline bool IsInStdDev(double fValue, double fMean, double fStdDev)
static double ComputeMinimumRMSFactor(VALUEPAIRSET & sValuePairs)
{
ZFUNCTRACE_RUNTIME();
int lSize = (int)sValuePairs.size();
double fMinRMS = -1.0;
double fSelectedk = 0.0;
constexpr int MINNEGATIVE = MAXWORD;
std::vector<double> vValues;
std::vector<double> vEntropies;
double fDarkMean = 0.0;
Expand Down Expand Up @@ -411,7 +409,6 @@ void CDarkFrame::ComputeOptimalDistributionRatio(CMemoryBitmap * pBitmap, CMemor
ZFUNCTRACE_RUNTIME();
EXCLUDEDPIXELVECTOR vExcludedPixels;
int i, j;
int lWidth = pBitmap->RealWidth();
int lHeight = pBitmap->RealHeight();

VALUEPAIRSET sRedValuePairs;
Expand Down Expand Up @@ -516,9 +513,6 @@ void CDarkFrame::ComputeOptimalDistributionRatio(CMemoryBitmap * pBitmap, CMemor
GreenStats,
BlueStats;

int lNrNegativeReds = 0;
int lNrNegativeBlues = 0;
int lNrNegativeGreens = 0;


for (it = sRedValuePairs.begin();it != sRedValuePairs.end();it++)
Expand All @@ -533,13 +527,6 @@ void CDarkFrame::ComputeOptimalDistributionRatio(CMemoryBitmap * pBitmap, CMemor
if ((*it).m_lCount && (*it).m_wLightValue && (*it).m_wDarkValue)
BlueStats.AddValue(std::max(0.0, (double)(*it).m_wLightValue - fRatio * (*it).m_wDarkValue), (*it).m_lCount);

double fSigmaRed = RedStats.Sigma(),
fSigmaGreen = GreenStats.Sigma(),
fSigmaBlue = BlueStats.Sigma();
double fAvgRed = RedStats.Max()-RedStats.Min(),
fAvgGreen = RedStats.Average(),
fAvgBlue = RedStats.Average();

fRatio -= 0.1;
}

Expand Down Expand Up @@ -1053,8 +1040,6 @@ void CDarkFrameHotParameters::ComputeParameters(CMemoryBitmap* pBitmap, HOTPIXEL
void CDarkAmpGlowParameters::ComputeParametersFromPoints(CMemoryBitmap * pBitmap)
{
ZFUNCTRACE_RUNTIME();
int lWidth = pBitmap->RealWidth(),
lHeight = pBitmap->RealHeight();
double m_fMedianColdest = -1;

m_fMedianHotest = computeMedianValueInRect(pBitmap, m_rcHotest);
Expand Down Expand Up @@ -1250,9 +1235,9 @@ void CDarkAmpGlowParameters::FindPointsAndComputeParameters(CMemoryBitmap* pBitm
else
{
// Check all the points
double fMaxRed,
fMaxGreen,
fMaxBlue;
#pragma warning (suppress:4456)
double fMaxRed, fMaxGreen, fMaxBlue;

DSSRect rcMaxRed,
rcMaxGreen,
rcMaxBlue;
Expand Down Expand Up @@ -1498,7 +1483,7 @@ void CDarkFrame::ComputeDarkFactorFromHotPixels(CMemoryBitmap * pBitmap, STARVEC
/* ------------------------------------------------------------------- */
/* ------------------------------------------------------------------- */

void CDarkFrame::FindBadVerticalLines(ProgressBase * pProgress)
void CDarkFrame::FindBadVerticalLines(ProgressBase*)
{
ZFUNCTRACE_RUNTIME();
bool bMonochrome = m_pMasterDark->IsMonochrome();
Expand Down Expand Up @@ -1803,7 +1788,7 @@ void CDarkFrame::GetValidNeighbors(int lX, int lY, HOTPIXELVECTOR & vPixels, int

/* ------------------------------------------------------------------- */

void CDarkFrame::InterpolateHotPixels(std::shared_ptr<CMemoryBitmap> pBitmap, ProgressBase * pProgress)
void CDarkFrame::InterpolateHotPixels(std::shared_ptr<CMemoryBitmap> pBitmap, ProgressBase*)
{
ZFUNCTRACE_RUNTIME();
if (static_cast<bool>(pBitmap) && !m_vHotPixels.empty())
Expand Down Expand Up @@ -1896,9 +1881,6 @@ bool CDarkFrame::Subtract(std::shared_ptr<CMemoryBitmap> pTarget, ProgressBase*

if (m_pMasterDark && m_pMasterDark->IsOk())
{
double fRedDarkFactor = 1.0;
double fGreenDarkFactor = 1.0;
double fBlueDarkFactor = 1.0;

if ((m_bHotPixelsDetection || m_bBadLinesDetection) && !m_bHotPixelDetected)
{
Expand Down
17 changes: 4 additions & 13 deletions DeepSkyStacker/DeBloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inline bool IsEdge(const double pfGray[])
const double fGradient0 = std::abs(pfGray[1] - pfGray[0]) / 256.0;
const double fGradient1 = std::abs(pfGray[2] - pfGray[0]) / 256.0;
const double fGradient2 = std::abs(pfGray[3] - pfGray[1]) / 256.0;
const double fGradient3 = std::abs(pfGray[4] - pfGray[2]) / 256.0;
// const double fGradient3 = std::abs(pfGray[4] - pfGray[2]) / 256.0;

const double fEdge = (fGradient2 - fGradient0) / 2.0 / (fGradient0 - 2.0 * fGradient1 + fGradient2) + 2;

Expand Down Expand Up @@ -420,17 +420,11 @@ inline double NormalizeAngle(double fAngle)
void CDeBloom::RefineStarCenter(CMemoryBitmap * pBitmap, C8BitGrayBitmap * pMask, CBloomedStar & bs)
{
double fMinimum = NOEDGEANGLE;
double fdX = 0,
fdY = 0,
fdYLeft = 0,
fdYRight = 0;
double fndX = 0,
fndY = 0;
double fdX = 0;
double fndX = 0;
// fndY = 0;
double fX = bs.m_ptStar.x(),
fY = bs.m_ptStar.y();
bool bFound = false;
double fOffsetX = 0.0,
fOffsetY = 0.0;

// Check that 2 bloomed stars are not side by side
bool bLeftBloomed = false,
Expand Down Expand Up @@ -535,10 +529,8 @@ void CDeBloom::RefineStarCenter2(CMemoryBitmap * pBitmap, C8BitGrayBitmap * pMas
bsg.ptStar = bs.m_ptStar;
bsgn = bsg;

double fStep = 0.8;
double fRadius = bs.m_fRadius;
double fMinimum = -1.0;
bool bEnd = true;

for (double fdX = -5.0;fdX<=5.0;fdX+=0.2)
{
Expand Down Expand Up @@ -579,7 +571,6 @@ void CDeBloom::ComputeStarCenter(CMemoryBitmap * pBitmap, C8BitGrayBitmap * pMas
vValues.reserve(fRadius*2+1);


int lNrColumns = 0;
std::vector<double> vYCenters;

for (i = std::max(0.0, fX-fRadius-0.5);i<=std::min(static_cast<double>(m_lWidth-1), fX+fRadius+0.5);i++)
Expand Down
4 changes: 2 additions & 2 deletions DeepSkyStacker/DeBloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public :
return (*this);
};

bool operator < (const CBloomedStar & right) const
bool operator<(const CBloomedStar&) const
{
return true;
};
}
};

typedef std::vector<CBloomedStar> BLOOMEDSTARVECTOR;
Expand Down
Loading

0 comments on commit e5be8c2

Please sign in to comment.