sig
  type size = Scale of float | Pixel of int | Guess
  type aspect_opts = Keep_at_most | Keep_at_least | Dont_keep
  type resize_switch = Always | Bigger_only | Smaller_only
  type from = TopLeft | BottomRight | Center
  type position =
      AtPixel of Geometry.from * int
    | AtScale of Geometry.from * float
  type t = {
    geom_width : int;
    geom_height : int;
    geom_x : int;
    geom_y : int;
  }
  type spec = {
    spec_width : Geometry.size;
    spec_height : Geometry.size;
    spec_aspect : Geometry.aspect_opts;
    spec_switch : Geometry.resize_switch;
    spec_x : int;
    spec_y : int;
  }
  val compute : Geometry.spec -> int -> int -> Geometry.t
end