diff --git a/rawimage.cpp b/rawimage.cpp index 7b36a5b..83d5671 100644 --- a/rawimage.cpp +++ b/rawimage.cpp @@ -1,8 +1,8 @@ #include "rawimage.h" #include -#include #include #ifndef NO_QT +#include #include #include #include @@ -55,7 +55,7 @@ void RawImage::allocate(uint32_t w, uint32_t h, uint32_t ch, DataType type) m_width = w; m_height = h; m_channels = ch; - m_ch = ch == 3 ? 4 : ch; + m_ch = ch > 1 ? 4 : ch; m_origType = m_type = type; m_pixels = std::make_unique((size_t)m_width * m_height * m_ch * typeSize(type)); } @@ -1071,7 +1071,6 @@ void RawImage::setICCProfile(const QByteArray &icc) if(icc.size()) m_iccProfile = std::vector(icc.begin(), icc.end()); } -#endif void RawImage::setICCProfile(const LibXISF::ByteArray &icc) { @@ -1180,6 +1179,7 @@ void RawImage::generateLUT() cmsCloseProfile(inProfile); cmsCloseProfile(outProfile); } +#endif void RawImage::applySTF(const MTFParam &mtfParams) { diff --git a/rawimage.h b/rawimage.h index 6878e82..50bc160 100644 --- a/rawimage.h +++ b/rawimage.h @@ -125,10 +125,10 @@ public: bool valid() const; #ifndef NO_QT void setICCProfile(const QByteArray &icc); -#endif void setICCProfile(const LibXISF::ByteArray &icc); void convertTosRGB(); void generateLUT(); +#endif void applySTF(const MTFParam &mtfParams); MTFParam calcMTFParams(bool linked = false, bool debayer = false) const; const std::vector& getLUT() const;