Class: UVC::CameraTerminalDescriptor

Inherits:
InputTerminalDescriptor show all
Defined in:
lib/uvc.rb

Defined Under Namespace

Classes: Controls

Instance Attribute Summary collapse

Attributes inherited from InputTerminalDescriptor

#bAssocTerminal, #bTerminalID, #iTerminal, #wTerminalType

Attributes inherited from ClassSpecificVCInterfaceDescriptor

#bDescriptorSubType, #bDescriptorType, #rest

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from InputTerminalDescriptor

#bUnitID

Methods inherited from ClassSpecificVCInterfaceDescriptor

parse_array

Constructor Details

#initialize(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, wObjectiveFocalLengthMin, wObjectiveFocalLengthMax, wOcularFocalLength, bControlSize, bmControls) ⇒ CameraTerminalDescriptor

Returns a new instance of CameraTerminalDescriptor.



384
385
386
387
388
389
390
391
# File 'lib/uvc.rb', line 384

def initialize(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, wObjectiveFocalLengthMin, wObjectiveFocalLengthMax, wOcularFocalLength, bControlSize, bmControls)
	super(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal)
	@wObjectiveFocalLengthMin = wObjectiveFocalLengthMin
	@wObjectiveFocalLengthMax = wObjectiveFocalLengthMax
	@wOcularFocalLength = wOcularFocalLength
	@bControlSize = bControlSize
	@bmControls = Controls.new(bmControls)
end

Instance Attribute Details

#bControlSizeObject (readonly)

Returns the value of attribute bControlSize.



376
377
378
# File 'lib/uvc.rb', line 376

def bControlSize
  @bControlSize
end

#bmControlsObject (readonly)

Returns the value of attribute bmControls.



377
378
379
# File 'lib/uvc.rb', line 377

def bmControls
  @bmControls
end

#wObjectiveFocalLengthMaxObject (readonly)

Returns the value of attribute wObjectiveFocalLengthMax.



374
375
376
# File 'lib/uvc.rb', line 374

def wObjectiveFocalLengthMax
  @wObjectiveFocalLengthMax
end

#wObjectiveFocalLengthMinObject (readonly)

Returns the value of attribute wObjectiveFocalLengthMin.



373
374
375
# File 'lib/uvc.rb', line 373

def wObjectiveFocalLengthMin
  @wObjectiveFocalLengthMin
end

#wOcularFocalLengthObject (readonly)

Returns the value of attribute wOcularFocalLength.



375
376
377
# File 'lib/uvc.rb', line 375

def wOcularFocalLength
  @wOcularFocalLength
end

Class Method Details

.parse(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest) ⇒ Object



379
380
381
382
# File 'lib/uvc.rb', line 379

def self.parse(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, rest)
	wObjectiveFocalLengthMin, wObjectiveFocalLengthMax, wOcularFocalLength, bControlSize, bmControls = *rest.unpack("vvvcB24")
	self.new(bDescriptorType, bDescriptorSubType, bTerminalID, wTerminalType, bAssocTerminal, iTerminal, wObjectiveFocalLengthMin, wObjectiveFocalLengthMax, wOcularFocalLength, bControlSize, bmControls)
end

Instance Method Details

#short_inspectObject



454
455
456
457
458
459
460
461
462
# File 'lib/uvc.rb', line 454

def short_inspect
	"%s bUnitID=%d\n  %s" % [
		self.class.name.sub(/Descriptor$/, ''),
		self.bUnitID,
		Controls::BITS.select {|n|
			self.bmControls.send(n)
		}.join("  \n")
	]
end