DC20CTRL(1)

NAME
dc20ctrl - controls the Kodak DC20 digital camera.

SYNOPSIS
dc20ctrl -V

dc20ctrl [ -b baud_rate ] [ -e [ -f ] ] [ -h | -l | -r ] [ -i ] [ [ -p [ -P pictures_base_name ] [ { -w | -c } [ -R red_factor ] [ -G green_factor ] [ -B blue_factor ] [ -S saturation ] [ -g gamma ] [ -L low_i ] [ -H high_i ] [ -a ] [ -k ] ] [ -t [ -T thumbnails_base_name ] ] [ -n pictures ] [ -j [ -Q jpeg_quality ] ] [ -F [ -C compression[:option] ] ] [ -N ] ] [ -q | -v ] [ -s ] [ device_name ]

dc20ctrl -o [ { -w | -c } [ -R red_factor ] [ -G green_factor ] [ -B blue_factor ] [ -S saturation ] [ -g gamma ] [ -L low_i ] [ -H high_i ] [ -a ] [ -k ] ] [ -n pictures ] [ -j [ -Q jpeg_quality ] ] [ -F [ -C compression[:option] ] ] [ -N ] file_1 [ ... [ file_16 ] ]

DESCRIPTION
dc20ctrl can control your Kodak DC20 digital camera via the embedded serial port. You need a cable that plugs into a serial port of your computer and into the jack on the camera. Look at http://home.t-online.de/home/Oliver.Hartmann/dc20prot.htm if you need to build your cable.

With dc20ctrl you can control any parameter of your camera, as quering the current state, taking a photo, downloading the thumbnails and/or the pictures (in raw, pgm(5) or ppm(5) format, and eventually others: it depends on compilation-time options), erasing the camera memory and changing its resolution.

With the first synopsis, the program just prints the version number and exits without doing anything else.

The second synopsis allow you to download picture(s) and convert them online, or to control the camera via the serial port. Please note that dc20ctrl will at first get all pictures and then convert them, so you may save a bit the battery life. Well, it really depends on how fast is your computer converting the pictures, you know :-) In this case, device_name is the path of the device to use to talk to the camera. By default, /dev/cuaa0 is assumed if you are working under FreeBSD, otherwise /dev/ttyR1 is used.

In this mode, dc20ctrl will keep a session counter used to name pictures and thumbnails to avoid accidentally overwriting existing files. The counter will be kept in the .dc20ctrlrc file in the current directory or in your home directory. Please note that dc20ctrl will NOT create the file in the current directory if it does not exist, but it will create the one in your home directory instead. If you want to keep a separate session number for the current directory, create an empty file with the touch(1) command.

The last synopsis is useful to convert raw (Comet) files in greyscale or 24 bit colors format in offline mode. You may specify up to 16 Comet files at once.

By default, dc20ctrl saves the images in raw (Comet) format. You can later convert this format to ppm(5) using dc20ctrl itself, or cmttoppm by Yoshida Hideki <hideki@yk.rim.or.jp>.

OPTIONS

-a  Resize the image to fix aspect ratio. This is needed because the CCD cells are not square. This option will work only if you specify -c or -w options too.

-b baud_rate
    Specifies the baud rate that will be used to talk to the camera. You can use one of 9600, 19200, 38400, 57600 and 115200, the latter being the default.

-B blue_factor
    Specify the correction parameter of blue for the ppm(5) conversion routine. The default value is 1.00. An higher value will make the colour stronger. This option will work only if you specify the -c or -w options too.

-c  Save the photo in 24 bit colour format. This option will work only if you specify -p option too, and is mutually exclusive with the -w option.

-C compression[:option]
    Use this option to change the compression scheme of TIFF files. Compression may be one between j (JPEG compression), p (PackBits compression), l (LZW compression), z or .I d (Deflate compression). Any other character will switch to no compresison (the default). For JPEG compression, you may specify a compression level, 90 being the default. For LZW and Deflate compression, you may specify a predictor value, zero being the default.

