Camera Class

Definition

Namespace: P1Sdk

Representation of a physical Phase One Camera More…

public class Camera :  IDisposable

Remarks

Representation of a physical Phase One Camera

All interaction with camera are through objects of this class. You work with cameras using two different schemes.

Properties

All Phase One camera expose a dynamic set of properties. These include Aperture, Shutter Time, ISO etc. But properties can also represent other camera settings like shutter mode or the dimension of the LiveView images.

Common for all properties is that they define metadata like names and valid ranges.

A camera exposes different properties at different times. This means that setting one property, might cause other properties to disappear or become visisble. Because of this dynamic nature, we do not include an enum type with all property ids. You must query for the name and purpose of the properties to wish to use. And know that their existence is not guaranteed.

Capturing & LiveView

This class defines a set of methods to trigger image capturing on the camera, and streaming LiveView images to SDK host computer. Also, you can control whether captured images should be transferred to the computer.

Both captured and LiveView images are transferred in data chunks. The captured full resolution RAW images are large, and transferring them in chunks saves memory. You can control the size of each chunk, so you could allocate a giang chunk to transfer the entire image in one go.

The format of the captured images are IIQ files, that can be written directly to disk. However, you must account for data chunks arrive un-ordered. This means the received series of chunks and not a stream of bytes. The end of the IIQ file might arrive in a chunk, before the begining. Each chunk will define its global byte offset.

Creating & disposing objects

There is no public constructor on this class. Since this class represents a association with physical cameras, you cannot construct object on your own. Use the static methods OpenUsbCamera or OpenIpCamera to create cameras.

This class also implements the System.IDisposable pattern. This is beause you should be able to close your camera instance immediately, and thereby release the physical camera for use by others.

Upon destructing an instance of this class, all associated resources are freed. However, if you do not utilize the dispose pattern, you cannot know when the C# garbage collector collects (frees) the camera. Using IDispose gives you direct control over freeing camera resources.

See also:

PropertyValue, PropertySpec

Methods

Close()

Frees the camera handle, letting other processes or resources take over use of the camera.

IsOpen()

zzz MEG 2020-04-22 11:17 document

GetConnectionType()

GetAllPropertyIds()

Returns a list of all the properties that this camera support.

GetPropertySpec(UInt32 propertyId)

Return a specification object for a given property.

SetProperty(UInt32 propertyId, PropertyValue value)

Set a given property’s value

GetProperty(UInt32 propertyId)

Gets the current value of a given property

TriggerCapture()

Take a picture with the camera

EnableImageReceiving(bool enable)

Enable/disable for image transferring to host for this camera.

SetHostStorageCapacity(UInt32 capacityMB)

Registers this host’s available storage capacity (in megabytes).

WakeUpWaitingImageThreads()

Wake up and timeout any threads waiting on image data

WaitForImage(uint timeoutMs=0)

Wait for the next captured image to arrive

SetLiveViewEnable(bool enable)

Turn capturing and transferring of LiveView images on or off

WaitForLiveView(UInt32 timeoutMs=0)

Returns a LiveViewImage ‘s with the LiveView bitmap data, and a few properties

GetLiveViewConfiguration()

Returns the LiveView configuration object

ToString()

Reutrn a simple string representation of the camera.

Dispose()

Closes the camera and releases all resourced held by the camera object

GetAvailableCameras()

Returns a list of all available camera currently available.

OpenUsbCamera(string serialNum=null, string password=null)

Opens a USB Camera with the given serial-number (or any USB camera if the serial-number is omitted or empty).

OpenIpCamera(string ipAddress, string password=null)

Opens a TCP/IP Camera with the given IPv4 address