Class: ColorRois

Inherits:
Object show all
Defined in:
lib/rois/color_rois.rb

Overview

The ColorRois class holds all the color ROIs for the given platform instance.

Instance Method Summary collapse

Constructor Details

#initialize(dut) ⇒ ColorRois

Public: Initializes ColorRois. NOT FOR USE IN TESTS.



8
9
10
# File 'lib/rois/color_rois.rb', line 8

def initialize(dut)
  @dut = dut
end

Instance Method Details

#new(args = {}) ⇒ Object

Public: Creates a dynamic color Roi.

x - Integer x coordinate (default: nil). y - Integer y coordinate (default: nil). width - Integer width (default: nil). height - Integer height (default: nil). rectangle - Hash defining rectangle with keys :x, :y, :width, :height (default: nil). element - Hash same as rectangle (default: nil). red - Integer red value 0 - 255 (default: nil). Required unless rgb is given. green - Integer green value 0 - 255 (default: nil). Required unless rgb is given. blue - Integer blue value 0 - 255 (default: nil). Required unless rgb is given. rgb - Integer Array of 3 values (0 - 255) for red, green, blue (default: nil).

Required unless red, green, blue are given.

similarity - Integer color similarity threshold 0 - 100 (default: 85). ref_img - String path to reference image (default: nil).

Returns the new ColorRoi object.



29
30
31
# File 'lib/rois/color_rois.rb', line 29

def new(args={})
  ColorRoi.new(@dut, args)
end

#SAMPLEObject



33
34
35
36
# File 'lib/rois/color_rois.rb', line 33

def SAMPLE
  new(:x => 100, :y => 50, :width => 300, :height => 200, :rgb => [10, 10, 10], :similarity => 100,
      :ref_img => 'tsimages/reference/mobile/movie_product_page.JPG')
end