# PixClrty.csm Version 2.0.0000 # The routine allows the user to change the image quality based on the type of output # use of the images. The flow of the script is as follows: # # A. Get camera type: KODAK DC220, DC260 DC265 or DC290 else go to error processing. # B. Get camera initial states (resolution and compression) # C. Get camera capabilities (resolution and compression) # D. Get user's selection # 1. Highest Quality Print: maximum resolution and minimum compression # 2. Small Print Quality: high resolution (max for 220 and second level for 260) # and minimum compression. # 3. Full Screen Display: maximum resolution and maximum compression. # 4. Small Screen Display: minimum resolution and maximum compression. # 5. Custom Quality: users selects resolution: highest, high and standard # compression: high, normal and low. This is based on camera capabilities # a. Get the available sections from the camera using the GetCapability # function. # b. Compression relies on known values of the camera capabilities to # produce the option strings. # c. Resolution uses the first menu option to define the selections and # then the actual strings for the subsequent options. # d. (b) and (c) are intended as two possibilities for option selection. # I'm looking for feedback on peoples preferences on which one to use. # (c) would be more universal and changes to the text or additional # options would not effect the select. (b) is more concise. # 6. Get Current Image Settings: display current settings of resolution and # compression. # 7. End: exit with no action. # E. Error processing if necessary. # F. Check for available space under new setting. Prompt use if no remaining capacity. # G. Prompt the user that the selection was set. name "Picture Clarity" mode 0 menu "Kodak Scripts" label "Picture Clarity" # Variable declaration and definition declare u: uTemp, uError, uStorage, uImageTaken, uImageAvail, uCameraType, uSelectRes declare u: uSelectComp, uCurrentComp, uCurrentRes, uValue, uCount declare u: uSelectSetting, uCompCount, uResCount declare u: uCompMinValue, uCompMaxValue, uResMaxValue, uResMinValue declare i: iFlagOn, iFlagOff, iInitialEV, iImageRaw, iErrorCode, iTemp, iValue declare s: sProductName, sVendorName, sCameraType, sTemp, sDesc, sSetting, sRes, sCompr # Variable initialization iErrorCode = 0 uCameraType = 0 iFlagOn = 1 iFlagOff = 0 # Get camera name, we can error out if non DC220/260/265/290 camera 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 # Get initial camera settings GetCameraState ("scpn", uCurrentComp) GetCameraState ("ssiz", uCurrentRes) GetCapabilitiesCount ("scpn", uCompCount, uValue) uTemp = 0 GetCapabilitiesListItem ("scpn", uTemp, sDesc, uCompMaxValue) uTemp = uCompCount - 1 GetCapabilitiesListItem ("scpn", uTemp, sDesc, uCompMinValue) GetCapabilitiesCount ("ssiz", uResCount, uValue) uTemp = 0 GetCapabilitiesListItem ("ssiz", uTemp, sDesc, uResMinValue) uTemp = uResCount - 1 GetCapabilitiesListItem ("ssiz", uTemp, sDesc, uResMaxValue) Alert ("Choose the intended image use from the following menu. The appropriate quality and resolution settings will be reset.") GetSetting: # get user selected quality SetOption (1, "Highest Print Quality", iFlagOff) SetOption (2, "Small Prints (5x7 and smaller)", iFlagOff) SetOption (3, "Full Screen Images", iFlagOff) SetOption (4, "Small Screen Images", iFlagOff) SetOption (5, "Custom Picture Clarity", iFlagOff) SetOption (6, "Current Picture Clarity", iFlagOff) SetOption (7, "End", iFlagOff) GetOption (uSelectSetting) # Highest Print: Hi resolution and Lo compression if uSelectSetting == 1 if uCameraType == 220 SetCameraState ("scpn", uCompMinValue) SetCameraState ("ssiz", uResMaxValue) sSetting = "highest print quality" sRes = "High" sCompr = "Best" goto Finish end if uCameraType == 260 SetCameraState ("scpn", uCompMinValue) SetCameraState ("ssiz", uResMaxValue) sSetting = "highest print quality" sRes = "High" sCompr = "Best" goto Finish end if uCameraType == 265 SetCameraState ("scpn", uCompMinValue) SetCameraState ("ssiz", uResMaxValue) sSetting = "highest print quality" sRes = "High" sCompr = "Super" goto Finish end if uCameraType == 290 SetCameraState ("scpn", 7) SetCameraState ("ssiz", 1) sSetting = "highest print quality" sRes = "High" sCompr = "Uncompressed" goto Finish end end # Small Print: Hi(220), Mid(260), Mid(265) resolution and lo compression if uSelectSetting == 2 SetCameraState ("scpn", uCompMinValue) if uCameraType == 220 SetCameraState ("ssiz", uResMaxValue) sRes = "High" sCompr = "Best" end if uCameraType == 260 uTemp = uResMaxValue + 1 SetCameraState ("ssiz", uTemp) sRes = "Medium" sCompr = "Best" end if uCameraType == 265 uTemp = uResMaxValue + 1 SetCameraState ("ssiz", uTemp) sRes = "Medium" sCompr = "Super" end if uCameraType == 290 SetCameraState ("scpn", 4) SetCameraState ("ssiz", 1) sRes = "High" sCompr = "Best" end sSetting = "small print quality" goto Finish end # Full Scrn: Hi resolution and Hi compression if uSelectSetting == 3 if uCameraType != 290 SetCameraState ("scpn", uCompMaxValue) SetCameraState ("ssiz", uResMaxValue) sSetting = "Full Screen Quality" sRes = "High" sCompr = "Good" goto Finish end if uCameraType == 290 SetCameraState ("scpn", 3) SetCameraState ("ssiz", 2) sSetting = "Full Screen Quality" sRes = "Medium" sCompr = "Better" goto Finish end end # Small Scrn: Lo resolution and Hi compression if uSelectSetting == 4 if uCameraType != 290 SetCameraState ("scpn", uCompMaxValue) SetCameraState ("ssiz", uResMinValue) sSetting = "Small Screen Quality" sRes = "Standard" sCompr = "Good" goto Finish end if uCameraType == 290 SetCameraState ("scpn", 3) SetCameraState ("ssiz", 3) sSetting = "Small Screen Quality" sRes = "Standard" sCompr = "Better" goto Finish end end # Custom settings if uSelectSetting == 5 # I have implemented 2 technics to display selections of setting. # Which on do you like??? # Get compression setting (uses known values for display text) GetSCPN: iValue = 0 SetOption (0, "Select Quality (Compression):", iFlagOff) GetSCPNvalue: GetCapabilitiesListItem ("scpn", iValue, sDesc, uValue) iValue = iValue + 1 if sDesc == "High" sDesc = "Good" end if sDesc == "Normal" sDesc = "Better" end if sDesc == "Low" sDesc = "Best" end if sDesc == "Minimum" sDesc = "Super" end if sDesc == "Lossless" sDesc = "Uncompressed" end SetOption (uValue, sDesc, iFlagOff) if iValue < uCompCount goto GetSCPNvalue end SetOption (10, "Return", iFlagOff) GetOption (uSelectComp) if uSelectComp == 0 goto GetSCPN end if uSelectComp == 2 sCompr = "Good" end if uSelectComp == 3 sCompr = "Better" end if uSelectComp == 4 sCompr = "Best" end if uSelectComp == 5 sCompr = "Super" end if uSelectComp == 7 sCompr = "Uncompressed" end if uSelectComp == 10 goto GetSetting end SetCameraState ("scpn", uSelectComp) # Get resolution setting (uses text from camera only) GetSSIZ: iValue = 0 SetOption (0, "Select Resolution:", iFlagOff) GetNextSSIZ: #Uncompress is chosen, do not display Ultra option if uSelectComp == 7 GetCapabilitiesCount ("ssiz", uResCount, uValue) uResCount = uResCount - 1 end if uSelectComp != 7 GetCapabilitiesCount ("ssiz", uResCount, uValue) end uError = GetCapabilitiesListItem ("ssiz", iValue, sDesc, uValue) iValue = iValue + 1 SetOption (uValue, sDesc, iFlagOff) if iValue < uResCount goto GetNextSSIZ end SetOption (10, "Return", iFlagOff) GetOption (uSelectRes) if uSelectRes == 0 goto GetSSIZ end if uSelectRes == 1 sRes = "High" end if uSelectRes == 2 sRes = "Medium" end if uSelectRes == 3 sRes = "Standard" end if uSelectRes == 4 sRes = "Ultra" end if uSelectRes == 10 goto GetSCPN end SetCameraState ("ssiz", uSelectRes) end # Get current settings if uSelectSetting == 6 GetCameraState ("scpn", uCurrentComp) iValue = 0 GetCurrSCPN: if iValue >= uCompCount iErrorCode = 601 goto ErrorProc end GetCapabilitiesListItem ("scpn", iValue, sDesc, uValue) if uValue != uCurrentComp iValue = iValue + 1 goto GetCurrSCPN end if sDesc == "High" sDesc = " Good " end if sDesc == "Normal" sDesc = "Better" end if sDesc == "Low" sDesc = " Best " end if sDesc == "Minimum" sDesc = " Super " end if sDesc == "Lossless" sDesc = "Uncompressed" end GetCameraState ("ssiz", uCurrentRes) iValue = 0 GetCurrSSIZ: if iValue >= uResCount iErrorCode = 602 goto ErrorProc end GetCapabilitiesListItem ("ssiz", iValue, sTemp, uValue) if uValue != uCurrentRes iValue = iValue + 1 goto GetCurrSSIZ end Alert (" Current Settings Quality: ", sDesc," Resolution: ", sTemp) Wait (500) goto GetSetting end ErrorProc: if iErrorCode == 0 goto Finish end DisplayClear () if iErrorCode == 10 Alert ("Error: camera not supported.") goto Done end if iErrorCode == 601 Alert ("ERROR getting quality value!") goto Done end if iErrorCode == 602 Alert ("ERROR getting resolution value!") goto Done end Finish: if uSelectSetting == 7 goto Done end if uSelectSetting != 5 Alert("Camera has been set to ", sSetting, ". Current settings Quality: ", sCompr, " Resolution: ", sRes) end if uSelectSetting == 5 Alert("Custom clarity set. Current settings Quality: ", sCompr, ", Resolution: ", sRes) end # Check available memory, if user changes resolution uStorage = 1 iImageRaw = -1 GetStorageStatus (uStorage, uImageTaken, uImageAvail, iImageRaw) if uImageAvail == 0 Alert ("There is insuffient memory to take a picture at current settings.") end Wait (500) goto GetSetting Done: exitscript