MCPcopy Create free account
hub / github.com/colmap/colmap / Thumbnail

Method Thumbnail

src/colmap/sensor/bitmap.cc:600–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598}
599
600double Bitmap::Thumbnail(const int max_image_size, RescaleFilter filter) {
601 THROW_CHECK_GT(max_image_size, 0);
602 if (width_ <= max_image_size && height_ <= max_image_size) {
603 return 1.0;
604 }
605 // Fit the down-sampled version exactly into the max dimensions.
606 const double scale =
607 static_cast<double>(max_image_size) / std::max(width_, height_);
608 Rescale(static_cast<int>(std::round(width_ * scale)),
609 static_cast<int>(std::round(height_ * scale)),
610 filter);
611 return scale;
612}
613
614void Bitmap::Rot90(int k) {
615 if (IsEmpty()) {

Callers 3

ExtractMethod · 0.80
RunMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64