skyprojection.cc
// Sets the output projected side length to be max_side_length.
Sets the output projected side length to be max_side_length.
Sets the output projected side length to be max_side_length .
void SkyProjection::SetMaxSideLength(int max_side_length) {
  if (projected_width_ >= projected_height_ &&
      projected_width_ > max_side_length) {
    double old_width = static_cast<double>(projected_width_);
    double new_width = static_cast<double>(max_side_length);
    double height = static_cast<double>(projected_height_);
    projected_width_ = max_side_length;
    projected_height_ = Round(height * (new_width / old_width));
  } else if (projected_height_ > projected_width_ &&
             projected_height_ > max_side_length) {
    double old_height = static_cast<double>(projected_height_);
    double new_height = static_cast<double>(max_side_length);
    double width = static_cast<double>(projected_width_);
    projected_height_ = max_side_length;
    projected_width_ = Round(width * (new_height / old_height));
  }
  assert(projected_width_ > 0);
  assert(projected_height_ > 0);
}
void SkyProjection :: SetMaxSideLength ( int max_side_length ) { if ( projected_width_ >= projected_height_ && projected_width_ > max_side_length ) { double old_width = static_cast < double > ( projected_width_ ) ; double new_width = static_cast < double > ( max_side_length ) ; double height = static_cast < double > ( projected_height_ ) ; projected_width_ = max_side_length ; projected_height_ = Round ( height * ( new_width / old_width ) ) ; } else if ( projected_height_ > projected_width_ && projected_height_ > max_side_length ) { double old_height = static_cast < double > ( projected_height_ ) ; double new_height = static_cast < double > ( max_side_length ) ; double width = static_cast < double > ( projected_width_ ) ; projected_height_ = max_side_length ; projected_width_ = Round ( width * ( new_height / old_height ) ) ; } assert ( projected_width_ > 0 ) ; assert ( projected_height_ > 0 ) ; }
Sets the output projected side length to be max_side_length.
Sets the output projected side length to be max_side_length .
// Enforce a maximum side length that keeps the same aspect ratio.