-e  Erases all the images for the camera memory. You will be prompetd for confirmation, unless you specify also the -f option.

-f  Forces the delete to happen without asking for confirmation. To be used with -e option.

-F  Save the images (photo or thumbnails) in TIFF format. This option may be missing due to compilation-time options. Please note that you must use also one between -c or -w if you want to save photo's in TIFF format. This is not true for thumbnails. You may change the TIFF compression mode using the -C option. By default, no compression is used.

-g gamma
    Specify the gamma parameter for the ppm(5) conversion routine. The default value is 0.35. A smaller value makes a higher contrast. This option will work only if you specify the -c or -w options too.

-G green_factor
    Specify the correction parameter of green for the ppm(5) conversion routine. The default value is 0.58. An higher value will make the colour stronger. This option will work only if you specify the -c or -w options too.

-h  Set the camera in high resolution mode. You can switch resolution only if the memory is empty.

-H high_i
    Specify the upper bound for the ppm(5) conversion routine. The default value is -1. This option will work only if you specify the -c or -w options too.

-i  Prints information on the machine status, like the modem name, the firmware version, the free memory, the mode and the battery status.

-j  Save the images (photo or thumbnails) in JPEG format. This option may be missing due to compilation-time options. Please note that you must use also one between -c or -w if you want to save photo's in JPEG format. This is not true for thumbnails. You may change the JPEG compression factor using the -Q option.

-k  Keep raw (Comet) files after the conversion to 24 bit colour or greyscale. By default dc20ctrl will delete the raw files as soon as it converts them. Use -k to prevent this. This option will work only if you specify -c or -w options too.

-l  Set the camera in low resolution mode. You can switch resolution only if the memory is empty.

-L low_i
    Specify the lower bound for the ppm(5) conversion routine. The default value is -1. This option will work only if you specify the -c or -w options too.

-n range_1 [ ,... [ ,range_n ] ]
    Selects the pictures on which both -p and -t will operate and the direction of rotation for each picture. You can specify one or more ranges, where a range can be: [default_orientation:]photo_number[this_photo_orientation] or [default_orientation:]first_photo_number-last_photo_number[this_set_orientation] where the orientation is a letter between s (straight), l (left, or +90 degrees), r (right, or -90 degrees) and (bottom-up, or 180 degrees), and photo_number is a number between 1 and 16. If you want to specify a set of photo's, use two numbers separated by an hyphen. If you specify a default orientation, that will be the rotation applied to all ranges from the current one to the end of the string. Please note that the default orientation must be followed by a colon. If you specify an orientation for the current photo or the current set, that will apply only for those. You may specify more ranges, where each range is separated from the preceding one by a comma. If you do not use the -n option, by default the -p and -t options will operate on all pictures currently in the camera memory, with straight orientation.

-N  Save the images (photo or thumbnails) in PNG format. This option may be missing due to compilation-time options. Please note that you must use also one between -c or -w if you want to save photo's in PNG format. This is not true for thumbnails.

-o  Offline operation mode. In this mode, dc20ctrl will convert up to 16 Comet file (supplied on the command line), as they where just downloaded from the camera. This can be useful for many reasons, one being that the Comet format is the only really lossless format you can use. The same options as with -p apply here, but -P. Infact, the destination files will have the same name as the source files, but with different extension, depending on the output format selected.

-p  Extracts photo's from the camera memory. By default, extracts all the photo's naming them pic_YYYY_MM_DD_S_N.EXT, where YYYY is the year number, MM is the month number (with leading zero), DD is the day number (with leading zero), S is the session number, N is the photo number, starting from 1 and increasing for each photo, and EXT is the extension related to the file type: it can be cmt for Comet raw files, pgm for pgm(5) greyscale images or ppm for ppm(5) 24 bit color images. If you, at compilation time, included support for JPEG, TIFF or PNG file formats, it can be also jpg, tif or png. You can select which photo's to extract using the -n option, and change the file names using the -P option.

