import 'package:fis_measure/interfaces/date_types/point.dart';
import 'package:fis_measure/interfaces/date_types/rect_region.dart';
import 'package:fis_measure/interfaces/process/visuals/visual_area.dart';
import 'package:vid/us/vid_us_unit.dart';

import '../physical_coordinates/physical_coordinate.dart';
import 'image_boundary.dart';

/// 测量视口
abstract class IViewPort {
  IVisualArea get area;

  /// 物理坐标协调器
  IPhysicalCoordinate? get physical;

  /// 所在区域(相对于整个图像)
  RectRegion get region;

  /// 图像区域（可能会超出[region]）
  IImageBoundary get imageBoundary;

  /// 是否水平翻转
  bool get isFlipHorizontal;

  /// 是否垂直翻转
  bool get isFlipVertical;

  /// X轴单位
  VidUsUnit get xUnit;

  /// Y轴单位
  VidUsUnit get yUnit;

  /// 转换为[region]中的逻辑化坐标点
  DPoint convert(DPoint point);

  /// 将逻辑化坐标点转换为相对于与[region]的规范化坐标点
  DPoint convertBack(DPoint point);
}
