Fix bug when saving color FITS/XISF files
This commit is contained in:
+13
-2
@@ -351,6 +351,11 @@ uint32_t RawImage::norm() const
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t RawImage::widthBytes() const
|
||||
{
|
||||
return m_ch * m_width;
|
||||
}
|
||||
|
||||
void* RawImage::data()
|
||||
{
|
||||
return m_pixels.get();
|
||||
@@ -387,6 +392,11 @@ const void *RawImage::origData(uint32_t row, uint32_t col) const
|
||||
return m_pixels.get() + (m_width * row * m_ch + col * m_ch) * typeSize(m_type);
|
||||
}
|
||||
|
||||
bool RawImage::planar() const
|
||||
{
|
||||
return m_planar;
|
||||
}
|
||||
|
||||
void RawImage::convertToThumbnail()
|
||||
{
|
||||
if(!valid())
|
||||
@@ -735,6 +745,7 @@ std::shared_ptr<RawImage> RawImage::fromPlanar(const void *pixels, uint32_t w, u
|
||||
convert(static_cast<const double*>(pixels), static_cast<double*>(image->data()), 1);
|
||||
break;
|
||||
}
|
||||
image->m_planar = false;
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -748,11 +759,11 @@ std::vector<RawImage> RawImage::split() const
|
||||
size_t s = size();
|
||||
auto extract = [&](auto *in, auto *out, size_t off)
|
||||
{
|
||||
for(size_t i=0; i < s; i+=m_ch)
|
||||
for(size_t i=0; i < s; i++)
|
||||
out[i] = in[i*m_ch + off];
|
||||
};
|
||||
|
||||
for(uint32_t i=0; i<m_ch; i++)
|
||||
for(uint32_t i=0; i<m_channels; i++)
|
||||
{
|
||||
switch(m_type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user