mode 0 menu "Advanced Exposure Modes" name "Quick Exposure Bracketer" label "Quick Bracketing" ########################################################################## ## ## ## QUIKBRAK.CSM - Quick Exposure (Semi-)Bracketer ## ## Public Domain by Ralf Brown ## ## 815 Copeland Way PMB 26 ## ## Pittsburgh, PA 15232-2217 ## ## USA ## ## ## ## Version 2.0 ## ## Last Edit 30jan00 ## ## ## ## Target Devices: Kodak DC220/DC26x/DC290, Minolta Dimage EX1500 ## ## (developed and tested on a DC260 for v1.0, DC290 thereafter) ## ## ## ## Documentation ## ## ============= ## ## ## ## This script will let you take two or three (except on the DC260) ## ## pictures in quick succesion, applying different exposure ## ## compensations to each picture. All of the pictures are taken ## ## back-to-back with a single press of the shutter button. ## ## ## ## To install, simply copy this file to the SYSTEM folder on your ## ## camera's flash card, using either a card reader, PC-Card slot, or ## ## the Mounter software. After re-inserting the card into the camera ## ## (or turning it off then on again when using the Mounter), you will ## ## see a new item in the "Advanced Exposure Modes" menu, in addition ## ## to the customary Programmed AE, Long Time, and External Flash. ## ## ## ## By default, this script will ask whether you are using the optical ## ## or the LCD viewfinder every time that it is run. See the ## ## instructions in the configuration section below to force it to use ## ## one or the other all the time. You can also turn off the brief ## ## reminder of which picture is being taken, to save some more time. ## ## ## ## If you elect to take three picturs, then the third picture will ## ## be taken at the midpoint between the two compensation values you've ## ## selected; if these values are asymmetric, the third picture will ## ## not use the Auto setting (e.g. for compensations of +1.5 and +2.0, ## ## the third picture will use +1.75). ## ## ## ## Known Limitations ## ## ================= ## ## ## ## Due to a bug in the DC290 firmware (including the 1.0.3 prerelease) ## ## it is not possible to use the shutter button to trigger the ## ## picture-taking when using the optical viewfinder. As a workaround, ## ## you will be prompted to press a softkey below the LCD. ## ## ## ########################################################################## declare i:lo_xcmp, hi_xcmp, xcmp, min_xcmp, max_xcmp, default_xcmp declare i:iRawCount, iComp, iTmp, xcmp_units declare i:status declare u:choice, liveview, uVarType, uStorage, uValue, uAvailable, uRemaining declare u:irev, fwrv, oerv, smod, u_ret, tenths, hundredths, num_captures declare u:count, IPIP, have_Digita1point5 declare i:SYSTEM_BUSY, ERROR declare s:sPrompt, sProductName, sign, s_value declare b:verbose, bSysStat, bCapStat, bVendStat, allow_flash, buggy_DC290 declare b:bButtonPressed, three_pics ######################################################### ### Configuration Section ### ######################################################### ## if you want a short reminder before each picture is taken, use the first ## line here, if not, you can slightly speed up the process by using the ## second line. Uncomment the one you want by removing the hash mark (#) ## and comment out the one you don't want by adding one at the start of ## that line. verbose = 1 # verbose = 0 ## you can force whether or not to use the LCD viewfinder prior to pressing ## the shutter button to take the pictures. If neither of the following ## is uncommented, you will be asked each time the script is run whether ## you want to use the LCD viewfinder or the optical viewfinder. ## always use LiveView # liveview = 2 ## never use LiveView # liveview = 3 ## since current models don't support exposure compensation when using the ## internal flash, force the flash mode to Off unless allowed here by setting ## the variable to 1 allow_flash = 0 # allow_flash = 1 ######################################################### ### End of Configuration Section ### ######################################################### # # Set up the manifest constants # SYSTEM_BUSY = 12 ERROR = 99999 IPIP = 0x10000000 bButtonPressed = 0x00040000 # # first, see whether exposure compensation is available # status = 0 status = GetCapabilityType("xcmp",uVarType) if status != 0 Alert("Exposure Compensation is not ","supported by this camera.") exitscript end if uVarType != 2 Alert("Exposure Compensation can not ","be set to arbitrary values by ", "this camera.") exitscript end # # OK, exposure compensation is available, so get the valid range and current # value # status = 0 status = GetCapabilitiesRange("xcmp",min_xcmp,max_xcmp,default_xcmp) if status == 0 GetCameraState("xcmp",xcmp) end if status != 0 Alert("Error retrieving exposure ","compensation range!") exitscript end # # if we are forcing the flash off, get and remember the current state # if allow_flash == 0 status = 0 status = GetCameraState("smod",smod) if status != 0 DisplayLine("warning -- error retrieving current flash mode.") Wait(1500) end # turn off the flash SetCameraState("smod",3) end # # figure out whether we need to special-case anything due to the camera type # have_Digita1point5 = 0 status = 0 status = GetProductInfo("oerv",oerv) if status == 0 have_Digita1point5 = 1 end GetProductInfo("ptid", sProductName) if sProductName == "KODAK DC290 Zoom Digital Camera" # the DC290 firmware has a bug that causes it not to report presses of # the shutter button correctly (v1.0.0 never reports a press, 1.0.3 # reports spurious presses) status = GetProductInfo("fwrv",fwrv) if fwrv < 0xFF000300 # bug fixed in some as-yet unreleased version buggy_DC290 = 1 end end # all but the DC260 can take at least three pics in rapid succession three_pics = 1 if sProductName == "KODAK DIGITAL SCIENCE DC260" three_pics = 0 end # # next, check whether we have enough space for two more pictures. Iterate # through all three possible storage areas (0 = internal, 1 = first # removable, 2 = second removable). Current Kodak and Minolta cameras # don't have either internal or second removable, but we want to be # prepared for new models. # uStorage = 0 uRemaining = 0 storage_loop: status = 0 status = GetStorageStatus(uStorage,uValue,uAvailable,iRawCount) if status == 0 uRemaining = uRemaining + uAvailable end uStorage = uStorage + 1 if uStorage < 3 goto storage_loop end #end of storage_loop if uRemaining < 2 Alert("Not enough memory to take ","two more pictures! Try ","reducing the image size or ","insert another memory card.") exitscript end if uRemaining < 3 three_pics = 0 end # # get the current instant review (QuickView) duration # status = 0 status = GetCameraState("irev",irev) if status != 0 Alert("got status ",status," while reading Quickview ","duration.") end # # Startup is now complete. Ask the user what to do. # SetOption(1,"Select compensation...") SetOption(2,"Auto and +1 EV") SetOption(3,"+0.5 and +1.5 EV") SetOption(4,"+1.5 and +2 EV (polarizer)") SetOption(5,"-1 EV and +1 EV") GetOption(choice) if choice == 2 lo_xcmp = 0 hi_xcmp = 100 end if choice == 3 lo_xcmp = 50 hi_xcmp = 150 end if choice == 4 lo_xcmp = 150 hi_xcmp = 200 end if choice == 5 lo_xcmp = -100 hi_xcmp = 100 end if choice == 1 sPrompt = "first" u_ret = 1 goto GetCompensation ret_1: lo_xcmp = 0 if iComp != ERROR lo_xcmp = iComp end sPrompt = "second" u_ret = 2 goto GetCompensation ret_2: hi_xcmp = 0 if iComp != ERROR hi_xcmp = iComp end end # # find out (if possible) whether to take a third pic at the midpoint # if three_pics SetOption(0,"Take two pictures only") SetOption(1,"Take third in-between pic") GetOption(choice) if choice == 0 three_pics = 0 end end # # find out (if necessary) whether or not to use the LCD viewfinder # if liveview < 2 SetOption(0,"Use Optical Viewfinder") SetOption(1,"Use LCD Viewfinder") GetOption(liveview) end if liveview >= 2 liveview = liveview - 2 end # # before we actually attempt to get the pictures, wait until any previous # images finish processing # Wait(500) GetCameraStatus(bSysStat, bCapStat, bVendStat) if bSysStat & IPIP DisplayClear() DisplayLine("Waiting for current image") DisplayLine("processing to complete.") Wait(1000) ipip_loop: GetCameraStatus(bSysStat, bCapStat, bVendStat) if bSysStat & IPIP Wait(1000) goto ipip_loop end end # # turn off QuickView for faster capture. There is a bug in the Kodak 1.0.6 # firmware which makes the QuickView come up for ~1/4s after each # StartCapture() even when turned off.... # status = 0 status = SetCameraState("irev",0) if status != 0 Alert("Got status ",status," while turning off QuickView") end Wait(50) # # we are finally ready to take those pictures # SetCaptureMode(still) # # if using the optical viewfinder, display the instructions now. # if liveview == 0 DisplayClear() if buggy_DC290 Alert("Frame your picture, then press 'Continue' to take both pictures.") goto GotButton end DisplayLine("Press Shutter Button.") DisplayLine("Don't move camera until all") DisplayLine("pictures have been taken") end # # wait for the user to press the shutter button # count = 0 if liveview != 0 ShutterLoop1: status = 0 status = WaitForShutter("Press Shutter to Start") if status == SYSTEM_BUSY DisplayLine("Busy") Wait(1000) goto ShutterLoop1 end if status != 0 count = count + 1 if count < 10 Wait(250) goto ShutterLoop1 end DisplayLine("Something Went Wrong!") Wait(3000) exitscript end end if liveview == 0 ShutterLoop2: GetCameraStatus(bSysStat, bCapStat, bVendStat) ###DisplayLine("shutter state = ",bSysStat) # see if shutter button depressed all the way if bSysStat & bButtonPressed == 0 count = count + 1 if count > 200 DisplayLine("Shutter not pressed!") Wait(3000) exitscript end Wait(250) goto ShutterLoop2 end end GotButton: # # user has pressed the shutter button, so take the pictures # num_captures = 0 sPrompt = "first" iComp = lo_xcmp u_ret = 100 goto CapturePicture ret_100: if three_pics sPrompt = "in-between" iComp = lo_xcmp + hi_xcmp iComp = iComp / 2 u_ret = 101 goto CapturePicture ret_101: end sPrompt = "second" iComp = hi_xcmp u_ret = 102 goto CapturePicture ret_102: Wait(50) if allow_flash == 0 status = 0 status = SetCameraState("smod",smod) if status != 0 Alert("Unable to restore flash mode. You wil need to reset it manually.") end end status = 0 status = SetCameraState("xcmp",xcmp) if status != 0 Alert("Unable to restore exposure ","compensation. You will need ","to reset it manually.") end status = 0 status = SetCameraState("irev",irev) if status != 0 Alert("Unable to restore QuickView ","duration. You will need ","to reset it manually.") end Wait(50) DisplayClear() if num_captures > 2 DisplayLine("All pictures have been") DisplayLine("taken successfully!") goto Done end if num_captures == 2 if three_pics == 0 DisplayLine("Both pictures have been") DisplayLine("taken successfully!") goto Done end end DisplayLine("An error was encountered") DisplayLine("on one or more pictures.") Done: Wait(2500) exitscript ####################################################################### GetCompensation: DisplayClear() DisplayLine("Select the exposure") DisplayLine("compensation to be") DisplayLine("applied to the ",sPrompt) DisplayLine("picture.") Wait(2000) SetOption(1,"Negative EV (darker)") SetOption(2,"none (use Auto-Exposure)") SetOption(3,"Positive EV (lighter)") if have_Digita1point5 != 0 SetOption(4,"Enter arbitrary EV") end GetOption(choice) if choice == 1 SetOption(25, "-0.25 EV") SetOption(50, "-0.50 EV") SetOption(75, "-0.75 EV") SetOption(100,"-1.00 EV") SetOption(125,"-1.25 EV") SetOption(150,"-1.50 EV") if min_xcmp <= -175 SetOption(175,"-1.75 EV") end if min_xcmp <= -200 SetOption(200,"-2.00 EV") end if min_xcmp <= -250 SetOption(250,"-2.50 EV") end if min_xcmp <= -300 SetOption(300,"-3.00 EV") end if min_xcmp <= -350 SetOption(350,"-3.50 EV") end if min_xcmp <= -400 SetOption(400,"-4.00 EV") end GetOption(uValue) iComp = -1 * uValue end if choice == 2 iComp = 0 end if choice == 3 SetOption(25, "+0.25 EV") SetOption(50, "+0.50 EV") SetOption(75, "+0.75 EV") SetOption(100,"+1.00 EV") SetOption(125,"+1.25 EV") SetOption(150,"+1.50 EV") if max_xcmp >= 175 SetOption(175,"+1.75 EV") end if max_xcmp >= 200 SetOption(200,"+2.00 EV") end if max_xcmp >= 250 SetOption(250,"+2.50 EV") end if max_xcmp >= 300 SetOption(300,"+3.00 EV") end if max_xcmp >= 350 SetOption(350,"+3.50 EV") end if max_xcmp >= 400 SetOption(400,"+4.00 EV") end if max_xcmp >= 450 SetOption(450,"+4.50 EV") end if max_xcmp >= 500 SetOption(500,"+5.00 EV") end GetOption(uValue) iComp = uValue end if choice == 4 getcomp_string: GetString("Adjustment in 1/100 EV",5,s_value) if s_value == "" Alert("Please enter a number between ",min_xcmp," and ",max_xcmp) goto getcomp_string end StringToNumber(s_value,iComp) if iComp < min_xcmp Alert(min_xcmp," is the lowest allowed value. Please re-enter.") goto getcomp_string end if iComp > max_xcmp Alert(max_xcmp," is the highest allowed value. Please re-enter.") goto getcomp_string end end getcomp_return: if u_ret == 1 goto ret_1 end if u_ret == 2 goto ret_2 end Alert("Program Error: missing return ","case in GetCompensation") Wait(50) exitscript ####################################################################### CapturePicture: if verbose != 0 sign = "" iTmp = iComp if iComp > 0 sign = "+" end if iComp < 0 sign = "-" iTmp = -1 * iTmp end xcmp_units = iTmp / 100 hundredths = iTmp - 100 * xcmp_units tenths = hundredths / 10 hundredths = hundredths - 10 * tenths DisplayClear() DisplayLine("The ",sPrompt," picture will now") DisplayLine(" be taken at ",sign,xcmp_units,".",tenths,hundredths," EV.") Wait(250) end status = 0 status = SetCameraState("xcmp",iComp) if status != 0 Alert("unable to set exposure ","compensation! Skipping.") goto cap_return end capture_loop: status = 0 status = StartCapture() if status == SYSTEM_BUSY Wait(500) Display(".") goto capture_loop end if status == 0 num_captures = num_captures + 1 end if status != 0 Alert("Error ",status," while attempting to ","take the picture!") end cap_return: if u_ret == 100 goto ret_100 end if u_ret == 101 goto ret_101 end if u_ret == 102 goto ret_102 end Alert("Program Error: missing return ","case in CapturePicture") Wait(50) exitscript ######################################################################### # End of File # #########################################################################