-P pictures_base_name
    Change the name of the files that will contain the photo's. If you supply a string here, the file name for pictures will become SSSSSS_N.EXT, where SSSSSS is the string you supplied and N and EXT are the same as above.

-q  Quiet operation: suppress all error messages.

-Q quality
    Change the quality for JPEG encoding. Please note that this option may be missing due to compile-time options. This option is useless without -j option.

-r  Switch the camera resolution mode, between high and low resolution. You can switch resolution only if the memory is empty.

-R red_factor
    Specify the correction parameter of red for the ppm(5) conversion routine. The default value is 0.64. An higher value will make the colour stronger. This option will work only if you specify the -c or -w options too.

-s  Take (shoot) a photo. This will work only if there is enough free memory in the camera. The photo will be taken before changing resolution, if you asked to.

-S saturation
    Specify the correction parameter of saturation for the ppm(5) conversion routine. The default value is 1.00. An higher value will make all the colours louder. This option will work only if you specify the -c or -w options too.

-t  Extracts thumbnails from the camera memory. By default, extracts all the thumbnails naming them thumb_YYYY_MM_DD_S_N.EXT. The same conventions as in -p switch apply here. Please seee above. You can select which thumbnails to extract using the -n option, and can change the file names using the -T option.

-T thumbnails_base_name
    Change the name of the files that will contain the thumbnails. See -P switch.

-v  Verbose operation: magnify the output level.

-w  Save the photo in pgm(5) format. This option will work only if you specify -p option too, and is mutually exclusive with the -c option.

EXAMPLES
To use a different baud rate and serial port:

    dc20ctrl -b 38400 /dev/cuaa1

To take a photo, use:

    dc20ctrl -s

To erase all photo's without confirmation:

    dc20ctrl -ef

To download all thumbnails , use:

    dc20ctrl -t

To download all images in raw (Comet) format, use

    dc20ctrl -p

while, to download only images 1, 3, and from 5 to 7 use

    dc20ctrl -pn 1,3,5-7

To download all images in pgm(5) format:

    dc20ctrl -pw

To downloads all images in ppm(5) format:

    dc20ctrl -pc

Add the -a switch to have the correct aspect ratio in photo's, like in:

    dc20ctrl -pca

To download image number 4, rotating it to the rigth before saving in JPEG:

    dc20ctrl -pcajn 4r

To download all images, rotating all them to the left but image 6, and saving in PNG format:

    dc20ctrl -pcaNn l:1-5,6s,7-16

or

    dc20ctrl -pcaNn l:1-16,6s

To convert a bunch of .cmt files to TIFF format, without deleting them:

    dc20ctrl -okcaF *.cmt

Finally, to take a photo, download it in ppm(5) format and then erase all camera memory without confirmation, use:

    dc20ctrl -spcaef

this command may be used in a script file to take a photo in an automatic way, for example to monitor a room.

FILES
./.dc20ctrlrc - Current directory session counter. ~/.dc20ctrlrc - Global session counter.

SEE ALSO
touch(1), pgm(5), ppm(5)

LEGAL MUMBO-JUMBO
Copyright (C) 1998 Ugo Paternostro <paterno@dsi.unifi.it>

I am in no way connected to Kodak (Eastman Kodak), nor I belong to their "developer support program".

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

AUTHOR
Ugo Paternostro <paterno@dsi.unifi.it> wrote dc20ctrl starting for the dc20 project of Karl Hakimian <hakimian@eecs.wsu.edu>

Yoshida Hideki <hideki@yk.rim.or.jp> wrote the cmttoppm conversion routine.

BUGS
There may be some. Please, report them to the author.

AVAILABILITY
The last version of dc20ctrl is available into my WWW home page (http://aguirre.dsi.unifi.it/~paterno) as http://aguirre.dsi.unifi.it/~paterno/binaries/dc20ctrl.tar.gz