en fr

Sysquake Pro – Table of Contents

Sysquake – Table of Contents

Sysquake for LaTeX – Table of Contents

Extension - Image Capture

This section describes functions related to the image capture capabilities of macOS, i.e. system software which supports the acquisition of images on a digital camera, a scanner, or similar devices.

Most capabilities of image capture are made available as a tree of nodes, each node having children, properties, or both. Function ic_root creates an opaque object for the root node. Children nodes are retrieved from the root node using the index notation (an integer between parenthesis); node properties are retrieved with the field access notation (a dot followed by the property name).

Functions

ic_capture

Capture a new image.

Syntax

ic_capture(cam)

Description

ic_capture(cam) captures a new image with camera cam.

Example

Captures a new image with the first camera connected:

root = ic_root;
cam = root(1);
ic_capture(cam);

See also

ic_root, ic_delete_one

ic_delete_one

Delete one image.

Syntax

ic_delete_one(im)

Description

ic_delete_one(im) deletes image im stored on the camera.

Example

Deletes the first image of the first camera connected (the depth depends on the file directory in the memory card of the camera):

root = ic_root;
cam = root(1);
im = cam(1)(1)(1)(1);
ic_delete_one(im);

See also

ic_root, ic_capture

ic_delete_all

Delete all images.

Syntax

ic_delete_all(cam)

Description

ic_delete_all(cam) deletes all images stored on camera cam.

Example

Deletes all images of the first camera connected:

root = ic_root;
cam = root(1);
ic_delete_all(cam);

See also

ic_root, ic_capture, ic_delete_one

ic_root

Get the root node of the image capture tree.

Syntax

r = ic_root

Description

ic_root gives the root node of the image capture tree. All other nodes are linked to the root node and can be accessed using the index notation. The tree is updated automatically by the system when devices are connected or disconnected.

Properties, which are accessed like the fields of a structure with the dot notation, are listed in the developer documentation of the Image Capture framework available from Apple Computer, Inc. In addition, the number of children nodes is given by the length field or the length function; the parent node is given by the parent field; and all the properties except for data can be obtained as a structure with the properties field.

The other functions which are overloaded for nodes are listed below.

FunctionDescription
dispdisplay the kind of node
fieldnamesget the list of property names
subsrefimplement the subnode and property access

Examples

Get the root node and store it into root:

root = ic_root
  Image capture object (device)

Get the number of children (the result will depend on the actual device(s) connected to your computer):

root.length
  1

Get the first (and unique) child:

root(1)
  Image capture object (camera)

Get a list of its property names:

fieldnames(root(1))
  {'volumeLabel','cameraIcon'}

Get all its properties as a structure:

root(1).properties
  volumeLabel: 'NIKON DSC E775'
  cameraIcon: 9229x1 uint8 array

Get the properties of its first image (without data):

root(1)(1)(1)(1).properties
  filename: 'DSCN0798.JPG'
  imageThumbnail: 65549x1 uint8 array
  imageSize: 370946uint32
  imageWidth: 1600uint32
  imageHeight: 1200uint32

Get the data of the first image:

d = root(1)(1)(1)(1).data;

Decode image with the function imageread of the Image IO extension:

im = imageread(d);

ic_sync_clock

Synchronize camera clock.

Syntax

ic_sync_clock(cam)

Description

ic_sync_clock(cam) synchronizes the clock of camera cam.

See also

ic_root, ic_capture