@@ -54,6 +54,11 @@ Same as other export modules
global options:
global options:
Same as other export modules
Same as other export modules
----TODO----
don't write executale preferences on linux unless asked to
add an initialization value to determine if the program has ever been run before
add sane values so that an image is produced with no value adjustment by the user
]]
]]
local dt = require ' darktable '
local dt = require ' darktable '
@@ -73,7 +78,64 @@ local function _(msgid)
return gettext.dgettext ( ' enfuseAdvanced ' , msgid )
return gettext.dgettext ( ' enfuseAdvanced ' , msgid )
end
end
local initialized = dt.preferences . read ( mod , " initialized " , " bool " )
-- INITS --
-- INITS --
local GUI = {
AIS = {
radial_distortion = nil ,
optimize_field = nil ,
optimize_image_center = nil ,
auto_crop = nil ,
distortion = nil ,
grid_size = nil ,
control_points = nil ,
control_points_remove = nil ,
correlation = nil
} ,
ENF = {
exposure_weight = nil ,
saturation_weight = nil ,
contrast_weight = nil ,
exposure_optimum = nil ,
exposure_width = nil ,
hard_masks = nil ,
save_masks = nil ,
contrast_window_size = nil ,
contrast_edge_scale = nil ,
contrast_min_curvature = nil
} ,
Target = {
format = nil ,
depth = nil ,
compression_level_tif = nil ,
compression_level_jpg = nil ,
output_directory = nil ,
source_location = nil ,
on_conflict = nil ,
auto_import = nil ,
apply_style = nil ,
copy_tags = nil ,
add_tags = nil
} ,
Presets = {
current_preset = nil ,
load = nil ,
save = nil ,
variants = nil ,
variants_type = nil
} ,
exes = {
align_image_stack = nil ,
enfuse = nil ,
exiftool = nil ,
update = nil
} ,
align = nil ,
options_contain = nil ,
show_options = nil
}
local AIS = {
local AIS = {
name = ' align_image_stack ' ,
name = ' align_image_stack ' ,
bin = ' ' ,
bin = ' ' ,
@@ -82,16 +144,16 @@ local AIS = {
arg_string = ' ' ,
arg_string = ' ' ,
images_string = ' ' ,
images_string = ' ' ,
args = {
args = {
radial_distortion = { text = ' -d ' , style = ' bool ' } ,
radial_distortion = { text = ' -d ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.AIS . radial_distortion },
optimize_field = { text = ' -m ' , style = ' bool ' } ,
optimize_field = { text = ' -m ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.AIS . optimize_field },
optimize_image_center = { text = ' -i ' , style = ' bool ' } ,
optimize_image_center = { text = ' -i ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.AIS . optimize_image_center },
auto_crop = { text = ' -C ' , style = ' bool ' } ,
auto_crop = { text = ' -C ' , style = ' bool ' , default_value = true , widget_type = " check_button " , widget = GUI.AIS . auto_crop },
distortion = { text = ' --distortion ' , style = ' bool ' } ,
distortion = { text = ' --distortion ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.AIS . distortion },
gpu = { text = ' --gpu ' , style = ' bool ' } ,
gpu = { text = ' --gpu ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.AIS . gpu },
grid_size = { text = ' -g ' , style = ' integer ' } ,
grid_size = { text = ' -g ' , style = ' string ' , default_value = ' 5 ' , widget_type = " combobox " , widget = GUI.AIS . grid_size } ,
control_points = { text = ' -c ' , style = ' integer ' } ,
control_points = { text = ' -c ' , style = ' string ' , default_value = ' 8 ' , widget_type = " combobox " , widget = GUI.AIS . control_points } ,
control_points_remove = { text = ' -t ' , style = ' integer ' } ,
control_points_remove = { text = ' -t ' , style = ' string ' , default_value = ' 3 ' , widget_type = " combobox " , widget = GUI.AIS . control_points_remove } ,
correlation = { text = ' --corr= ' , style = ' float ' }
correlation = { text = ' --corr= ' , style = ' string ' , default_value = ' 0.9 ' , widget_type = " combobox " , widget = GUI.AIS . correlation }
}
}
}
}
local ENF = {
local ENF = {
@@ -102,16 +164,16 @@ local ENF = {
arg_string = ' ' ,
arg_string = ' ' ,
image_string = ' ' ,
image_string = ' ' ,
args = {
args = {
exposure_weight = { text = ' --exposure-weight= ' , style = ' float ' } ,
exposure_weight = { text = ' --exposure-weight= ' , style = ' float ' , default_value = 1.0 , widget_type = " slider " , widget = GUI.ENF . exposure_weight },
saturation_weight = { text = ' --saturation-weight= ' , style = ' float ' } ,
saturation_weight = { text = ' --saturation-weight= ' , style = ' float ' , default_value = 0.2 , widget_type = " slider " , widget = GUI.ENF . saturation_weight },
contrast_weight = { text = ' --contrast-weight= ' , style = ' float ' } ,
contrast_weight = { text = ' --contrast-weight= ' , style = ' float ' , default_value = 0.0 , widget_type = " slider " , widget = GUI.ENF . contrast_weight },
exposure_optimum = { text = ' --exposure-optimum= ' , style = ' float ' } ,
exposure_optimum = { text = ' --exposure-optimum= ' , style = ' float ' , default_value = 0.5 , widget_type = " slider " , widget = GUI.ENF . exposure_optimum },
exposure_width = { text = ' --exposure-width= ' , style = ' float ' } ,
exposure_width = { text = ' --exposure-width= ' , style = ' float ' , default_value = 0.2 , widget_type = " slider " , widget = GUI.ENF . exposure_width },
hard_masks = { text = ' --hard-mask ' , style = ' bool ' } ,
hard_masks = { text = ' --hard-mask ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.ENF . hard_masks },
save_masks = { text = ' --save-masks ' , style = ' bool ' } ,
save_masks = { text = ' --save-masks ' , style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.ENF . save_masks },
contrast_window_size = { text = ' --contrast-window-size= ' , style = ' integer ' } ,
contrast_window_size = { text = ' --contrast-window-size= ' , style = ' string ' , default_value = ' 5 ' , widget_type = " combobox " , widget = GUI.ENF . contrast_window_size } ,
contrast_edge_scale = { text = ' --contrast-edge-scale= ' , style = ' float ' } ,
contrast_edge_scale = { text = ' --contrast-edge-scale= ' , style = ' string ' , default_value = " 0.0 " , widget_type = " combobox " , widget = GUI.ENF . contrast_edge_scale } ,
contrast_min_curvature = { text = ' --contrast-min-curvature= ' , style = ' string ' }
contrast_min_curvature = { text = ' --contrast-min-curvature= ' , style = ' string ' , default_value = ' 0.0% ' , widget_type = " combobox " , widget = GUI.ENF . contrast_min_curvature }
}
}
}
}
local EXF = {
local EXF = {
@@ -120,56 +182,42 @@ local EXF = {
first_run = true ,
first_run = true ,
install_error = false
install_error = false
}
}
local GUI = {
local TARGET = {
AIS = {
format = { style = ' string ' , default_value = ' tif ' , widget_type = " combobox " , widget = GUI.Target . format } ,
radial_distortion = { } ,
depth = { style = ' string ' , default_value = ' 16 ' , widget_type = " combobox " , widget = GUI.Target . depth } ,
optimize_field = { } ,
compression_level_tif = { style = ' string ' , default_value = ' lzw ' , widget_type = " combobox " , widget = GUI.Target . compression_level_tif } ,
optimize_image_center = { } ,
compression_level_jpg = { style = ' integer ' , default_value = 85 , widget_type = " slider " , widget = GUI.Target . compression_level_jpg } ,
auto_crop = { } ,
output_directory = { style = ' string ' , default_value = ' ' , widget_type = " file_chooser_button " , widget = GUI.Target . output_directory } ,
distortion = { } ,
source_location = { style = ' bool ' , default_value = true , widget_type = " check_button " , widget = GUI.Target . source_location } ,
grid_size = { } ,
on_conflict = { style = ' string ' , default_value = ' create unique filename ' , widget_type = " combobox " , widget = GUI.Target . on_conflict } ,
control_points = { } ,
auto_import = { style = ' bool ' , default_value = true , widget_type = " check_button " , widget = GUI.Target . auto_import } ,
control_points_remove = { } ,
apply_style = { style = ' string ' , default_value = " none " , widget_type = " combobox " , widget = GUI.Target . apply_style } ,
correlation = { } } ,
copy_tags = { style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.Target . copy_tags } ,
ENF = {
add_tags = { style = ' string ' , default_value = ' ' , widget_type = " entry " , widget = GUI.Target . add_tags }
exposure_weight = { } ,
}
saturation_weight = { } ,
contrast_weight = { } ,
local PRESETS = {
exposure_optimum = { } ,
current_preset = { style = ' string ' , default_value = ' dri_1 ' , widget_type = " combobox " , widget = GUI.Presets . current_preset } ,
exposure_width = { } ,
load = { style = nil , default_value = nil , widget_type = " button " , widget = GUI.Presets . load } ,
hard_masks = { } ,
save = { style = nil , default_value = nil , widget_type = " button " , widget = GUI.Presets . save } ,
save_masks = { } ,
variants = { style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.Presets . variants } ,
contrast_window_size = { } ,
variants_type = { style = ' string ' , default_value = ' dri ' , widget_type = " combobox " , widget = GUI.Presets . variants_type } ,
contrast_edge_scale = { } ,
values = {
contrast_min_curvature = { } } ,
dri_1 = " 1.0;0.2;0.0;0.5;0.2;F;F;5;0.0;0.0% " ,
Target = {
dri_2 = " 1.0;0.2;0.0;0.3;0.2;F;F;5;0.0;0.0% " ,
format = { } ,
dri_3 = " 1.0;0.2;0.0;0.7;0.2;F;F;5;0.0;0.0% " ,
depth = { } ,
dff_1 = " 0.0;0.0;1.0;0.5;0.2;T;F;7;0.3;0.5% " ,
compression_level_tif = { } ,
dff_2 = " 0.0;0.0;1.0;0.5;0.2;T;F;5;0.1;0.3% " ,
compression_level_jpg = { } ,
dff_3 = " 0.0;0.0;1.0;0.5;0.2;T;F;9;0.5;0.8% "
output_compress = { } ,
} ,
output_directory = { } ,
key = { " exposure_weight " , " saturation_weight " , " contrast_weight " , " exposure_optimum " , " exposure_width " , " hard_masks " , " save_masks " , " contrast_window_size " ,
source_location = { } ,
" contrast_edge_scale " , " contrast_min_curvature " }
on_conflict = { } ,
}
auto_import = { } ,
apply_style = { } ,
local MODULE = {
copy_tags = { } ,
align = { style = ' bool ' , default_value = false , widget_type = " check_button " , widget = GUI.align } ,
add_tags = { } } ,
options_contain = { style = ' integer ' , default_value = 2 , widget_type = " stack " , widget = GUI.options_contain } ,
Presets = {
show_options = { style = ' string ' , default_value = ' enfuse/enblend ' , widget_type = " combobox " , widget = GUI.show_options }
current_preset = { } ;
load = { } ;
save = { } ;
variants = { } ;
variants_type = { } } ,
exes = {
align_image_stack = { } ,
enfuse = { } ,
exiftool = { } ,
update = { }
} ,
align = { } ,
options_contain = { } ,
show_options = { }
}
}
local styles = dt.styles
local styles = dt.styles
@@ -179,6 +227,20 @@ for _,i in pairs(dt.styles) do
end
end
-- FUNCTION --
-- FUNCTION --
local function update_combobox_selected ( cmbx , value )
dt.print_log ( " passed in value is " .. value )
for i , val in ipairs ( cmbx ) do
if val == value then
dt.print_log ( " matched " .. val .. " setting selected to " .. i )
cmbx.selected = i
break
end
if i == # cmbx then
break
end
end
end
local function InRange ( test , low , high ) -- tests if test value is within range of low and high (inclusive)
local function InRange ( test , low , high ) -- tests if test value is within range of low and high (inclusive)
if test >= low and test <= high then
if test >= low and test <= high then
return true
return true
@@ -218,29 +280,28 @@ local function BuildExecuteCmd(prog_table) --creates a program command using ele
end
end
local function PreCall ( prog_tbls ) --looks to see if this is the first call, if so checks to see if program is installed properly
local function PreCall ( prog_tbls ) --looks to see if this is the first call, if so checks to see if program is installed properly
for _ , prog in pairs ( prog_tbls ) do
dt.print_log ( " In PreCall " )
if prog.first_run then
dt.preferences . write ( mod , " bin_exists " , " bool " , true )
prog.b in = df.check_if_bin_exists ( prog.name )
for _ , prog in pairs ( prog_tbls ) do
if not prog.bin then
prog.bin = df.check_if_bin_exists ( prog.name )
prog.install_error = true
if not prog.b in then
dt.preferences . write ( mod , ' bin_exists ' , ' bool ' , false )
prog.install_error = true
else
dt.preferences . write ( mod , " bin_exists " , " bool " , false )
prog.bin = CleanSpaces ( prog.bin )
dt.print_error ( " Could not find executable for " .. prog.name )
end
prog.first_run = false
end
end
if not dt.preferences . read ( mod , ' bin_exists ' , ' bool ' ) then
GUI.options_contain . active = 4
GUI.show_options . sensitive = false
dt.print ( _ ( ' please update your binary locations ' ) )
end
end
end
if not dt.preferences . read ( mod , ' bin_exists ' , ' bool ' ) then
GUI.options_contain . active = 4
GUI.show_options . sensitive = false
dt.print ( _ ( ' please update your binary locations ' ) )
end
end
end
local function ExeUpdate ( prog_tbl ) --updates executable paths and verifies them
local function ExeUpdate ( prog_tbl ) --updates executable paths and verifies them
dt.preferences . write ( mod , ' bin_exists ' , ' bool ' , true )
dt.preferences . write ( mod , ' bin_exists ' , ' bool ' , true )
for _ , prog in pairs ( prog_tbl ) do
for _ , prog in pairs ( prog_tbl ) do
dt.preferences . write ( ' executable_paths ' , prog.name , ' string ' , GUI.exes [ prog.name ] . value )
prog.bin = dt.preferences . read ( ' executable_paths ' , prog.name , ' string ' )
--[[dt.preferences.write('executable_paths', prog.name, 'string', GUI.exes[prog.name].value)
prog.bin = df.check_if_bin_exists(prog.name)
prog.bin = df.check_if_bin_exists(prog.name)
if not prog.bin then
if not prog.bin then
prog.install_error = true
prog.install_error = true
@@ -248,7 +309,7 @@ local function ExeUpdate(prog_tbl) --updates executable paths and verifies them
dt.print(_('issue with ')..prog.name.._(' executable'))
dt.print(_('issue with ')..prog.name.._(' executable'))
else
else
prog.bin = CleanSpaces(prog.bin)
prog.bin = CleanSpaces(prog.bin)
end
end]]
prog.first_run = false
prog.first_run = false
end
end
if dt.preferences . read ( mod , ' bin_exists ' , ' bool ' ) then
if dt.preferences . read ( mod , ' bin_exists ' , ' bool ' ) then
@@ -322,8 +383,10 @@ local function UpdateENFargs(image_table, prefix) --updates the Enfuse arguments
images_to_blend = images_to_blend .. df.sanitize_filename ( temp_image ) .. ' '
images_to_blend = images_to_blend .. df.sanitize_filename ( temp_image ) .. ' '
end
end
ENF.arg_string = ENF.arg_string .. ' --depth= ' .. GUI.Target . depth.value .. ' '
ENF.arg_string = ENF.arg_string .. ' --depth= ' .. GUI.Target . depth.value .. ' '
if GUI.Target . format.value == ' tif ' then ENF.arg_string = ENF.arg_string .. ' --compression= ' .. GUI.Target . compression_level_tif.value .. ' '
if GUI.Target . format.value == ' tif ' then
elseif GUI.Target . format.value == ' jpg ' then ENF.arg_string = ENF.arg_string .. ' --compression= ' .. GUI.Target . compression_level_jpg .value .. ' '
ENF.arg_string = ENF.arg_string .. ' --compression= ' .. GUI.Target . compression_level_tif .value .. ' '
elseif
GUI.Target . format.value == ' jpg ' then ENF.arg_string = ENF.arg_string .. ' --compression= ' .. GUI.Target . compression_level_jpg.value .. ' '
end
end
if not GUI.Target . source_location.value then out_path = GUI.Target . output_directory.value end
if not GUI.Target . source_location.value then out_path = GUI.Target . output_directory.value end
out_name = smallest_name .. ' - ' .. largest_id
out_name = smallest_name .. ' - ' .. largest_id
@@ -462,8 +525,8 @@ local function main(storage, image_table, extra_data)
local resp = dsys.external_command ( run_cmd )
local resp = dsys.external_command ( run_cmd )
if resp ~= 0 then
if resp ~= 0 then
remove_temp_files ( images_to_remove )
remove_temp_files ( images_to_remove )
dt.print_error ( ENF.name .. _ ( ' failed ' ) )
dt.print_error ( ENF.name .. _ ( ' failed ' ) )
dt.print ( ENF.name .. _ ( ' failed ' ) )
dt.print ( ENF.name .. _ ( ' failed ' ) )
return
return
end
end
@@ -499,6 +562,18 @@ local function main(storage, image_table, extra_data)
dt.print ( ' image fusion process complete ' )
dt.print ( ' image fusion process complete ' )
end
end
if not initialized then
for _ , tbl in ipairs ( { AIS.args , ENF.args , TARGET , MODULE , PRESETS } ) do
for k , v in pairs ( tbl ) do
if v.style then
dt.preferences . write ( mod , " active_ " .. k , v.style , v.default_value )
end
end
end
dt.preferences . write ( mod , " active_align " , " bool " , false )
end
dt.print_log ( " past functions " )
--GUI--
--GUI--
stack_compression = dt.new_widget ( ' stack ' ) { }
stack_compression = dt.new_widget ( ' stack ' ) { }
local label_AIS_options = dt.new_widget ( ' section_label ' ) {
local label_AIS_options = dt.new_widget ( ' section_label ' ) {
@@ -558,12 +633,12 @@ GUI.AIS.gpu = dt.new_widget('check_button'){
clicked_callback = function ( self ) dt.preferences . write ( mod , ' active_gpu ' , ' bool ' , self.value ) end ,
clicked_callback = function ( self ) dt.preferences . write ( mod , ' active_gpu ' , ' bool ' , self.value ) end ,
reset_callback = function ( self ) self.value = true end
reset_callback = function ( self ) self.value = true end
}
}
temp = dt.preferences. read ( mod , ' active_grid_size_ind' , ' integer' )
-- temp = dt.preferences.read(mod, ' active_grid_size_ind', ' integer' )
if not InRange ( temp , 1 , 9 ) then temp = 5 end
--if not InRange(temp, 1, 9) then temp = 5 end
GUI.AIS . grid_size = dt.new_widget ( ' combobox ' ) {
GUI.AIS . grid_size = dt.new_widget ( ' combobox ' ) {
label = _ ( ' image grid size ' ) ,
label = _ ( ' image grid size ' ) ,
tooltip = _ ( ' break image into a rectangular grid \n and attempt to find num control points in each section. \n default: (5x5) ' ) ,
tooltip = _ ( ' break image into a rectangular grid \n and attempt to find num control points in each section. \n default: (5x5) ' ) ,
selected = temp ,
selected = 1 ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_grid_size ' , ' integer ' , self.value )
dt.preferences . write ( mod , ' active_grid_size ' , ' integer ' , self.value )
@@ -575,12 +650,13 @@ GUI.AIS.grid_size = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_grid_size_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_grid_size_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_control_points_ind ' , ' integer ' )
update_combobox_selected ( GUI.AIS . grid_size , dt.preferences . read ( mod , ' active_grid_size ' , ' string ' ) )
if not InRange ( temp , 1 , 9 ) then temp = 8 end
--temp = dt.preferences.read(mod, 'active_control_points_ind', 'integer')
--if not InRange(temp, 1, 9) then temp = 8 end
GUI.AIS . control_points = dt.new_widget ( ' combobox ' ) {
GUI.AIS . control_points = dt.new_widget ( ' combobox ' ) {
label = _ ( ' control points/grid ' ) ,
label = _ ( ' control points/grid ' ) ,
tooltip = _ ( ' number of control points (per grid, see option -g) \n to create between adjacent images \n default: (8). ' ) ,
tooltip = _ ( ' number of control points (per grid, see option -g) \n to create between adjacent images \n default: (8). ' ) ,
selected = temp ,
selected = 1 ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_control_points ' , ' integer ' , self.value )
dt.preferences . write ( mod , ' active_control_points ' , ' integer ' , self.value )
@@ -592,12 +668,13 @@ GUI.AIS.control_points = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_control_points_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_control_points_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_control_points_remove_ind ' , ' integer ' )
update_combobox_selected ( GUI.AIS . control_points , dt.preferences . read ( mod , ' active_control_points ' , ' string ' ) )
if not InRange ( temp , 1 , 9 ) then temp = 3 end
--temp = dt.preferences.read(mod, 'active_control_points_remove_ind', 'integer')
--if not InRange(temp, 1, 9) then temp = 3 end
GUI.AIS . control_points_remove = dt.new_widget ( ' combobox ' ) {
GUI.AIS . control_points_remove = dt.new_widget ( ' combobox ' ) {
label = _ ( ' remove control points with error ' ) ,
label = _ ( ' remove control points with error ' ) ,
tooltip = _ ( ' remove all control points with an error higher \n than num pixels \n default: (3) ' ) ,
tooltip = _ ( ' remove all control points with an error higher \n than num pixels \n default: (3) ' ) ,
selected = temp ,
selected = 1 ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_control_points_remove ' , ' integer ' , self.value )
dt.preferences . write ( mod , ' active_control_points_remove ' , ' integer ' , self.value )
@@ -609,12 +686,13 @@ GUI.AIS.control_points_remove = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_control_points_remove_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_control_points_remove_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_correlation_ind ' , ' integer ' )
update_combobox_selected ( GUI.AIS . control_points_remove , dt.preferences . read ( mod , ' active_control_points_remove ' , ' string ' ) )
if not InRange ( temp , 1 , 10 ) then temp = 9 end
--temp = dt.preferences.read(mod, 'active_correlation_ind', 'integer')
--if not InRange(temp, 1, 10) then temp = 9 end
GUI.AIS . correlation = dt.new_widget ( ' combobox ' ) {
GUI.AIS . correlation = dt.new_widget ( ' combobox ' ) {
label = _ ( ' correlation threshold for control points ' ) ,
label = _ ( ' correlation threshold for control points ' ) ,
tooltip = _ ( ' correlation threshold for identifying \n control points \n default: (0.9). ' ) ,
tooltip = _ ( ' correlation threshold for identifying \n control points \n default: (0.9). ' ) ,
selected = temp ,
selected = 1 ,
' 0.1 ' , ' 0.2 ' , ' 0.3 ' , ' 0.4 ' , ' 0.5 ' , ' 0.6 ' , ' 0.7 ' , ' 0.8 ' , ' 0.9 ' , ' 1.0 ' ,
' 0.1 ' , ' 0.2 ' , ' 0.3 ' , ' 0.4 ' , ' 0.5 ' , ' 0.6 ' , ' 0.7 ' , ' 0.8 ' , ' 0.9 ' , ' 1.0 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_correlation ' , ' float ' , self.value )
dt.preferences . write ( mod , ' active_correlation ' , ' float ' , self.value )
@@ -626,65 +704,67 @@ GUI.AIS.correlation = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_correlation_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_correlation_ind ' , ' integer ' , self.selected )
end
end
}
}
update_combobox_selected ( GUI.AIS . correlation , dt.preferences . read ( mod , ' active_correlation ' , ' string ' ) )
local label_ENF_options = dt.new_widget ( ' section_label ' ) {
local label_ENF_options = dt.new_widget ( ' section_label ' ) {
label = _ ( ' image fusion options ' )
label = _ ( ' image fusion options ' )
}
}
temp = dt.preferences . read ( mod , ' active_exposure_weight ' , ' float ' )
dt.print_log ( " past GUI.AIS " )
if not InRange ( temp , 0 , 1 ) then temp = 1 end
--temp = dt.preferences.read(mod, 'active_exposure_weight', 'float')
--if not InRange(temp, 0, 1) then temp = 1 end
GUI.ENF . exposure_weight = dt.new_widget ( ' slider ' ) {
GUI.ENF . exposure_weight = dt.new_widget ( ' slider ' ) {
label = _ ( ' exposure weight ' ) ,
label = _ ( ' exposure weight ' ) ,
tooltip = _ ( ' set the relative weight of the well-exposedness criterion \n as defined by the chosen exposure weight function. \n increasing this weight relative to the others will \n make well-exposed pixels contribute more to \n the final output. \n default: (1.0) ' ) ,
tooltip = _ ( ' set the relative weight of the well-exposedness criterion \n as defined by the chosen exposure weight function. \n increasing this weight relative to the others will \n make well-exposed pixels contribute more to \n the final output. \n default: (1.0) ' ) ,
hard_min = 0 ,
hard_min = 0 ,
hard_max = 1 ,
hard_max = 1 ,
value = temp ,
value = dt.preferences . read ( mod , ' active_exposure_weight ' , ' float ' ) ,
reset_callback = function ( self )
reset_callback = function ( self )
self.value = 1
self.value = 1
end
end
}
}
temp = dt.preferences. read ( mod , ' active_saturation_weight' , ' float ' )
-- temp = dt.preferences.read(mod, ' active_saturation_weight', 'float' )
if not InRange ( temp , 0 , 1 ) then temp = .2 end
--if not InRange(temp, 0, 1) then temp = .2 end
GUI.ENF . saturation_weight = dt.new_widget ( ' slider ' ) {
GUI.ENF . saturation_weight = dt.new_widget ( ' slider ' ) {
label = _ ( ' saturation weight ' ) ,
label = _ ( ' saturation weight ' ) ,
tooltip = _ ( ' set the relative weight of high-saturation pixels. \n increasing this weight makes pixels with high \n saturation contribute more to the final output. \n default: (0.2) ' ) ,
tooltip = _ ( ' set the relative weight of high-saturation pixels. \n increasing this weight makes pixels with high \n saturation contribute more to the final output. \n default: (0.2) ' ) ,
hard_min = 0 ,
hard_min = 0 ,
hard_max = 1 ,
hard_max = 1 ,
value = temp ,
value = dt.preferences . read ( mod , ' active_saturation_weight ' , ' float ' ) ,
reset_callback = function ( self )
reset_callback = function ( self )
self.value = 0.2
self.value = 0.2
end
end
}
}
temp = dt.preferences. read ( mod , ' active_contrast_weight ' , ' float ' )
-- temp = dt.preferences.read(mod, 'active_contrast_weight', 'float' )
if not InRange ( temp , 0 , 1 ) then temp = 0 end
--if not InRange(temp, 0, 1) then temp = 0 end
GUI.ENF . contrast_weight = dt.new_widget ( ' slider ' ) {
GUI.ENF . contrast_weight = dt.new_widget ( ' slider ' ) {
label = _ ( ' contrast weight ' ) ,
label = _ ( ' contrast weight ' ) ,
tooltip = _ ( ' sets the relative weight of high local-contrast pixels. \n default: (0.0). ' ) ,
tooltip = _ ( ' sets the relative weight of high local-contrast pixels. \n default: (0.0). ' ) ,
hard_min = 0 ,
hard_min = 0 ,
hard_max = 1 ,
hard_max = 1 ,
value = temp ,
value = dt.preferences . read ( mod , ' active_contrast_weight ' , ' float ' ) ,
reset_callback = function ( self )
reset_callback = function ( self )
self.value = 0
self.value = 0
end
end
}
}
temp = dt.preferences. read ( mod , ' active_exposure_optimum' , ' float ' )
-- temp = dt.preferences.read(mod, ' active_exposure_optimum', 'float' )
if not InRange ( temp , 0 , 1 ) then temp = 0.5 end
--if not InRange(temp, 0, 1) then temp = 0.5 end
GUI.ENF . exposure_optimum = dt.new_widget ( ' slider ' ) {
GUI.ENF . exposure_optimum = dt.new_widget ( ' slider ' ) {
label = _ ( ' exposure optimum ' ) ,
label = _ ( ' exposure optimum ' ) ,
tooltip = _ ( ' determine at what normalized exposure value \n the optimum exposure of the input images \n is. this is, set the position of the maximum \n of the exposure weight curve. use this \n option to fine-tune exposure weighting. \n default: (0.5) ' ) ,
tooltip = _ ( ' determine at what normalized exposure value \n the optimum exposure of the input images \n is. this is, set the position of the maximum \n of the exposure weight curve. use this \n option to fine-tune exposure weighting. \n default: (0.5) ' ) ,
hard_min = 0 ,
hard_min = 0 ,
hard_max = 1 ,
hard_max = 1 ,
value = temp ,
value = dt.preferences . read ( mod , ' active_exposure_optimum ' , ' float ' ) ,
reset_callback = function ( self )
reset_callback = function ( self )
self.value = 0.5
self.value = 0.5
end
end
}
}
temp = dt.preferences. read ( mod , ' active_exposure_width ' , ' float ' )
-- temp = dt.preferences.read(mod, 'active_exposure_width', 'float' )
if not InRange ( temp , 0 , 1 ) then temp = 0.2 end
--if not InRange(temp, 0, 1) then temp = 0.2 end
GUI.ENF . exposure_width = dt.new_widget ( ' slider ' ) {
GUI.ENF . exposure_width = dt.new_widget ( ' slider ' ) {
label = _ ( ' exposure width ' ) ,
label = _ ( ' exposure width ' ) ,
tooltip = _ ( ' set the characteristic width (FWHM) of the exposure \n weight function. low numbers give less weight to \n pixels that are far from the user-defined \n optimum and vice versa. use this option to \n fine-tune exposure weighting. \n default: (0.2) ' ) ,
tooltip = _ ( ' set the characteristic width (FWHM) of the exposure \n weight function. low numbers give less weight to \n pixels that are far from the user-defined \n optimum and vice versa. use this option to \n fine-tune exposure weighting. \n default: (0.2) ' ) ,
hard_min = 0 ,
hard_min = 0 ,
hard_max = 1 ,
hard_max = 1 ,
value = temp ,
value = dt.preferences . read ( mod , ' active_exposure_width ' , ' float ' ) ,
reset_callback = function ( self )
reset_callback = function ( self )
self.value = 0.2
self.value = 0.2
end
end
@@ -703,12 +783,12 @@ GUI.ENF.save_masks = dt.new_widget('check_button'){
clicked_callback = function ( self ) dt.preferences . write ( mod , ' active_save_masks ' , ' bool ' , self.value ) end ,
clicked_callback = function ( self ) dt.preferences . write ( mod , ' active_save_masks ' , ' bool ' , self.value ) end ,
reset_callback = function ( self ) self.value = false end
reset_callback = function ( self ) self.value = false end
}
}
temp = dt.preferences. read ( mod , ' active_contrast_window_size_ind' , ' integer' )
-- temp = dt.preferences.read(mod, ' active_contrast_window_size_ind', ' integer' )
if not InRange ( temp , 1 , 8 ) then temp = 3 end
--if not InRange(temp, 1, 8) then temp = 3 end
GUI.ENF . contrast_window_size = dt.new_widget ( ' combobox ' ) {
GUI.ENF . contrast_window_size = dt.new_widget ( ' combobox ' ) {
label = _ ( ' contrast window size ' ) ,
label = _ ( ' contrast window size ' ) ,
tooltip = _ ( ' set the window size for local contrast analysis. \n the window will be a square of size × size pixels. \n if given an even size, Enfuse will \n automatically use the next odd number. \n for contrast analysis size values larger \n than 5 pixels might result in a \n blurry composite image. values of 3 and \n 5 pixels have given good results on \n focus stacks. \n default: (5) pixels ' ) ,
tooltip = _ ( ' set the window size for local contrast analysis. \n the window will be a square of size × size pixels. \n if given an even size, Enfuse will \n automatically use the next odd number. \n for contrast analysis size values larger \n than 5 pixels might result in a \n blurry composite image. values of 3 and \n 5 pixels have given good results on \n focus stacks. \n default: (5) pixels ' ) ,
selected = temp ,
selected = 1 ,
' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' , ' 10 ' ,
' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' , ' 10 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_contrast_window_size ' , ' integer ' , self.value )
dt.preferences . write ( mod , ' active_contrast_window_size ' , ' integer ' , self.value )
@@ -720,12 +800,13 @@ GUI.ENF.contrast_window_size = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_contrast_window_size_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_contrast_window_size_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_contrast_edge_scale_ind ' , ' integer ' )
update_combobox_selected ( GUI.ENF . contrast_window_size , dt.preferences . read ( mod , ' active_contrast_window_size ' , ' string ' ) )
if not InRange ( temp , 1 , 6 ) then temp = 1 end
--temp = dt.preferences.read(mod, 'active_contrast_edge_scale_ind', 'integer')
--if not InRange(temp, 1, 6) then temp = 1 end
GUI.ENF . contrast_edge_scale = dt.new_widget ( ' combobox ' ) {
GUI.ENF . contrast_edge_scale = dt.new_widget ( ' combobox ' ) {
label = _ ( ' contrast edge scale ' ) ,
label = _ ( ' contrast edge scale ' ) ,
tooltip = _ ( ' a non-zero value for EDGE-SCALE switches on the \n Laplacian-of-Gaussian (LoG) edge detection algorithm. \n edage-scale is the radius of the Gaussian used \n in the search for edges. a positive LCE-SCALE \n turns on local contrast enhancement (LCE) \n before the LoG edge detection. \n Default: (0.0) pixels. ' ) ,
tooltip = _ ( ' a non-zero value for EDGE-SCALE switches on the \n Laplacian-of-Gaussian (LoG) edge detection algorithm. \n edage-scale is the radius of the Gaussian used \n in the search for edges. a positive LCE-SCALE \n turns on local contrast enhancement (LCE) \n before the LoG edge detection. \n Default: (0.0) pixels. ' ) ,
selected = temp ,
selected = 1 ,
' 0.0 ' , ' 0.1 ' , ' 0.2 ' , ' 0.3 ' , ' 0.4 ' , ' 0.5 ' ,
' 0.0 ' , ' 0.1 ' , ' 0.2 ' , ' 0.3 ' , ' 0.4 ' , ' 0.5 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_contrast_edge_scale ' , ' float ' , self.value )
dt.preferences . write ( mod , ' active_contrast_edge_scale ' , ' float ' , self.value )
@@ -737,12 +818,13 @@ GUI.ENF.contrast_edge_scale = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_contrast_edge_scale_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_contrast_edge_scale_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_contrast_min_curvature_ind ' , ' integer ' )
update_combobox_selected ( GUI.ENF . contrast_edge_scale , dt.preferences . read ( mod , ' active_contrast_edge_scale ' , ' string ' ) )
if not InRange ( temp , 1 , 11 ) then temp = 1 end
--temp = dt.preferences.read(mod, 'active_contrast_min_curvature_ind', 'integer')
--if not InRange(temp, 1, 11) then temp = 1 end
GUI.ENF . contrast_min_curvature = dt.new_widget ( ' combobox ' ) {
GUI.ENF . contrast_min_curvature = dt.new_widget ( ' combobox ' ) {
label = _ ( ' contrast min curvature [%] ' ) ,
label = _ ( ' contrast min curvature [%] ' ) ,
tooltip = _ ( ' define the minimum curvature for the LoG edge detection. Append a ‘ %’ to specify the minimum curvature relative to maximum pixel value in the source image. Default: (0.0%) ' ) ,
tooltip = _ ( ' define the minimum curvature for the LoG edge detection. Append a ‘ %’ to specify the minimum curvature relative to maximum pixel value in the source image. Default: (0.0%) ' ) ,
selected = temp ,
selected = 1 ,
' 0.0% ' , ' 0.1% ' , ' 0.2% ' , ' 0.3% ' , ' 0.4% ' , ' 0.5% ' , ' 0.6% ' , ' 0.7% ' , ' 0.8% ' , ' 0.9% ' , ' 1.0% ' ,
' 0.0% ' , ' 0.1% ' , ' 0.2% ' , ' 0.3% ' , ' 0.4% ' , ' 0.5% ' , ' 0.6% ' , ' 0.7% ' , ' 0.8% ' , ' 0.9% ' , ' 1.0% ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_contrast_min_curvature ' , ' string ' , self.value )
dt.preferences . write ( mod , ' active_contrast_min_curvature ' , ' string ' , self.value )
@@ -754,15 +836,17 @@ GUI.ENF.contrast_min_curvature = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_contrast_min_curvature_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_contrast_min_curvature_ind ' , ' integer ' , self.selected )
end
end
}
}
update_combobox_selected ( GUI.ENF . contrast_min_curvature , dt.preferences . read ( mod , ' active_contrast_min_curvature ' , ' string ' ) )
local label_target_options = dt.new_widget ( ' section_label ' ) {
local label_target_options = dt.new_widget ( ' section_label ' ) {
label = _ ( ' target file ' )
label = _ ( ' target file ' )
}
}
temp = dt.preferences . read ( mod , ' active_compression_level_tif_ind ' , ' integer ' )
dt.print_log ( " past GUI.ENF " )
if not InRange ( temp , 1 , 4 ) then temp = 1 end
--temp = dt.preferences.read(mod, 'active_compression_level_tif_ind', 'integer')
--if not InRange(temp, 1, 4) then temp = 1 end
GUI.Target . compression_level_tif = dt.new_widget ( ' combobox ' ) {
GUI.Target . compression_level_tif = dt.new_widget ( ' combobox ' ) {
label = _ ( ' tiff compression ' ) ,
label = _ ( ' tiff compression ' ) ,
tooltip = _ ( ' compression method for tiff files ' ) ,
tooltip = _ ( ' compression method for tiff files ' ) ,
selected = temp ,
selected = 1 ,
' none ' , ' deflate ' , ' lzw ' , ' packbits ' ,
' none ' , ' deflate ' , ' lzw ' , ' packbits ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_compression_level_tif ' , ' string ' , self.value )
dt.preferences . write ( mod , ' active_compression_level_tif ' , ' string ' , self.value )
@@ -774,8 +858,9 @@ GUI.Target.compression_level_tif = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_compression_level_tif_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_compression_level_tif_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_compression_level_jpg ' , ' integer ' )
update_combobox_selected ( GUI.Target . compression_level_tif , dt.preferences . read ( mod , ' active_compression_level_tif ' , ' string ' ) )
if not InRange ( temp , 0 , 100 ) then temp = 0 end
--temp = dt.preferences.read(mod, 'active_compression_level_jpg', 'integer')
--if not InRange(temp, 0, 100) then temp = 0 end
GUI.Target . compression_level_jpg = dt.new_widget ( ' slider ' ) {
GUI.Target . compression_level_jpg = dt.new_widget ( ' slider ' ) {
label = _ ( ' jpeg compression ' ) ,
label = _ ( ' jpeg compression ' ) ,
tooltip = _ ( ' jpeg compression level ' ) ,
tooltip = _ ( ' jpeg compression level ' ) ,
@@ -785,7 +870,7 @@ GUI.Target.compression_level_jpg = dt.new_widget('slider'){
hard_max = 100 ,
hard_max = 100 ,
step = 5 ,
step = 5 ,
digits = 0 ,
digits = 0 ,
value = temp ,
value = dt.preferences . read ( mod , ' active_compression_level_jpg ' , ' integer ' ) ,
reset_callback = function ( self )
reset_callback = function ( self )
self.value = 0
self.value = 0
end
end
@@ -797,12 +882,12 @@ stack_compression = dt.new_widget('stack'){
blank ,
blank ,
active = 1
active = 1
}
}
temp = dt.preferences. read ( mod , ' active_format_ind' , ' integer' )
-- temp = dt.preferences.read(mod, ' active_format_ind', ' integer' )
if not InRange ( temp , 1 , 6 ) then temp = 1 end
--if not InRange(temp, 1, 6) then temp = 1 end
GUI.Target . format = dt.new_widget ( ' combobox ' ) {
GUI.Target . format = dt.new_widget ( ' combobox ' ) {
label = _ ( ' file format ' ) ,
label = _ ( ' file format ' ) ,
tooltip = _ ( ' file format of the enfused final image ' ) ,
tooltip = _ ( ' file format of the enfused final image ' ) ,
selected = temp ,
selected = 1 ,
' tif ' , ' jpg ' , ' png ' , ' pnm ' , ' pbm ' , ' ppm ' ,
' tif ' , ' jpg ' , ' png ' , ' pnm ' , ' pbm ' , ' ppm ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_format ' , ' string ' , self.value )
dt.preferences . write ( mod , ' active_format ' , ' string ' , self.value )
@@ -818,12 +903,13 @@ GUI.Target.format = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_format_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_format_ind ' , ' integer ' , self.selected )
end
end
}
}
temp = dt.preferences . read ( mod , ' active_depth_ind ' , ' integer ' )
update_combobox_selected ( GUI.Target . format , dt.preferences . read ( mod , ' active_format ' , ' string ' ) )
if not InRange ( temp , 1 , 5 ) then temp = 3 end
--temp = dt.preferences.read(mod, 'active_depth_ind', 'integer')
--if not InRange(temp, 1, 5) then temp = 3 end
GUI.Target . depth = dt.new_widget ( ' combobox ' ) {
GUI.Target . depth = dt.new_widget ( ' combobox ' ) {
label = _ ( ' bit depth ' ) ,
label = _ ( ' bit depth ' ) ,
tooltip = _ ( ' bit depth of the enfused file ' ) ,
tooltip = _ ( ' bit depth of the enfused file ' ) ,
selected = temp ,
selected = 1 ,
' 8 ' , ' 16 ' , ' 32 ' , ' r32 ' , ' r64 ' ,
' 8 ' , ' 16 ' , ' 32 ' , ' r32 ' , ' r64 ' ,
changed_callback = function ( self )
changed_callback = function ( self )
dt.preferences . write ( mod , ' active_depth ' , ' string ' , self.value )
dt.preferences . write ( mod , ' active_depth ' , ' string ' , self.value )
@@ -835,12 +921,13 @@ GUI.Target.depth = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_depth_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_depth_ind ' , ' integer ' , self.selected )
end
end
}
}
update_combobox_selected ( GUI.Target . depth , dt.preferences . read ( mod , ' active_depth ' , ' string ' ) )
local label_directory = dt.new_widget ( ' label ' ) {
local label_directory = dt.new_widget ( ' label ' ) {
label = _ ( ' directory ' ) ,
label = _ ( ' directory ' ) ,
ellipsize = ' start ' ,
ellipsize = ' start ' ,
halign = ' start '
halign = ' start '
}
}
temp = dt.preferences . read ( mod , ' active_output_directory ' , ' string ' )
local temp = dt.preferences . read ( mod , ' active_output_directory ' , ' string ' )
if temp == ' ' or temp == nil then temp = dt.collection [ 1 ] . path end
if temp == ' ' or temp == nil then temp = dt.collection [ 1 ] . path end
GUI.Target . output_directory = dt.new_widget ( ' file_chooser_button ' ) {
GUI.Target . output_directory = dt.new_widget ( ' file_chooser_button ' ) {
title = ' Select export path ' ,
title = ' Select export path ' ,
@@ -856,8 +943,8 @@ GUI.Target.source_location = dt.new_widget('check_button'){
clicked_callback = function ( self ) dt.preferences . write ( mod , ' active_source_location ' , ' bool ' , self.value ) end ,
clicked_callback = function ( self ) dt.preferences . write ( mod , ' active_source_location ' , ' bool ' , self.value ) end ,
reset_callback = function ( self ) self.value = true end
reset_callback = function ( self ) self.value = true end
}
}
temp = dt.preferences. read ( mod , ' active_on_conflict_ind' , ' integer' )
-- temp = dt.preferences.read(mod, ' active_on_conflict_ind', ' integer' )
if not InRange ( temp , 1 , 2 ) then temp = 1 end
--if not InRange(temp, 1, 2) then temp = 1 end
GUI.Target . on_conflict = dt.new_widget ( ' combobox ' ) {
GUI.Target . on_conflict = dt.new_widget ( ' combobox ' ) {
label = _ ( ' on conflict ' ) ,
label = _ ( ' on conflict ' ) ,
selected = 1 ,
selected = 1 ,
@@ -872,6 +959,7 @@ GUI.Target.on_conflict = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_on_conflict_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_on_conflict_ind ' , ' integer ' , self.selected )
end
end
}
}
update_combobox_selected ( GUI.Target . on_conflict , dt.preferences . read ( mod , ' active_on_conflict ' , ' string ' ) )
GUI.Target . auto_import = dt.new_widget ( ' check_button ' ) {
GUI.Target . auto_import = dt.new_widget ( ' check_button ' ) {
label = _ ( ' auto import ' ) ,
label = _ ( ' auto import ' ) ,
value = dt.preferences . read ( mod , ' active_auto_import ' , ' bool ' ) ,
value = dt.preferences . read ( mod , ' active_auto_import ' , ' bool ' ) ,
@@ -884,7 +972,7 @@ GUI.Target.auto_import = dt.new_widget('check_button'){
end ,
end ,
reset_callback = function ( self ) self.value = true end
reset_callback = function ( self ) self.value = true end
}
}
temp = dt.preferences. read ( mod , ' active_apply_style_ind' , ' integer' )
-- temp = dt.preferences.read(mod, ' active_apply_style_ind', ' integer' )
GUI.Target . apply_style = dt.new_widget ( ' combobox ' ) {
GUI.Target . apply_style = dt.new_widget ( ' combobox ' ) {
label = _ ( ' Apply Style on Import ' ) ,
label = _ ( ' Apply Style on Import ' ) ,
tooltip = _ ( ' Apply selected style on auto-import to newly created blended image ' ) ,
tooltip = _ ( ' Apply selected style on auto-import to newly created blended image ' ) ,
@@ -903,8 +991,7 @@ GUI.Target.apply_style = dt.new_widget('combobox'){
for k = 1 , ( styles_count - 1 ) do
for k = 1 , ( styles_count - 1 ) do
GUI.Target . apply_style [ k + 1 ] = styles [ k ] . name
GUI.Target . apply_style [ k + 1 ] = styles [ k ] . name
end
end
if not InRan ge( temp , 1 , styles_count ) then temp = 1 end
update_combobox_selected ( GUI.Tar get . apply_style , dt.preferences . read ( mod , ' active_apply_style ' , ' string ' ) )
GUI.Target . apply_style.selected = temp
GUI.Target . copy_tags = dt.new_widget ( ' check_button ' ) {
GUI.Target . copy_tags = dt.new_widget ( ' check_button ' ) {
label = _ ( ' copy tags ' ) ,
label = _ ( ' copy tags ' ) ,
value = dt.preferences . read ( mod , ' active_copy_tags ' , ' bool ' ) ,
value = dt.preferences . read ( mod , ' active_copy_tags ' , ' bool ' ) ,
@@ -920,8 +1007,9 @@ GUI.Target.add_tags = dt.new_widget('entry'){
placeholder = ' Enter tags, seperated by commas ' ,
placeholder = ' Enter tags, seperated by commas ' ,
editable = true
editable = true
}
}
temp = dt.preferences . read ( mod , ' active_current_preset_ind ' , ' integer ' )
dt.print_log ( " past GUI.Target " )
if not InRange ( temp , 1 , 6 ) then temp = 1 end
--temp = dt.preferences.read(mod, 'active_current_preset_ind', 'integer')
--if not InRange(temp, 1, 6) then temp = 1 end
GUI.Presets . current_preset = dt.new_widget ( ' combobox ' ) {
GUI.Presets . current_preset = dt.new_widget ( ' combobox ' ) {
label = _ ( ' active preset ' ) ,
label = _ ( ' active preset ' ) ,
tooltip = _ ( ' preset to be loaded from or saved to ' ) ,
tooltip = _ ( ' preset to be loaded from or saved to ' ) ,
@@ -937,6 +1025,7 @@ GUI.Presets.current_preset = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_current_preset_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_current_preset_ind ' , ' integer ' , self.selected )
end
end
}
}
update_combobox_selected ( GUI.Presets . current_preset , dt.preferences . read ( mod , ' active_current_preset ' , ' string ' ) )
GUI.Presets . load = dt.new_widget ( ' button ' ) {
GUI.Presets . load = dt.new_widget ( ' button ' ) {
label = _ ( ' laod fusion preset ' ) ,
label = _ ( ' laod fusion preset ' ) ,
tooltip = _ ( ' load current fusion parameters from selected preset ' ) ,
tooltip = _ ( ' load current fusion parameters from selected preset ' ) ,
@@ -964,8 +1053,8 @@ GUI.Presets.variants = dt.new_widget('check_button'){
end ,
end ,
reset_callback = function ( self ) self.value = false end
reset_callback = function ( self ) self.value = false end
}
}
temp = dt.preferences. read ( mod , ' active_variants_type_ind' , ' integer' )
-- temp = dt.preferences.read(mod, ' active_variants_type_ind', ' integer' )
if not InRange ( temp , 1 , 2 ) then temp = 1 end
--if not InRange(temp, 1, 2) then temp = 1 end
GUI.Presets . variants_type = dt.new_widget ( ' combobox ' ) {
GUI.Presets . variants_type = dt.new_widget ( ' combobox ' ) {
label = _ ( ' create variants type ' ) ,
label = _ ( ' create variants type ' ) ,
tooltip = _ ( ' preset type to be used when creating image variants ' ) ,
tooltip = _ ( ' preset type to be used when creating image variants ' ) ,
@@ -981,8 +1070,9 @@ GUI.Presets.variants_type = dt.new_widget('combobox'){
dt.preferences . write ( mod , ' active_variants_type_ind ' , ' integer ' , self.selected )
dt.preferences . write ( mod , ' active_variants_type_ind ' , ' integer ' , self.selected )
end
end
}
}
update_combobox_selected ( GUI.Presets . variants_type , dt.preferences . read ( mod , ' active_variants_type ' , ' string ' ) )
GUI.Presets . variants_type.sensitive = GUI.Presets . variants.value
GUI.Presets . variants_type.sensitive = GUI.Presets . variants.value
temp = df.get_executable_path_preference( AIS.name)
--[[temp = df.get_executable_path_preference( AIS.name)
GUI.exes.align_image_stack = dt.new_widget('file_chooser_button'){
GUI.exes.align_image_stack = dt.new_widget('file_chooser_button'){
title = 'AIS binary path',
title = 'AIS binary path',
value = temp,
value = temp,
@@ -1005,12 +1095,13 @@ GUI.exes.exiftool = dt.new_widget('file_chooser_button'){
tooltip = temp,
tooltip = temp,
is_directory = false,
is_directory = false,
changed_callback = function(self) self.tooltip = self.value end
changed_callback = function(self) self.tooltip = self.value end
}
} ]]
GUI.exes . update = dt.new_widget ( ' button ' ) {
GUI.exes . update = dt.new_widget ( ' button ' ) {
label = _ ( ' update ' ) ,
label = _ ( ' update ' ) ,
tooltip = _ ( ' update the binary paths with current values ' ) ,
tooltip = _ ( ' update the binary paths with current values ' ) ,
clicked_callback = function ( ) ExeUpdate ( { AIS , ENF , EXF } ) end
clicked_callback = function ( ) ExeUpdate ( { AIS , ENF , EXF } ) end
}
}
dt.print_log ( " past GUI.Presets " )
temp = GUI.Target . format.value
temp = GUI.Target . format.value
if temp == ' tif ' then temp = 1
if temp == ' tif ' then temp = 1
elseif temp == ' jpg ' then temp = 2
elseif temp == ' jpg ' then temp = 2
@@ -1075,9 +1166,10 @@ local box_Target = dt.new_widget('box'){
}
}
local box_exes = dt.new_widget ( ' box ' ) {
local box_exes = dt.new_widget ( ' box ' ) {
orientation = ' vertical ' ,
orientation = ' vertical ' ,
GUI.exes. align_image_stack,
--[[ GUI.exes. align_image_stack,
GUI.exes. enfuse,
GUI.exes. enfuse,
GUI.exes. exiftool,
GUI.exes. exiftool,]]
df.executable_path_widget ( { " align_image_stack " , " enfuse " , " exiftool " } ) ,
GUI.exes . update
GUI.exes . update
}
}
GUI.options_contain = dt.new_widget ( ' stack ' ) {
GUI.options_contain = dt.new_widget ( ' stack ' ) {
@@ -1125,3 +1217,5 @@ else
GUI.options_contain . active = 4
GUI.options_contain . active = 4
GUI.show_options . sensitive = false
GUI.show_options . sensitive = false
end
end
dt.preferences . write ( mod , " initialized " , " bool " , true )