< Previous PageNext Page > Hide TOC

Overview

The Image Capture Architecture (part of Carbon.framework) is a high-level framework for capturing image data from devices such as scanners, digital cameras, phones and PDAs. The Image Capture interfaces are device independent, so you can use them to gather data from any devices connected to the system. You can get a list of devices, retrieve information about a specific device or its contents, and retrieve files—including images, movies, and sound files—from devices. You can also issue commands to devices that support this feature, to initiate a document scan, take a photo, or delete an image from a camera card, for example.

Mac OS X provides a set of image capture services that enable you to do the following:

In this section:

Architecture
Sequence of Events
TWAIN Compatibility
Device Browser


Architecture

There are three pieces to the Image Capture Architecture:

The image capture services architecture is conceptually somewhat similar to TWAIN architecture, with the image capture extension taking the place of the TWAIN data source manager and the the device module taking the place of the TWAIN data source, as shown in Figure 1-1.


Figure 1-1  Main Components of the Image Capture Architecture

image capture extension replaces TWAIN data source manager

The Image Capture applications, extension, and device modules are all run in separate processes, making it possible to dynamically add device modules into the mix, share devices among applications, access devices from applications running on separate host computers, and even access device modules from applications running on different CPU architectures, as shown in Figure 1-2.


Figure 1-2  Image Capture Architecture

Application running on Intel/Leopard accessing devices on G5/Tiger

As illustrated, it is possible for applications on one computer to access device modules running on another computer. It is also possible for multiple applications to access multiple devices, and for multiple applications to share access to a single device.

Sequence of Events

The process operates as follows: when a device is connected to the host computer, via FireWire or USB, or an image-capture device is attached from a Bluetooth or TCP/IP network connection, the operating system searches among the installed device modules for the most suitable one, using the device module's associated DeviceInfo.plist. (If more than one module is installed for a given device, the system selects the highest CFBundle version number, taken from the Info.plist file.)

If an application is configured to be launched when this type of device is detected, that application is launched. For example, connecting a digital camera or pushing the "scan" button on a scanner can invoke your application without user intervention.

Note: In order to have your application launched when a device is attached, instruct your end user to run the Image Capture application and select your application in the dialog box presented by the Image Capture > Preferences menu.

When launched, your application obtains a device list object from the Image Capture API, chooses a device from the list, and obtains the dictionary for that device. The dictionary contains a list of objects associated with the device, such as images, movies, audio files, and directories.

The dictionary for the device also includes information about the device, such as whether it supports capturing images on command or deleting images. You can use the Image Capture API to issue such commands to the device.

Your application can download the objects of interest directly or obtain a dictionary of metadata specific to individual objects to determine whether they should be downloaded.

Note: Earlier versions of image capture services required the application to iterate through the device list to determine each device type, then iterate through the objects contained on a device, such as images, audio files, and directories. The API for this earlier method is still in the headers for backward compatibility, but the new API, using dictionaries rather than iterating through the object hierarchy, is recommended, and is the API documented in the following chapter.

Image capture applications should register for notification of image capture events, such as the addition of new devices, the removal of existing devices, or the change of storage in an existing device, such as the insertion of a new memory card into a mounted camera or card reader.

TWAIN Compatibility

Image capture devices can be accessed using the native image capture API described in this document, or they can be accessed as TWAIN data sources. In order for devices to be recognized by TWAIN applications as well as Image Capture applications, the device manufacturer must provide both a TWAIN data source module and an Image Capture device module. If both are available, the system uses the Image Capture device module by default, and the TWAIN data source when needed.

Device Browser

An Image Capture application has access to all attached image capture devices. USB and FireWire devices are automatically attached when they are connected, but Bluetooth and TCP/IP network devices may not be. The Image Capture API includes a device browser that your application can invoke, allowing the end user to browse for available devices and attach them. Once mounted, they appear in the device list object when it is next obtained. Device manufacturers should use Bonjour protocol to advertise available TCP/IP network devices.



< Previous PageNext Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-05-16)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.