update
This commit is contained in:
@@ -38,6 +38,23 @@ QImage loadImageLimited(const QString& absolutePath, qint64 maxPixelBudget) {
|
||||
return reader.read();
|
||||
}
|
||||
|
||||
QImage loadDepthMapAlignedToBackground(const QString& depthAbsolutePath, const QString& backgroundAbsolutePath) {
|
||||
if (depthAbsolutePath.isEmpty()) {
|
||||
return {};
|
||||
}
|
||||
QImage g8 = loadImageLimited(depthAbsolutePath, core::image_decode::kWorkspaceMaxPixels);
|
||||
if (g8.isNull()) {
|
||||
return {};
|
||||
}
|
||||
g8 = g8.convertToFormat(QImage::Format_Grayscale8);
|
||||
QSize logical;
|
||||
if (!backgroundAbsolutePath.isEmpty() && probeImagePixelSize(backgroundAbsolutePath, &logical) &&
|
||||
logical.isValid() && logical.width() > 0 && logical.height() > 0 && g8.size() != logical) {
|
||||
g8 = g8.scaled(logical, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
return g8;
|
||||
}
|
||||
|
||||
bool loadRegionToQImage(const QString& absolutePath, const QRect& rectLogical, int maxOutputWidth, int maxOutputHeight,
|
||||
QImage* out) {
|
||||
if (!out || absolutePath.isEmpty() || maxOutputWidth < 32 || maxOutputHeight < 32) {
|
||||
|
||||
Reference in New Issue
Block a user