# ExpBrck.csm Version 2.0.0000 # This routine will perform a bracketed capture of an image. This is defined as taking a # picture and subsequent pictures at +/- a fixed exposure value (EV). The routine will # also check the capacity of the camera to hold three new images. The flow of the script # is as follows: # # A. Get camera type. If not KODAK DC220/260/265/290 go to error processing. # B. Get initial settings: exposure compensation and image resolution. # C. Check available capacity to take three picture. Set to a lower resolution if # necessary to fit three. Go to error processing if three image will not fit. # D. Get capture type: # 1. Automatic: the camera will prompt the user that the camera is ready and then # take the picture without user intervention. # 2. Manual: the camera will prompt the user that the camera is ready and then # wait for the user to take the picture. # 3. Help: display short definition of Automatic and Manual using a timed wait. # 4. End: exit routine without action. # E. Get user bracket value (+/- .5, 1, 1.5, 2) or return to capture type. # F. Take the three exposure based on capture type and bracket value. # G. Error processing if necessary. # H. Restore camera to original settings, prompt the user of completion and exit routine. name "Exposure Bracketing" mode 0 menu "Kodak Scripts" label "Exposure Bracketing" # Variable declaration and definition declare u: uTemp, uError, uStorage, uImageTaken, uImageAvail, uSsiz, uCameraType declare u: uSelectStop, uSelectCapture, uSelect,uSmod declare i: iFlagOn, iFlagOff, iInitialEV, iImageRaw, iErrorCode, iBracketValue, iTemp declare s: sProductName, sVendorName, sCameraType, sTemp, sStop declare b: bCameraType declare f: fTemp # Variable initialization iErrorCode = 0 iFlagOn = 1 iFlagOff = 0 uCameraType = 0 # Get camera name GetProductInfo ("ptid", sProductName) GetProductInfo ("vdid", sVendorName) if sProductName == "KODAK DIGITAL SCIENCE DC220" uCameraType = 220 sCameraType = "DC220" end if sProductName == "KODAK DIGITAL SCIENCE DC260" uCameraType = 260 sCameraType = "DC260" end if sProductName == "KODAK DC265 ZOOM DIGITAL CAMERA" uCameraType = 265 sCameraType = "DC265" end if sProductName == "KODAK DC290 Zoom Digital Camera" uCameraType = 290 sCameraType = "DC290" end if uCameraType == 0 iErrorCode = 10 goto ErrorProc end DisplayLine ("Three (3) pictures will be captured at different levels of exposure.") Wait (3000) # Get initial camera settings GetCameraState ("xcmp", iInitialEV) GetCameraState ("ssiz", uSsiz) GetCameraState ("smod", uSmod) if uSmod != 3 SetCameraState ("smod", 3) Wait (1000) end # Check available memory uStorage = 1 iImageRaw = -1 GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 if uSsiz > 2 iErrorCode = 20 goto ErrorProc end if uCameraType == 220 SetCameraState ("ssiz", 3) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 iErrorCode = 20 uError = 4 - uImageAvail goto ErrorProc end end if uCameraType == 260 SetCameraState ("ssiz", 2) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 SetCameraState ("ssiz", 3) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 iErrorCode = 20 uError = 4 - uImageAvail goto ErrorProc end end end if uCameraType == 265 SetCameraState ("ssiz", 2) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 SetCameraState ("ssiz", 3) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 iErrorCode = 20 uError = 4 - uImageAvail goto ErrorProc end end end if uCameraType == 290 SetCameraState ("ssiz", 2) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 Alert ("Due to insufficient memory, the camera's resolution has been reduced to \"Standard\".") SetTitle("Accept New Settings?") SetOption(1, "No", 0) SetOption(2, "Yes", 0) GetOption(uTemp) if uTemp == 1 iErrorCode = 5 goto Finish end SetCameraState ("ssiz", 3) GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail < 4 iErrorCode = 20 uError = 4 - uImageAvail goto ErrorProc end end end end # Ask what capture type GetCaptureType: SetOption (1, "Automatic Capture", iFlagOn) SetOption (2, "Manual Capture", iFlagOff) SetOption (3, "Help", iFlagOff) SetOption (4, "End", iFlagOff) GetOption (uSelectCapture) if uSelectCapture == 4 iErrorCode = 1 goto Finish end if uSelectCapture == 3 DisplayClear () Alert ("Exposure bracketing is a method of 'surrounding' the exposure level of a given image.") DisplayClear () Alert ("Three pictures will be taken. The first at the normal level of exposure and the next two at +/- an 'exposure value'.") DisplayClear () Alert ("One exposure value (EV) is the equivalent of one exposure or aperture stop.") DisplayClear () Alert ("AUTOMATIC: the camera will prompt the user and then automatically take the three (3) pictures.") DisplayClear () Alert ("MANUAL: the user will be prompted to take the three (3) pictures.") DisplayClear () Wait (1000) goto GetCaptureType end # Ask what exposure level to bracket SetOption (1, "+/- 1/2 EV", iFlagOff) SetOption (2, "+/- 1 EV", iFlagOff) SetOption (3, "+/- 1 1/2 EV", iFlagOff) SetOption (4, "+/- 2 EV", iFlagOff) SetOption (10, "Return", iFlagOff) GetOption (uSelectStop) if uSelectStop == 1 iBracketValue = 50 sStop = "1/2" end if uSelectStop == 2 iBracketValue = 100 sStop = "1" end if uSelectStop == 3 iBracketValue = 150 sStop = "1 1/2" end if uSelectStop == 4 iBracketValue = 200 sStop = "2" end if uSelectStop == 10 goto GetCaptureType end # Start Bracket Exposure DisplayClear () SetOption (1, "Begin Capture", iFlagOn) SetOption (10, "Return", iFlagOff) GetOption (uSelect) if uSelect == 10 goto GetCaptureType end DisplayClear () if uSelectCapture == 1 DisplayLine ("Three consectutive pictures will automatically be taken.") end DisplayLine ("First picture is at normal exposure.") Wait (5000) Alert ("Position the camera to take the desired picture. Press CONTINUE to start capturing the exposure bracket.") Wait (1000) SetCaptureMode (still) # take at programmed AE if uSelectCapture == 2 WaitForShutter ("Take normal exposure") end StartCapture () # take picture at upper bracket DisplayClear () DisplayLine ("Next picture is +", sStop, " EV.") Wait (6000) uError = SetCameraState ("xcmp", iBracketValue) if uError != 0 iErrorCode = 50 goto ErrorProc end TakePlusExp: if uSelectCapture == 2 WaitForShutter ("Take Plus Exposure") end uError = StartCapture () if uError == 12 # system is busy Wait (1000) Display (".") goto TakePlusExp end if uError != 0 iErrorCode = 60 goto ErrorProc end # take picture at lower bracket iTemp = -1 * iBracketValue DisplayClear () DisplayLine ("Next picture is -", sStop, " EV.") Wait (6000) uError = SetCameraState ("xcmp", iTemp) if uError != 0 iErrorCode = 50 goto ErrorProc end TakeMinusExp: if uSelectCapture == 2 WaitForShutter ("Take Minus Exposure") end uError = StartCapture () if uError == 12 # system is busy Wait (1000) Display (".") goto TakeMinusExp end if uError != 0 iErrorCode = 60 goto ErrorProc end EndCapture () ErrorProc: SetCameraState ("smod", uSmod) Wait (1500) if iErrorCode > 1 DisplayClear () if iErrorCode == 10 Alert ("Error: camera not supported.") end if iErrorCode == 20 Alert ("Insufficient memory: ", uError, " pictures must be removed to perform exposure bracket.") end if iErrorCode == 50 Alert ("Error: set camera state <", uError, ">.") end if iErrorCode == 60 Alert ("Error: start capture <", uError, ">.") end end Finish: # set camera to initial values SetCameraState ("smod", uSmod) Wait (1500) SetCameraState ("xcmp", iInitialEV) SetCameraState ("ssiz", uSsiz) if iErrorCode == 0 Alert ("Bracket capture is complete. Switch to review mode to view the pictures.") end Done: SetCameraState ("smod", uSmod) Wait (1500) exitscript