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 visible. 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 giant 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 beginning. 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 because 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, CameraSdk.PropertySpec

Properties

Subscriptions

Get the current subscriptions of this camera.

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

ConnectionType()

AllPropertyIds()

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

PropertySpec(UInt32 propertyId)

Return a specification object for a given property.

SetProperty(UInt32 propertyId, PropertyValue value)

Set a given property’s value

Property(UInt32 propertyId)

Gets the current value of a given property

UpdateCameraFirmware(string fwFilePath)

Updates firmware of connected camera

UpdateCameraFirmware(byte[] fwFileBuffer, ulong fwBufferSize)

Updates firmware of connected camera

TriggerCapture()

Take a picture with the camera

SetHostStorageCapacity(UInt32 capacityMB)

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

ToString()

Return a simple string representation of the camera.

Dispose()

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

AllImages()

Returns a list of the images currently stored on the camera.

AvailableCameras()

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, int timeoutSecs=0)

Opens a TCP/IP Camera with the given IPv4 address