bool PFMEncoder::isFormatSupported(int depth) const
{
- return CV_MAT_DEPTH(depth) == CV_32F || CV_MAT_DEPTH(depth) == CV_8U;
+ // any depth will be converted into 32-bit float.
+ (void) depth;
+ return true;
}
bool PFMEncoder::write(const Mat& img, const std::vector<int>& params)
rgb_row[x*3+1] = bgr_row[x*3+1];
rgb_row[x*3+2] = bgr_row[x*3+0];
}
- strm.putBytes( reinterpret_cast<const uchar*>(rgb_row.data()),
- static_cast<int>(sizeof(float) * row_size));
+ strm.putBytes( reinterpret_cast<const uchar*>(rgb_row.data()),
+ static_cast<int>(sizeof(float) * row_size) );
} else if (float_img.channels() == 1) {
strm.putBytes(float_img.ptr(y), sizeof(float) * float_img.cols);
}