module Capybara module Screenshot module Diff module Drivers class BaseDriver[ImageEntity] type images_entity[out T] = [T, T] type dimension_entity = [Numeric, Numeric] type options_entity = { area_size_limit?: Numeric?, color_distance_limit?: Numeric?, driver: (:auto | :vips | :chunky_png | VipsDriver | ChunkyPNGDriver)?, dimensions: dimension_entity?, median_filter_window_size: Numeric?, shift_distance_limit?: Numeric?, skip_area?: Array[Region]?, stability_time_limit?: Numeric?, tolerance?: Numeric?, wait?: Numeric? } type color = [Integer, Integer, Integer, Integer] def find_difference_region: (ImageEntity new_image, ImageEntity old_image, Numeric color_distance_limit, Numeric _shift_distance_limit, Integer _area_size_limit, ?fast_fail: bool) -> Difference def inscribed?: (dimension_entity dimensions, ImageEntity i) -> boolish def crop: (Region region, ImageEntity i) -> ImageEntity def filter_image_with_median: (ImageEntity image, Numeric median_filter_window_size) -> ImageEntity def add_black_box: (ImageEntity memo, Region region) -> void def difference_level: (ImageEntity diff_mask, ImageEntity old_img, Region _region) -> Float def image_area_size: (ImageEntity old_img) -> Integer def height_for: (ImageEntity image) -> Integer def width_for: (ImageEntity image) -> Integer # Vips could not work with the same file. Per each process we require to create new file def save_image_to: (ImageEntity image, String filename) -> void def resize_image_to: (ImageEntity image, Integer new_width, Integer new_height) -> ImageEntity def load_images: (String old_file_name, String new_file_name) -> images_entity[ImageEntity] def from_file: (TestMethods::path_entity filename) -> ImageEntity def dimension: (ImageEntity image) -> dimension_entity def draw_rectangles: (images_entity[ImageEntity] images, Region region, color rgba, Integer offset) -> void def same_pixels?: () -> boolish end def self.for: (ScreenshotMatcher::input_options) -> (VipsDriver | ChunkyPNGDriver) end end end end