File DevelopSettings.lua
Functions
DevelopSettings.getSpecTable () | Get develop setting specifications table. |
DevelopSettings:adjustPhotos (photos, undoTitle, ments, tmo) | Adjust specified settings. |
DevelopSettings:appliesTo (id, pvCode) | Determine if specified setting applies to specified process version (see codes above) |
DevelopSettings:applyAdjustments (params) | Apply develop setting adjustments, absolutely, respecting pre-requisites, and optionally: constraints. |
DevelopSettings:assureBasicSettings (photo, dev) | Assure stabilized basic settings, of any process version. |
DevelopSettings:assureLegacyBasicSettings (photo, dev) | Assures legacy settings are settled, generally after auto-tone applied, presumably in calling context. |
DevelopSettings:assurePrereqs (photo, id, tmo) | Assures pre-requisites are met for specified photo, specified adjustment. |
DevelopSettings:assurePv2012BasicSettings (photo, dev, tmo, atFlag, expSettings) | Assures PV2012 settings are settled, generally after auto-tone applied, presumably in calling context. |
DevelopSettings:constrainSetting (id, value) | for constraining individual settings whilst building. |
DevelopSettings:getAdobeDefaultSettings (fmt, pv) | Get Adobe default settings, for reset purposes. |
DevelopSettings:getDevelopSettings (photo, autoToneFlag) | Get develop settings for photo or video, when available. |
DevelopSettings:getFriendlySettingName (id) | Get friendly setting name given specified setting id. |
DevelopSettings:getItem (id) | Get item from lookup table. |
DevelopSettings:getLookup () | Get lookup table for setting ID to setting spec. |
DevelopSettings:getPopupMenuItems (pv) | Get popup according to specified stipulation (process version - internal string representation). |
DevelopSettings:getPvCode (devSettings) | Get process version code from specified develop settings. |
DevelopSettings:getUserPreset (name) | Get Lr preset object based on preset (leaf) name. |
DevelopSettings:initUserPresets () | initialize develop preset cache. |
DevelopSettings:isLegacy (pv) | Determine if process version (pass pv string or whole dev-settings table) is a legacy process version. |
DevelopSettings:isPv2012 (pv) | Determine if process version (pass pv string or whole dev-settings table) is PV2012. |
DevelopSettings:new (t) | Constructor for new instance. |
DevelopSettings:newClass (t) | Constructor for extending class. |
DevelopSettings:transferAdjustments (params) | Transfer adjustments from one photo to one or more photos |
Functions
- DevelopSettings.getSpecTable ()
- Get develop setting specifications table.
- DevelopSettings:adjustPhotos (photos, undoTitle, ments, tmo)
-
Adjust specified settings.
Parameters:
-
photos
: (array of LrPhoto, reauired) photos to adjust. -
undoTitle
: (string, reauired) alias: presetName. -
ments
: (table, required) adjust-ments to make, as a table of name/value pairs. -
tmo
: (number, default=10) seconds to wait for catalog - ignored if already has write access.
Usage:
This wrapper to roll adjustments into a preset and optionally wrap for catalog access - does *NOT* assure pre-requisites.
synchronous - must be called from async task.
Return values:
- status
- message
-
- DevelopSettings:appliesTo (id, pvCode)
-
Determine if specified setting applies to specified process version (see codes above)
Parameters:
-
id
: -
pvCode
:
-
- DevelopSettings:applyAdjustments (params)
-
Apply develop setting adjustments, absolutely, respecting pre-requisites, and optionally: constraints.
Parameters:
-
params
: containing:
adjustmentRecords (array) elements:
photo
settings
title
undoTitle (string, default is computed). caption (string, optional) scope caption. preConstrained (boolean, default=false) if true, constraints will not be re-evaluated.
metadataCache (boolean, default=false) if true, constraints will not be re-evaluated.
call (Call, default=nil) if passed, caption & progress will be updated.
Usage:
Must *NOT* be pre-wrapped for catalog access.
internally wrapped for error handling, so returns status, message instead of throwing errors, if possible.
operates synchronously, so must be called from async task.
Return values:
- status (boolean) t or f.
- message (string) nil or error.
-
- DevelopSettings:assureBasicSettings (photo, dev)
-
Assure stabilized basic settings, of any process version.
Parameters:
-
photo
: -
dev
:
-
- DevelopSettings:assureLegacyBasicSettings (photo, dev)
-
Assures legacy settings are settled, generally after auto-tone applied, presumably in calling context.
Parameters:
-
photo
: -
dev
:
Usage:
Could also be called to assure photo has settled after changing process version.
-
- DevelopSettings:assurePrereqs (photo, id, tmo)
-
Assures pre-requisites are met for specified photo, specified adjustment.
Parameters:
-
photo
: -
id
: -
tmo
:
Usage:
this is generally called when building relatively adjusted photo settings table, to avoid missing relative adjustments due to lack of existing setting.
Some methods also have built-in pre-req assurance, but that may be after-the-fact in the afore-mentioned case.this gains access to catalog, makes adjustment, then commits it (exists catalog accessor), and sleeps, for *each* adjustment to *each* photo.
and so it is not a speed demon, to say the least. But I've yet to figure out a reliable settling algorithm that handles all cases.
Return values:
- status (boolean) nil => error: see message; true => pre-req assured, no message accompaniment; false => no pre-req assurance need be satisfied for setting - see message for verbose logging...
- message (string) error or qualifying message, depending on status.
-
- DevelopSettings:assurePv2012BasicSettings (photo, dev, tmo, atFlag, expSettings)
-
Assures PV2012 settings are settled, generally after auto-tone applied, presumably in calling context.
Parameters:
-
photo
: (LrPhoto, required) -
dev
: (table, optional) Initial develop settings, if already available in calling context. -
tmo
: (number, default=6) Number of seconds to allow for settling. Note - actual time required may depend on number of photos recently adjusted which have to settle. -
atFlag
: (boolean, default=false) -
expSettings
:
Usage:
Could also be called to assure photo has settled after changing process version.
Return values:
- develop settings, once settled.
- error message, if unsettleable.
-
- DevelopSettings:constrainSetting (id, value)
-
for constraining individual settings whilst building.
Parameters:
-
id
: -
value
:
Usage:
can also be used for looking up friendly name (title) for (enum) value.
-
- DevelopSettings:getAdobeDefaultSettings (fmt, pv)
-
Get Adobe default settings, for reset purposes.
Parameters:
-
fmt
: -
pv
:
-
- DevelopSettings:getDevelopSettings (photo, autoToneFlag)
-
Get develop settings for photo or video, when available. (not available when video has trim-end=nil).
Parameters:
-
photo
: -
autoToneFlag
:
-
- DevelopSettings:getFriendlySettingName (id)
-
Get friendly setting name given specified setting id.
Parameters:
-
id
:
-
- DevelopSettings:getItem (id)
-
Get item from lookup table.
Parameters:
-
id
:
-
- DevelopSettings:getLookup ()
- Get lookup table for setting ID to setting spec.
- DevelopSettings:getPopupMenuItems (pv)
-
Get popup according to specified stipulation (process version - internal string representation).
Parameters:
-
pv
:
-
- DevelopSettings:getPvCode (devSettings)
-
Get process version code from specified develop settings.
Parameters:
-
devSettings
:
-
- DevelopSettings:getUserPreset (name)
-
Get Lr preset object based on preset (leaf) name.
Parameters:
-
name
:
Usage:
@4/Apr/2014 20:45 only used by Ottomanic Importer.
-
- DevelopSettings:initUserPresets ()
- initialize develop preset cache.
- DevelopSettings:isLegacy (pv)
-
Determine if process version (pass pv string or whole dev-settings table) is a legacy process version.
Parameters:
-
pv
:
-
- DevelopSettings:isPv2012 (pv)
-
Determine if process version (pass pv string or whole dev-settings table) is PV2012.
Parameters:
-
pv
:
-
- DevelopSettings:new (t)
-
Constructor for new instance.
Parameters:
-
t
:
Usage:
Singleton for interfacing to develop settings subsystem.
-
- DevelopSettings:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-
- DevelopSettings:transferAdjustments (params)
-
Transfer adjustments from one photo to one or more photos
Parameters:
-
params
: (array of parameters, reauired) thusly:
metadataCache (LrMetadata cache, optional) if passed, be sure to include raw ids: path, isVirtualCopy, and fmt id: copyName.
fromPhoto (LrPhoto, reauired) source photo. toPhoto (LrPhoto *or* array of them, required) target photo(s). exclusions (table, default=nil) set of dev-setting names to be excluded, otherwise none will be excluded. inclusions (table, default=nil) set of dev-setting names to be included *** note: it's an error if exclusions are passed too. if inclusions not passed, all will be included unless excluded. timeout (number, default=10) number of seconds to contend for catalog access - ignored if pre-wrapped. exifToolSession (ExifToolSession, default=nil) not yet implemented, if passed, exiftool will be used to transfer settings via xmp, instead of sdk. Will require metadata read upon return.
Usage:
Does *NOT* assure pre-requisites, nor consider pv mismatching.
will wrap with catalog accessor if need be - recommend pre-wrapping if multiple target photos, or done in a loop with a bunch of source photos.
synchronous - must be called from async task.
Return values:
- status (boolean) true iff aok, otherwise false/nil.
- message (string) error message - only if not aok.
-