meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7010__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meerk40t/__init__.py +1 -1
- meerk40t/balormk/balor_params.py +167 -167
- meerk40t/balormk/clone_loader.py +457 -457
- meerk40t/balormk/controller.py +1566 -1512
- meerk40t/balormk/cylindermod.py +64 -0
- meerk40t/balormk/device.py +966 -1959
- meerk40t/balormk/driver.py +778 -591
- meerk40t/balormk/galvo_commands.py +1195 -0
- meerk40t/balormk/gui/balorconfig.py +237 -111
- meerk40t/balormk/gui/balorcontroller.py +191 -184
- meerk40t/balormk/gui/baloroperationproperties.py +116 -115
- meerk40t/balormk/gui/corscene.py +845 -0
- meerk40t/balormk/gui/gui.py +179 -147
- meerk40t/balormk/livelightjob.py +466 -382
- meerk40t/balormk/mock_connection.py +131 -109
- meerk40t/balormk/plugin.py +133 -135
- meerk40t/balormk/usb_connection.py +306 -301
- meerk40t/camera/__init__.py +1 -1
- meerk40t/camera/camera.py +514 -397
- meerk40t/camera/gui/camerapanel.py +1241 -1095
- meerk40t/camera/gui/gui.py +58 -58
- meerk40t/camera/plugin.py +441 -399
- meerk40t/ch341/__init__.py +27 -27
- meerk40t/ch341/ch341device.py +628 -628
- meerk40t/ch341/libusb.py +595 -589
- meerk40t/ch341/mock.py +171 -171
- meerk40t/ch341/windriver.py +157 -157
- meerk40t/constants.py +13 -0
- meerk40t/core/__init__.py +1 -1
- meerk40t/core/bindalias.py +550 -539
- meerk40t/core/core.py +47 -47
- meerk40t/core/cutcode/cubiccut.py +73 -73
- meerk40t/core/cutcode/cutcode.py +315 -312
- meerk40t/core/cutcode/cutgroup.py +141 -137
- meerk40t/core/cutcode/cutobject.py +192 -185
- meerk40t/core/cutcode/dwellcut.py +37 -37
- meerk40t/core/cutcode/gotocut.py +29 -29
- meerk40t/core/cutcode/homecut.py +29 -29
- meerk40t/core/cutcode/inputcut.py +34 -34
- meerk40t/core/cutcode/linecut.py +33 -33
- meerk40t/core/cutcode/outputcut.py +34 -34
- meerk40t/core/cutcode/plotcut.py +335 -335
- meerk40t/core/cutcode/quadcut.py +61 -61
- meerk40t/core/cutcode/rastercut.py +168 -148
- meerk40t/core/cutcode/waitcut.py +34 -34
- meerk40t/core/cutplan.py +1843 -1316
- meerk40t/core/drivers.py +330 -329
- meerk40t/core/elements/align.py +801 -669
- meerk40t/core/elements/branches.py +1844 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4561 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4329 -3617
- meerk40t/core/elements/files.py +117 -64
- meerk40t/core/elements/geometry.py +473 -224
- meerk40t/core/elements/grid.py +467 -316
- meerk40t/core/elements/materials.py +158 -94
- meerk40t/core/elements/notes.py +50 -38
- meerk40t/core/elements/offset_clpr.py +933 -912
- meerk40t/core/elements/offset_mk.py +963 -955
- meerk40t/core/elements/penbox.py +339 -267
- meerk40t/core/elements/placements.py +300 -83
- meerk40t/core/elements/render.py +785 -687
- meerk40t/core/elements/shapes.py +2618 -2092
- meerk40t/core/elements/trace.py +651 -563
- meerk40t/core/elements/tree_commands.py +415 -409
- meerk40t/core/elements/undo_redo.py +116 -58
- meerk40t/core/elements/wordlist.py +319 -200
- meerk40t/core/exceptions.py +9 -9
- meerk40t/core/laserjob.py +220 -220
- meerk40t/core/logging.py +63 -63
- meerk40t/core/node/blobnode.py +83 -86
- meerk40t/core/node/bootstrap.py +105 -103
- meerk40t/core/node/branch_elems.py +40 -31
- meerk40t/core/node/branch_ops.py +45 -38
- meerk40t/core/node/branch_regmark.py +48 -41
- meerk40t/core/node/cutnode.py +29 -32
- meerk40t/core/node/effect_hatch.py +375 -257
- meerk40t/core/node/effect_warp.py +398 -0
- meerk40t/core/node/effect_wobble.py +441 -309
- meerk40t/core/node/elem_ellipse.py +404 -309
- meerk40t/core/node/elem_image.py +1082 -801
- meerk40t/core/node/elem_line.py +358 -292
- meerk40t/core/node/elem_path.py +259 -201
- meerk40t/core/node/elem_point.py +129 -102
- meerk40t/core/node/elem_polyline.py +310 -246
- meerk40t/core/node/elem_rect.py +376 -286
- meerk40t/core/node/elem_text.py +445 -418
- meerk40t/core/node/filenode.py +59 -40
- meerk40t/core/node/groupnode.py +138 -74
- meerk40t/core/node/image_processed.py +777 -766
- meerk40t/core/node/image_raster.py +156 -113
- meerk40t/core/node/layernode.py +31 -31
- meerk40t/core/node/mixins.py +135 -107
- meerk40t/core/node/node.py +1427 -1304
- meerk40t/core/node/nutils.py +117 -114
- meerk40t/core/node/op_cut.py +462 -335
- meerk40t/core/node/op_dots.py +296 -251
- meerk40t/core/node/op_engrave.py +414 -311
- meerk40t/core/node/op_image.py +755 -369
- meerk40t/core/node/op_raster.py +787 -522
- meerk40t/core/node/place_current.py +37 -40
- meerk40t/core/node/place_point.py +329 -126
- meerk40t/core/node/refnode.py +58 -47
- meerk40t/core/node/rootnode.py +225 -219
- meerk40t/core/node/util_console.py +48 -48
- meerk40t/core/node/util_goto.py +84 -65
- meerk40t/core/node/util_home.py +61 -61
- meerk40t/core/node/util_input.py +102 -102
- meerk40t/core/node/util_output.py +102 -102
- meerk40t/core/node/util_wait.py +65 -65
- meerk40t/core/parameters.py +709 -707
- meerk40t/core/planner.py +875 -785
- meerk40t/core/plotplanner.py +656 -652
- meerk40t/core/space.py +120 -113
- meerk40t/core/spoolers.py +706 -705
- meerk40t/core/svg_io.py +1836 -1549
- meerk40t/core/treeop.py +534 -445
- meerk40t/core/undos.py +278 -124
- meerk40t/core/units.py +784 -680
- meerk40t/core/view.py +393 -322
- meerk40t/core/webhelp.py +62 -62
- meerk40t/core/wordlist.py +513 -504
- meerk40t/cylinder/cylinder.py +247 -0
- meerk40t/cylinder/gui/cylindersettings.py +41 -0
- meerk40t/cylinder/gui/gui.py +24 -0
- meerk40t/device/__init__.py +1 -1
- meerk40t/device/basedevice.py +322 -123
- meerk40t/device/devicechoices.py +50 -0
- meerk40t/device/dummydevice.py +163 -128
- meerk40t/device/gui/defaultactions.py +618 -602
- meerk40t/device/gui/effectspanel.py +114 -0
- meerk40t/device/gui/formatterpanel.py +253 -290
- meerk40t/device/gui/warningpanel.py +337 -260
- meerk40t/device/mixins.py +13 -13
- meerk40t/dxf/__init__.py +1 -1
- meerk40t/dxf/dxf_io.py +766 -554
- meerk40t/dxf/plugin.py +47 -35
- meerk40t/external_plugins.py +79 -79
- meerk40t/external_plugins_build.py +28 -28
- meerk40t/extra/cag.py +112 -116
- meerk40t/extra/coolant.py +403 -0
- meerk40t/extra/encode_detect.py +198 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +835 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +630 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +284 -0
- meerk40t/extra/param_functions.py +1542 -1556
- meerk40t/extra/potrace.py +257 -253
- meerk40t/extra/serial_exchange.py +118 -0
- meerk40t/extra/updater.py +602 -453
- meerk40t/extra/vectrace.py +147 -146
- meerk40t/extra/winsleep.py +83 -83
- meerk40t/extra/xcs_reader.py +597 -0
- meerk40t/fill/fills.py +781 -335
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +614 -567
- meerk40t/grbl/control.py +87 -87
- meerk40t/grbl/controller.py +990 -903
- meerk40t/grbl/device.py +1081 -768
- meerk40t/grbl/driver.py +989 -771
- meerk40t/grbl/emulator.py +532 -497
- meerk40t/grbl/gcodejob.py +783 -767
- meerk40t/grbl/gui/grblconfiguration.py +373 -298
- meerk40t/grbl/gui/grblcontroller.py +485 -271
- meerk40t/grbl/gui/grblhardwareconfig.py +269 -153
- meerk40t/grbl/gui/grbloperationconfig.py +105 -0
- meerk40t/grbl/gui/gui.py +147 -116
- meerk40t/grbl/interpreter.py +44 -44
- meerk40t/grbl/loader.py +22 -22
- meerk40t/grbl/mock_connection.py +56 -56
- meerk40t/grbl/plugin.py +294 -264
- meerk40t/grbl/serial_connection.py +93 -88
- meerk40t/grbl/tcp_connection.py +81 -79
- meerk40t/grbl/ws_connection.py +112 -0
- meerk40t/gui/__init__.py +1 -1
- meerk40t/gui/about.py +2042 -296
- meerk40t/gui/alignment.py +1644 -1608
- meerk40t/gui/autoexec.py +199 -0
- meerk40t/gui/basicops.py +791 -670
- meerk40t/gui/bufferview.py +77 -71
- meerk40t/gui/busy.py +170 -133
- meerk40t/gui/choicepropertypanel.py +1673 -1469
- meerk40t/gui/consolepanel.py +706 -542
- meerk40t/gui/devicepanel.py +687 -581
- meerk40t/gui/dialogoptions.py +110 -107
- meerk40t/gui/executejob.py +316 -306
- meerk40t/gui/fonts.py +90 -90
- meerk40t/gui/functionwrapper.py +252 -0
- meerk40t/gui/gui_mixins.py +729 -0
- meerk40t/gui/guicolors.py +205 -182
- meerk40t/gui/help_assets/help_assets.py +218 -201
- meerk40t/gui/helper.py +154 -0
- meerk40t/gui/hersheymanager.py +1430 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +892 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2917 -0
- meerk40t/gui/materialtest.py +1722 -1694
- meerk40t/gui/mkdebug.py +646 -359
- meerk40t/gui/mwindow.py +163 -140
- meerk40t/gui/navigationpanels.py +2605 -2467
- meerk40t/gui/notes.py +143 -142
- meerk40t/gui/opassignment.py +414 -410
- meerk40t/gui/operation_info.py +310 -299
- meerk40t/gui/plugin.py +494 -328
- meerk40t/gui/position.py +714 -669
- meerk40t/gui/preferences.py +901 -650
- meerk40t/gui/propertypanels/attributes.py +1461 -1131
- meerk40t/gui/propertypanels/blobproperty.py +117 -114
- meerk40t/gui/propertypanels/consoleproperty.py +83 -80
- meerk40t/gui/propertypanels/gotoproperty.py +77 -0
- meerk40t/gui/propertypanels/groupproperties.py +223 -217
- meerk40t/gui/propertypanels/hatchproperty.py +489 -469
- meerk40t/gui/propertypanels/imageproperty.py +2244 -1384
- meerk40t/gui/propertypanels/inputproperty.py +59 -58
- meerk40t/gui/propertypanels/opbranchproperties.py +82 -80
- meerk40t/gui/propertypanels/operationpropertymain.py +1890 -1638
- meerk40t/gui/propertypanels/outputproperty.py +59 -58
- meerk40t/gui/propertypanels/pathproperty.py +389 -380
- meerk40t/gui/propertypanels/placementproperty.py +1214 -383
- meerk40t/gui/propertypanels/pointproperty.py +140 -136
- meerk40t/gui/propertypanels/propertywindow.py +313 -181
- meerk40t/gui/propertypanels/rasterwizardpanels.py +996 -912
- meerk40t/gui/propertypanels/regbranchproperties.py +76 -0
- meerk40t/gui/propertypanels/textproperty.py +770 -755
- meerk40t/gui/propertypanels/waitproperty.py +56 -55
- meerk40t/gui/propertypanels/warpproperty.py +121 -0
- meerk40t/gui/propertypanels/wobbleproperty.py +255 -204
- meerk40t/gui/ribbon.py +2468 -2210
- meerk40t/gui/scene/scene.py +1100 -1051
- meerk40t/gui/scene/sceneconst.py +22 -22
- meerk40t/gui/scene/scenepanel.py +439 -349
- meerk40t/gui/scene/scenespacewidget.py +365 -365
- meerk40t/gui/scene/widget.py +518 -505
- meerk40t/gui/scenewidgets/affinemover.py +215 -215
- meerk40t/gui/scenewidgets/attractionwidget.py +315 -309
- meerk40t/gui/scenewidgets/bedwidget.py +120 -97
- meerk40t/gui/scenewidgets/elementswidget.py +137 -107
- meerk40t/gui/scenewidgets/gridwidget.py +785 -745
- meerk40t/gui/scenewidgets/guidewidget.py +765 -765
- meerk40t/gui/scenewidgets/laserpathwidget.py +66 -66
- meerk40t/gui/scenewidgets/machineoriginwidget.py +86 -86
- meerk40t/gui/scenewidgets/nodeselector.py +28 -28
- meerk40t/gui/scenewidgets/rectselectwidget.py +589 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2952 -2756
- meerk40t/gui/simpleui.py +357 -333
- meerk40t/gui/simulation.py +2431 -2094
- meerk40t/gui/snapoptions.py +208 -203
- meerk40t/gui/spoolerpanel.py +1227 -1180
- meerk40t/gui/statusbarwidgets/defaultoperations.py +480 -353
- meerk40t/gui/statusbarwidgets/infowidget.py +520 -483
- meerk40t/gui/statusbarwidgets/opassignwidget.py +356 -355
- meerk40t/gui/statusbarwidgets/selectionwidget.py +172 -171
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +754 -236
- meerk40t/gui/statusbarwidgets/statusbar.py +272 -260
- meerk40t/gui/statusbarwidgets/statusbarwidget.py +268 -270
- meerk40t/gui/statusbarwidgets/strokewidget.py +267 -251
- meerk40t/gui/themes.py +200 -78
- meerk40t/gui/tips.py +591 -0
- meerk40t/gui/toolwidgets/circlebrush.py +35 -35
- meerk40t/gui/toolwidgets/toolcircle.py +248 -242
- meerk40t/gui/toolwidgets/toolcontainer.py +82 -77
- meerk40t/gui/toolwidgets/tooldraw.py +97 -90
- meerk40t/gui/toolwidgets/toolellipse.py +219 -212
- meerk40t/gui/toolwidgets/toolimagecut.py +25 -132
- meerk40t/gui/toolwidgets/toolline.py +39 -144
- meerk40t/gui/toolwidgets/toollinetext.py +79 -236
- meerk40t/gui/toolwidgets/toollinetext_inline.py +296 -0
- meerk40t/gui/toolwidgets/toolmeasure.py +160 -216
- meerk40t/gui/toolwidgets/toolnodeedit.py +2088 -2074
- meerk40t/gui/toolwidgets/toolnodemove.py +92 -94
- meerk40t/gui/toolwidgets/toolparameter.py +754 -668
- meerk40t/gui/toolwidgets/toolplacement.py +108 -108
- meerk40t/gui/toolwidgets/toolpoint.py +68 -59
- meerk40t/gui/toolwidgets/toolpointlistbuilder.py +294 -0
- meerk40t/gui/toolwidgets/toolpointmove.py +183 -0
- meerk40t/gui/toolwidgets/toolpolygon.py +288 -403
- meerk40t/gui/toolwidgets/toolpolyline.py +38 -196
- meerk40t/gui/toolwidgets/toolrect.py +211 -207
- meerk40t/gui/toolwidgets/toolrelocate.py +72 -72
- meerk40t/gui/toolwidgets/toolribbon.py +598 -113
- meerk40t/gui/toolwidgets/tooltabedit.py +546 -0
- meerk40t/gui/toolwidgets/tooltext.py +98 -89
- meerk40t/gui/toolwidgets/toolvector.py +213 -204
- meerk40t/gui/toolwidgets/toolwidget.py +39 -39
- meerk40t/gui/usbconnect.py +98 -91
- meerk40t/gui/utilitywidgets/buttonwidget.py +18 -18
- meerk40t/gui/utilitywidgets/checkboxwidget.py +90 -90
- meerk40t/gui/utilitywidgets/controlwidget.py +14 -14
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +343 -340
- meerk40t/gui/utilitywidgets/debugwidgets.py +148 -0
- meerk40t/gui/utilitywidgets/handlewidget.py +27 -27
- meerk40t/gui/utilitywidgets/harmonograph.py +450 -447
- meerk40t/gui/utilitywidgets/openclosewidget.py +40 -40
- meerk40t/gui/utilitywidgets/rotationwidget.py +54 -54
- meerk40t/gui/utilitywidgets/scalewidget.py +75 -75
- meerk40t/gui/utilitywidgets/seekbarwidget.py +183 -183
- meerk40t/gui/utilitywidgets/togglewidget.py +142 -142
- meerk40t/gui/utilitywidgets/toolbarwidget.py +8 -8
- meerk40t/gui/wordlisteditor.py +985 -931
- meerk40t/gui/wxmeerk40t.py +1444 -1169
- meerk40t/gui/wxmmain.py +5578 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1635 -1453
- meerk40t/gui/wxmtree.py +2410 -2089
- meerk40t/gui/wxutils.py +1769 -1099
- meerk40t/gui/zmatrix.py +102 -102
- meerk40t/image/__init__.py +1 -1
- meerk40t/image/dither.py +429 -0
- meerk40t/image/imagetools.py +2778 -2269
- meerk40t/internal_plugins.py +150 -130
- meerk40t/kernel/__init__.py +63 -12
- meerk40t/kernel/channel.py +259 -212
- meerk40t/kernel/context.py +538 -538
- meerk40t/kernel/exceptions.py +41 -41
- meerk40t/kernel/functions.py +463 -414
- meerk40t/kernel/jobs.py +100 -100
- meerk40t/kernel/kernel.py +3809 -3571
- meerk40t/kernel/lifecycles.py +71 -71
- meerk40t/kernel/module.py +49 -49
- meerk40t/kernel/service.py +147 -147
- meerk40t/kernel/settings.py +383 -343
- meerk40t/lihuiyu/controller.py +883 -876
- meerk40t/lihuiyu/device.py +1181 -1069
- meerk40t/lihuiyu/driver.py +1466 -1372
- meerk40t/lihuiyu/gui/gui.py +127 -106
- meerk40t/lihuiyu/gui/lhyaccelgui.py +377 -363
- meerk40t/lihuiyu/gui/lhycontrollergui.py +741 -651
- meerk40t/lihuiyu/gui/lhydrivergui.py +470 -446
- meerk40t/lihuiyu/gui/lhyoperationproperties.py +238 -237
- meerk40t/lihuiyu/gui/tcpcontroller.py +226 -190
- meerk40t/lihuiyu/interpreter.py +53 -53
- meerk40t/lihuiyu/laserspeed.py +450 -450
- meerk40t/lihuiyu/loader.py +90 -90
- meerk40t/lihuiyu/parser.py +404 -404
- meerk40t/lihuiyu/plugin.py +101 -102
- meerk40t/lihuiyu/tcp_connection.py +111 -109
- meerk40t/main.py +231 -165
- meerk40t/moshi/builder.py +788 -781
- meerk40t/moshi/controller.py +505 -499
- meerk40t/moshi/device.py +495 -442
- meerk40t/moshi/driver.py +862 -696
- meerk40t/moshi/gui/gui.py +78 -76
- meerk40t/moshi/gui/moshicontrollergui.py +538 -522
- meerk40t/moshi/gui/moshidrivergui.py +87 -75
- meerk40t/moshi/plugin.py +43 -43
- meerk40t/network/console_server.py +102 -57
- meerk40t/network/kernelserver.py +10 -9
- meerk40t/network/tcp_server.py +142 -140
- meerk40t/network/udp_server.py +103 -77
- meerk40t/network/web_server.py +390 -0
- meerk40t/newly/controller.py +1158 -1144
- meerk40t/newly/device.py +874 -732
- meerk40t/newly/driver.py +540 -412
- meerk40t/newly/gui/gui.py +219 -188
- meerk40t/newly/gui/newlyconfig.py +116 -101
- meerk40t/newly/gui/newlycontroller.py +193 -186
- meerk40t/newly/gui/operationproperties.py +51 -51
- meerk40t/newly/mock_connection.py +82 -82
- meerk40t/newly/newly_params.py +56 -56
- meerk40t/newly/plugin.py +1214 -1246
- meerk40t/newly/usb_connection.py +322 -322
- meerk40t/rotary/gui/gui.py +52 -46
- meerk40t/rotary/gui/rotarysettings.py +240 -232
- meerk40t/rotary/rotary.py +202 -98
- meerk40t/ruida/control.py +291 -91
- meerk40t/ruida/controller.py +138 -1088
- meerk40t/ruida/device.py +672 -231
- meerk40t/ruida/driver.py +534 -472
- meerk40t/ruida/emulator.py +1494 -1491
- meerk40t/ruida/exceptions.py +4 -4
- meerk40t/ruida/gui/gui.py +71 -76
- meerk40t/ruida/gui/ruidaconfig.py +239 -72
- meerk40t/ruida/gui/ruidacontroller.py +187 -184
- meerk40t/ruida/gui/ruidaoperationproperties.py +48 -47
- meerk40t/ruida/loader.py +54 -52
- meerk40t/ruida/mock_connection.py +57 -109
- meerk40t/ruida/plugin.py +124 -87
- meerk40t/ruida/rdjob.py +2084 -945
- meerk40t/ruida/serial_connection.py +116 -0
- meerk40t/ruida/tcp_connection.py +146 -0
- meerk40t/ruida/udp_connection.py +73 -0
- meerk40t/svgelements.py +9671 -9669
- meerk40t/tools/driver_to_path.py +584 -579
- meerk40t/tools/geomstr.py +5583 -4680
- meerk40t/tools/jhfparser.py +357 -292
- meerk40t/tools/kerftest.py +904 -890
- meerk40t/tools/livinghinges.py +1168 -1033
- meerk40t/tools/pathtools.py +987 -949
- meerk40t/tools/pmatrix.py +234 -0
- meerk40t/tools/pointfinder.py +942 -942
- meerk40t/tools/polybool.py +940 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +989 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/METADATA +150 -139
- meerk40t-0.9.7010.dist-info/RECORD +445 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/zip-safe +1 -1
- meerk40t/balormk/elementlightjob.py +0 -159
- meerk40t-0.9.3001.dist-info/RECORD +0 -437
- test/bootstrap.py +0 -63
- test/test_cli.py +0 -12
- test/test_core_cutcode.py +0 -418
- test/test_core_elements.py +0 -144
- test/test_core_plotplanner.py +0 -397
- test/test_core_viewports.py +0 -312
- test/test_drivers_grbl.py +0 -108
- test/test_drivers_lihuiyu.py +0 -443
- test/test_drivers_newly.py +0 -113
- test/test_element_degenerate_points.py +0 -43
- test/test_elements_classify.py +0 -97
- test/test_elements_penbox.py +0 -22
- test/test_file_svg.py +0 -176
- test/test_fill.py +0 -155
- test/test_geomstr.py +0 -1523
- test/test_geomstr_nodes.py +0 -18
- test/test_imagetools_actualize.py +0 -306
- test/test_imagetools_wizard.py +0 -258
- test/test_kernel.py +0 -200
- test/test_laser_speeds.py +0 -3303
- test/test_length.py +0 -57
- test/test_lifecycle.py +0 -66
- test/test_operations.py +0 -251
- test/test_operations_hatch.py +0 -57
- test/test_ruida.py +0 -19
- test/test_spooler.py +0 -22
- test/test_tools_rasterplotter.py +0 -29
- test/test_wobble.py +0 -133
- test/test_zingl.py +0 -124
- {test → meerk40t/cylinder}/__init__.py +0 -0
- /meerk40t/{core/element_commands.py → cylinder/gui/__init__.py} +0 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/entry_points.txt +0 -0
@@ -1,912 +1,996 @@
|
|
1
|
-
from copy import deepcopy
|
2
|
-
|
3
|
-
import wx
|
4
|
-
|
5
|
-
from meerk40t.core.node.elem_image import ImageNode
|
6
|
-
from meerk40t.gui.wxutils import StaticBoxSizer, dip_size
|
7
|
-
|
8
|
-
_ = wx.GetTranslation
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
self.
|
46
|
-
|
47
|
-
|
48
|
-
self.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
self.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
self.
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
#
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
)
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
self.
|
115
|
-
|
116
|
-
|
117
|
-
# end wxGlade
|
118
|
-
|
119
|
-
def
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
self.
|
130
|
-
|
131
|
-
|
132
|
-
self.slider_contrast_contrast.
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
self.
|
141
|
-
|
142
|
-
|
143
|
-
def
|
144
|
-
self, event=None
|
145
|
-
): # wxGlade: ContrastPanel.<event_handler>
|
146
|
-
self.op["
|
147
|
-
self.
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
self
|
169
|
-
|
170
|
-
self.
|
171
|
-
self.
|
172
|
-
self.
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
)
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
self.
|
202
|
-
|
203
|
-
|
204
|
-
self.
|
205
|
-
|
206
|
-
)
|
207
|
-
self.
|
208
|
-
wx.
|
209
|
-
)
|
210
|
-
self.
|
211
|
-
wx.
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
self.
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
self.
|
227
|
-
self.
|
228
|
-
|
229
|
-
self.
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
self.
|
236
|
-
|
237
|
-
|
238
|
-
self.
|
239
|
-
|
240
|
-
|
241
|
-
self.
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
)
|
258
|
-
|
259
|
-
|
260
|
-
)
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
self.
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
):
|
284
|
-
|
285
|
-
self.
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
self,
|
306
|
-
|
307
|
-
self.
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
self
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
self
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
self
|
323
|
-
|
324
|
-
|
325
|
-
self
|
326
|
-
|
327
|
-
self.op["oversample"] =
|
328
|
-
self.
|
329
|
-
self.
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
self.
|
349
|
-
self.node
|
350
|
-
|
351
|
-
|
352
|
-
self
|
353
|
-
|
354
|
-
self.
|
355
|
-
|
356
|
-
self.
|
357
|
-
|
358
|
-
|
359
|
-
self
|
360
|
-
|
361
|
-
|
362
|
-
self.
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
if
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
self.
|
393
|
-
self.
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
self.
|
398
|
-
self.
|
399
|
-
|
400
|
-
self.
|
401
|
-
self.
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
#
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
self.
|
413
|
-
|
414
|
-
self.
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
self.
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
if
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
self.
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
)
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
)
|
546
|
-
self.
|
547
|
-
|
548
|
-
|
549
|
-
self.
|
550
|
-
|
551
|
-
)
|
552
|
-
self.
|
553
|
-
|
554
|
-
)
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
self.
|
590
|
-
self.
|
591
|
-
self.
|
592
|
-
|
593
|
-
|
594
|
-
self.
|
595
|
-
|
596
|
-
|
597
|
-
self.
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
self.
|
604
|
-
|
605
|
-
|
606
|
-
self.
|
607
|
-
|
608
|
-
)
|
609
|
-
|
610
|
-
self.
|
611
|
-
|
612
|
-
|
613
|
-
self.
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
)
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
self.
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
self
|
648
|
-
|
649
|
-
self.op["
|
650
|
-
self.
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
self.
|
656
|
-
self.
|
657
|
-
self.
|
658
|
-
self.slider_sharpen_percent.
|
659
|
-
self.
|
660
|
-
self.
|
661
|
-
|
662
|
-
|
663
|
-
self.
|
664
|
-
self.
|
665
|
-
|
666
|
-
|
667
|
-
self
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
self,
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
self,
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
self.
|
716
|
-
self.
|
717
|
-
|
718
|
-
self.
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
self.
|
724
|
-
|
725
|
-
self.
|
726
|
-
|
727
|
-
|
728
|
-
self
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
self.
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
self
|
744
|
-
|
745
|
-
self.
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
self
|
778
|
-
self.
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
self.
|
784
|
-
self.slider_gamma_factor
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
self
|
790
|
-
|
791
|
-
|
792
|
-
self.
|
793
|
-
self.
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
self.
|
816
|
-
self.
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
self.
|
834
|
-
|
835
|
-
self.
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
self
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
self.
|
848
|
-
|
849
|
-
self.
|
850
|
-
|
851
|
-
|
852
|
-
def
|
853
|
-
self
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
self.
|
891
|
-
|
892
|
-
self.check_enable.
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
self.
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
self.
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
1
|
+
from copy import deepcopy
|
2
|
+
|
3
|
+
import wx
|
4
|
+
|
5
|
+
from meerk40t.core.node.elem_image import ImageNode
|
6
|
+
from meerk40t.gui.wxutils import StaticBoxSizer, TextCtrl, dip_size, wxButton, wxCheckBox
|
7
|
+
|
8
|
+
_ = wx.GetTranslation
|
9
|
+
|
10
|
+
"""
|
11
|
+
Establishes property panels for some image operations
|
12
|
+
The priority of appearance is defined dynamically based
|
13
|
+
on the order within the node operations
|
14
|
+
|
15
|
+
"""
|
16
|
+
class ContrastPanel(wx.Panel):
|
17
|
+
name = _("Contrast")
|
18
|
+
|
19
|
+
@staticmethod
|
20
|
+
def priority(node):
|
21
|
+
base_priority = 20
|
22
|
+
prop = "contrast"
|
23
|
+
if hasattr(node, "as_image"):
|
24
|
+
for idx, n in enumerate(node.operations):
|
25
|
+
if n.get("name") == prop:
|
26
|
+
return base_priority + idx + 1
|
27
|
+
return base_priority
|
28
|
+
|
29
|
+
@staticmethod
|
30
|
+
def accepts(node):
|
31
|
+
if not hasattr(node, "as_image"):
|
32
|
+
return False
|
33
|
+
# Show it for all images...
|
34
|
+
return True
|
35
|
+
# for n in node.operations:
|
36
|
+
# if n.get("name") == "contrast":
|
37
|
+
# return True
|
38
|
+
# return False
|
39
|
+
|
40
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
41
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
42
|
+
wx.Panel.__init__(self, *args, **kwds)
|
43
|
+
self.context = context
|
44
|
+
self.context.themes.set_window_colors(self)
|
45
|
+
self.node = node
|
46
|
+
|
47
|
+
self.check_enable_contrast = wxCheckBox(self, wx.ID_ANY, _("Enable"))
|
48
|
+
self.button_reset_contrast = wxButton(self, wx.ID_ANY, _("Reset"))
|
49
|
+
self.slider_contrast_contrast = wx.Slider(
|
50
|
+
self, wx.ID_ANY, 0, -127, 127, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
51
|
+
)
|
52
|
+
self.text_contrast_contrast = TextCtrl(
|
53
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
54
|
+
)
|
55
|
+
self.slider_contrast_brightness = wx.Slider(
|
56
|
+
self, wx.ID_ANY, 0, -127, 127, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
57
|
+
)
|
58
|
+
self.text_contrast_brightness = TextCtrl(
|
59
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
60
|
+
)
|
61
|
+
|
62
|
+
self.__set_properties()
|
63
|
+
self.__do_layout()
|
64
|
+
|
65
|
+
self.Bind(
|
66
|
+
wx.EVT_CHECKBOX, self.on_check_enable_contrast, self.check_enable_contrast
|
67
|
+
)
|
68
|
+
self.Bind(
|
69
|
+
wx.EVT_BUTTON, self.on_button_reset_contrast, self.button_reset_contrast
|
70
|
+
)
|
71
|
+
self.Bind(
|
72
|
+
wx.EVT_SLIDER,
|
73
|
+
self.on_slider_contrast_contrast,
|
74
|
+
self.slider_contrast_contrast,
|
75
|
+
)
|
76
|
+
self.Bind(
|
77
|
+
wx.EVT_SLIDER,
|
78
|
+
self.on_slider_contrast_brightness,
|
79
|
+
self.slider_contrast_brightness,
|
80
|
+
)
|
81
|
+
# end wxGlade
|
82
|
+
|
83
|
+
op = None
|
84
|
+
for n in node.operations:
|
85
|
+
if n.get("name") == "contrast":
|
86
|
+
op = n
|
87
|
+
if op is None:
|
88
|
+
op = {
|
89
|
+
"name": "contrast",
|
90
|
+
"enable": False,
|
91
|
+
"contrast": 0,
|
92
|
+
"brightness": 0,
|
93
|
+
}
|
94
|
+
node.operations.append(op)
|
95
|
+
# raise ValueError
|
96
|
+
self.op = op
|
97
|
+
self.original_op = deepcopy(op)
|
98
|
+
self.check_enable_contrast.SetValue(self.op["enable"])
|
99
|
+
self.text_contrast_contrast.SetValue(str(self.op["contrast"]))
|
100
|
+
self.text_contrast_brightness.SetValue(str(self.op["brightness"]))
|
101
|
+
self.slider_contrast_contrast.SetValue(int(self.op["contrast"]))
|
102
|
+
self.slider_contrast_brightness.SetValue(int(self.op["brightness"]))
|
103
|
+
|
104
|
+
def __set_properties(self):
|
105
|
+
# begin wxGlade: ContrastPanel.__set_properties
|
106
|
+
self.check_enable_contrast.SetToolTip(_("Enable Contrast"))
|
107
|
+
self.check_enable_contrast.SetValue(1)
|
108
|
+
self.button_reset_contrast.SetToolTip(_("Reset Contrast"))
|
109
|
+
self.slider_contrast_contrast.SetToolTip(_("Contrast amount"))
|
110
|
+
self.text_contrast_contrast.SetToolTip(
|
111
|
+
_("Contrast the lights and darks by how much?")
|
112
|
+
)
|
113
|
+
self.slider_contrast_brightness.SetToolTip(_("Brightness amount"))
|
114
|
+
self.text_contrast_brightness.SetToolTip(
|
115
|
+
_("Make the image how much more bright?")
|
116
|
+
)
|
117
|
+
# end wxGlade
|
118
|
+
|
119
|
+
def __do_layout(self):
|
120
|
+
# begin wxGlade: ContrastPanel.__do_layout
|
121
|
+
sizer_contrast = StaticBoxSizer(self, wx.ID_ANY, _("Contrast"), wx.VERTICAL)
|
122
|
+
sizer_contrast_brightness = StaticBoxSizer(
|
123
|
+
self, wx.ID_ANY, _("Brightness Amount"), wx.HORIZONTAL
|
124
|
+
)
|
125
|
+
sizer_contrast_contrast = StaticBoxSizer(
|
126
|
+
self, wx.ID_ANY, _("Contrast Amount"), wx.HORIZONTAL
|
127
|
+
)
|
128
|
+
sizer_contrast_main = wx.BoxSizer(wx.HORIZONTAL)
|
129
|
+
sizer_contrast_main.Add(self.check_enable_contrast, 0, 0, 0)
|
130
|
+
sizer_contrast_main.Add(self.button_reset_contrast, 0, 0, 0)
|
131
|
+
sizer_contrast.Add(sizer_contrast_main, 0, wx.EXPAND, 0)
|
132
|
+
sizer_contrast_contrast.Add(self.slider_contrast_contrast, 5, wx.EXPAND, 0)
|
133
|
+
sizer_contrast_contrast.Add(self.text_contrast_contrast, 1, 0, 0)
|
134
|
+
sizer_contrast.Add(sizer_contrast_contrast, 0, wx.EXPAND, 0)
|
135
|
+
sizer_contrast_brightness.Add(self.slider_contrast_brightness, 5, wx.EXPAND, 0)
|
136
|
+
sizer_contrast_brightness.Add(self.text_contrast_brightness, 1, 0, 0)
|
137
|
+
sizer_contrast.Add(sizer_contrast_brightness, 0, wx.EXPAND, 0)
|
138
|
+
self.SetSizer(sizer_contrast)
|
139
|
+
sizer_contrast.Fit(self)
|
140
|
+
self.Layout()
|
141
|
+
# end wxGlade
|
142
|
+
|
143
|
+
def on_check_enable_contrast(
|
144
|
+
self, event=None
|
145
|
+
): # wxGlade: ContrastPanel.<event_handler>
|
146
|
+
self.op["enable"] = self.check_enable_contrast.GetValue()
|
147
|
+
self.context.elements.do_image_update(self.node, self.context)
|
148
|
+
|
149
|
+
def on_button_reset_contrast(
|
150
|
+
self, event=None
|
151
|
+
): # wxGlade: ContrastPanel.<event_handler>
|
152
|
+
self.op["contrast"] = self.original_op["contrast"]
|
153
|
+
self.op["brightness"] = self.original_op["brightness"]
|
154
|
+
self.text_contrast_contrast.SetValue(str(self.op["contrast"]))
|
155
|
+
self.text_contrast_brightness.SetValue(str(self.op["brightness"]))
|
156
|
+
self.slider_contrast_contrast.SetValue(self.op["contrast"])
|
157
|
+
self.slider_contrast_brightness.SetValue(self.op["brightness"])
|
158
|
+
self.context.elements.do_image_update(self.node, self.context)
|
159
|
+
|
160
|
+
def on_slider_contrast_contrast(
|
161
|
+
self, event=None
|
162
|
+
): # wxGlade: ContrastPanel.<event_handler>
|
163
|
+
self.op["contrast"] = int(self.slider_contrast_contrast.GetValue())
|
164
|
+
self.text_contrast_contrast.SetValue(str(self.op["contrast"]))
|
165
|
+
self.context.elements.do_image_update(self.node, self.context)
|
166
|
+
|
167
|
+
def on_slider_contrast_brightness(
|
168
|
+
self, event=None
|
169
|
+
): # wxGlade: ContrastPanel.<event_handler>
|
170
|
+
self.op["brightness"] = int(self.slider_contrast_brightness.GetValue())
|
171
|
+
self.text_contrast_brightness.SetValue(str(self.op["brightness"]))
|
172
|
+
self.context.elements.do_image_update(self.node, self.context)
|
173
|
+
|
174
|
+
|
175
|
+
class HalftonePanel(wx.Panel):
|
176
|
+
name = _("Halftone")
|
177
|
+
|
178
|
+
@staticmethod
|
179
|
+
def priority(node):
|
180
|
+
base_priority = 20
|
181
|
+
prop = "halftone"
|
182
|
+
if hasattr(node, "as_image"):
|
183
|
+
for idx, n in enumerate(node.operations):
|
184
|
+
if n.get("name") == prop:
|
185
|
+
return base_priority + idx + 1
|
186
|
+
return base_priority
|
187
|
+
|
188
|
+
@staticmethod
|
189
|
+
def accepts(node):
|
190
|
+
if not hasattr(node, "as_image"):
|
191
|
+
return False
|
192
|
+
for n in node.operations:
|
193
|
+
if n.get("name") == "halftone":
|
194
|
+
return True
|
195
|
+
return False
|
196
|
+
|
197
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
198
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
199
|
+
wx.Panel.__init__(self, *args, **kwds)
|
200
|
+
self.context = context
|
201
|
+
self.context.themes.set_window_colors(self)
|
202
|
+
self.node = node
|
203
|
+
|
204
|
+
self.check_enable_halftone = wxCheckBox(self, wx.ID_ANY, "Enable")
|
205
|
+
self.button_reset_halftone = wxButton(self, wx.ID_ANY, "Reset")
|
206
|
+
self.check_halftone_black = wxCheckBox(self, wx.ID_ANY, "Black")
|
207
|
+
self.slider_halftone_sample = wx.Slider(
|
208
|
+
self, wx.ID_ANY, 10, 0, 50, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
209
|
+
)
|
210
|
+
self.text_halftone_sample = TextCtrl(
|
211
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
212
|
+
)
|
213
|
+
self.slider_halftone_angle = wx.Slider(
|
214
|
+
self, wx.ID_ANY, 22, 0, 90, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
215
|
+
)
|
216
|
+
self.text_halftone_angle = TextCtrl(
|
217
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
218
|
+
)
|
219
|
+
self.slider_halftone_oversample = wx.Slider(
|
220
|
+
self, wx.ID_ANY, 2, 0, 50, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
221
|
+
)
|
222
|
+
self.text_halftone_oversample = TextCtrl(
|
223
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
224
|
+
)
|
225
|
+
|
226
|
+
self.__set_properties()
|
227
|
+
self.__do_layout()
|
228
|
+
|
229
|
+
self.Bind(
|
230
|
+
wx.EVT_CHECKBOX, self.on_check_enable_halftone, self.check_enable_halftone
|
231
|
+
)
|
232
|
+
self.Bind(
|
233
|
+
wx.EVT_BUTTON, self.on_button_reset_halftone, self.button_reset_halftone
|
234
|
+
)
|
235
|
+
self.Bind(
|
236
|
+
wx.EVT_CHECKBOX, self.on_check_halftone_black, self.check_halftone_black
|
237
|
+
)
|
238
|
+
self.Bind(
|
239
|
+
wx.EVT_SLIDER, self.on_slider_halftone_sample, self.slider_halftone_sample
|
240
|
+
)
|
241
|
+
self.Bind(
|
242
|
+
wx.EVT_SLIDER, self.on_slider_halftone_angle, self.slider_halftone_angle
|
243
|
+
)
|
244
|
+
self.Bind(
|
245
|
+
wx.EVT_SLIDER,
|
246
|
+
self.on_slider_halftone_oversample,
|
247
|
+
self.slider_halftone_oversample,
|
248
|
+
)
|
249
|
+
# end wxGlade
|
250
|
+
op = None
|
251
|
+
for n in node.operations:
|
252
|
+
if n.get("name") == "halftone":
|
253
|
+
op = n
|
254
|
+
if op is None:
|
255
|
+
raise ValueError
|
256
|
+
self.op = op
|
257
|
+
self.original_op = deepcopy(op)
|
258
|
+
self.check_enable_halftone.SetValue(self.op["enable"])
|
259
|
+
self.check_halftone_black.SetValue(self.op["black"])
|
260
|
+
self.text_halftone_sample.SetValue(str(self.op["sample"]))
|
261
|
+
self.slider_halftone_sample.SetValue(int(self.op["sample"]))
|
262
|
+
self.text_halftone_angle.SetValue(str(self.op["angle"]))
|
263
|
+
self.slider_halftone_angle.SetValue(int(self.op["angle"]))
|
264
|
+
self.text_halftone_oversample.SetValue(str(self.op["oversample"]))
|
265
|
+
self.slider_halftone_oversample.SetValue(int(self.op["oversample"]))
|
266
|
+
|
267
|
+
def __set_properties(self):
|
268
|
+
# begin wxGlade: HalftonePanel.__set_properties
|
269
|
+
self.check_enable_halftone.SetToolTip(_("Enable Halftone"))
|
270
|
+
self.check_enable_halftone.SetValue(1)
|
271
|
+
self.button_reset_halftone.SetToolTip(_("Halftone Reset"))
|
272
|
+
self.check_halftone_black.SetToolTip(_("Use black rather than white dots"))
|
273
|
+
self.slider_halftone_sample.SetToolTip(_("Sample size for halftone dots"))
|
274
|
+
self.text_halftone_sample.SetToolTip(_("Halftone dot size"))
|
275
|
+
self.slider_halftone_angle.SetToolTip(_("Angle for halftone dots"))
|
276
|
+
self.text_halftone_angle.SetToolTip(_("Halftone dot angle"))
|
277
|
+
self.slider_halftone_oversample.SetToolTip(
|
278
|
+
_("Oversampling amount for halftone-dots")
|
279
|
+
)
|
280
|
+
self.text_halftone_oversample.SetToolTip(_("Halftone dot oversampling amount"))
|
281
|
+
# end wxGlade
|
282
|
+
|
283
|
+
def __do_layout(self):
|
284
|
+
# begin wxGlade: HalftonePanel.__do_layout
|
285
|
+
sizer_halftone = StaticBoxSizer(self, wx.ID_ANY, _("Halftone"), wx.VERTICAL)
|
286
|
+
sizer_halftone_oversample = StaticBoxSizer(
|
287
|
+
self, wx.ID_ANY, _("Oversample"), wx.HORIZONTAL
|
288
|
+
)
|
289
|
+
sizer_halftone_angle = StaticBoxSizer(
|
290
|
+
self, wx.ID_ANY, _("Angle"), wx.HORIZONTAL
|
291
|
+
)
|
292
|
+
sizer_halftone_sample = StaticBoxSizer(
|
293
|
+
self, wx.ID_ANY, _("Sample"), wx.HORIZONTAL
|
294
|
+
)
|
295
|
+
sizer_halftone_main = wx.BoxSizer(wx.HORIZONTAL)
|
296
|
+
sizer_halftone_main.Add(self.check_enable_halftone, 0, 0, 0)
|
297
|
+
sizer_halftone_main.Add(self.button_reset_halftone, 0, 0, 0)
|
298
|
+
sizer_halftone_main.Add((20, 20), 0, 0, 0)
|
299
|
+
sizer_halftone_main.Add(self.check_halftone_black, 0, 0, 0)
|
300
|
+
sizer_halftone.Add(sizer_halftone_main, 0, wx.EXPAND, 0)
|
301
|
+
sizer_halftone_sample.Add(self.slider_halftone_sample, 5, wx.EXPAND, 0)
|
302
|
+
sizer_halftone_sample.Add(self.text_halftone_sample, 1, 0, 0)
|
303
|
+
sizer_halftone.Add(sizer_halftone_sample, 0, wx.EXPAND, 0)
|
304
|
+
sizer_halftone_angle.Add(self.slider_halftone_angle, 5, wx.EXPAND, 0)
|
305
|
+
sizer_halftone_angle.Add(self.text_halftone_angle, 1, 0, 0)
|
306
|
+
sizer_halftone.Add(sizer_halftone_angle, 0, wx.EXPAND, 0)
|
307
|
+
sizer_halftone_oversample.Add(self.slider_halftone_oversample, 5, wx.EXPAND, 0)
|
308
|
+
sizer_halftone_oversample.Add(self.text_halftone_oversample, 1, 0, 0)
|
309
|
+
sizer_halftone.Add(sizer_halftone_oversample, 0, wx.EXPAND, 0)
|
310
|
+
self.SetSizer(sizer_halftone)
|
311
|
+
sizer_halftone.Fit(self)
|
312
|
+
self.Layout()
|
313
|
+
# end wxGlade
|
314
|
+
|
315
|
+
def on_check_enable_halftone(
|
316
|
+
self, event=None
|
317
|
+
): # wxGlade: HalftonePanel.<event_handler>
|
318
|
+
self.op["enable"] = self.check_enable_halftone.GetValue()
|
319
|
+
self.context.elements.do_image_update(self.node, self.context)
|
320
|
+
|
321
|
+
def on_button_reset_halftone(
|
322
|
+
self, event=None
|
323
|
+
): # wxGlade: HalftonePanel.<event_handler>
|
324
|
+
self.op["black"] = self.original_op["black"]
|
325
|
+
self.op["sample"] = self.original_op["sample"]
|
326
|
+
self.op["angle"] = self.original_op["angle"]
|
327
|
+
self.op["oversample"] = self.original_op["oversample"]
|
328
|
+
self.check_enable_halftone.SetValue(self.op["enable"])
|
329
|
+
self.check_halftone_black.SetValue(self.op["black"])
|
330
|
+
self.text_halftone_sample.SetValue(str(self.op["sample"]))
|
331
|
+
self.slider_halftone_sample.SetValue(int(self.op["sample"]))
|
332
|
+
self.text_halftone_angle.SetValue(str(self.op["angle"]))
|
333
|
+
self.slider_halftone_angle.SetValue(int(self.op["angle"]))
|
334
|
+
self.text_halftone_oversample.SetValue(str(self.op["oversample"]))
|
335
|
+
self.slider_halftone_oversample.SetValue(int(self.op["oversample"]))
|
336
|
+
self.context.elements.do_image_update(self.node, self.context)
|
337
|
+
|
338
|
+
def on_check_halftone_black(
|
339
|
+
self, event=None
|
340
|
+
): # wxGlade: HalftonePanel.<event_handler>
|
341
|
+
self.op["black"] = self.check_halftone_black.GetValue()
|
342
|
+
self.context.elements.do_image_update(self.node, self.context)
|
343
|
+
|
344
|
+
def on_slider_halftone_sample(
|
345
|
+
self, event=None
|
346
|
+
): # wxGlade: HalftonePanel.<event_handler>
|
347
|
+
self.op["sample"] = int(self.slider_halftone_sample.GetValue())
|
348
|
+
self.text_halftone_sample.SetValue(str(self.op["sample"]))
|
349
|
+
self.context.elements.do_image_update(self.node, self.context)
|
350
|
+
|
351
|
+
def on_slider_halftone_angle(
|
352
|
+
self, event=None
|
353
|
+
): # wxGlade: HalftonePanel.<event_handler>
|
354
|
+
self.op["angle"] = int(self.slider_halftone_angle.GetValue())
|
355
|
+
self.text_halftone_angle.SetValue(str(self.op["angle"]))
|
356
|
+
self.context.elements.do_image_update(self.node, self.context)
|
357
|
+
|
358
|
+
def on_slider_halftone_oversample(
|
359
|
+
self, event=None
|
360
|
+
): # wxGlade: HalftonePanel.<event_handler>
|
361
|
+
self.op["oversample"] = int(self.slider_halftone_oversample.GetValue())
|
362
|
+
self.text_halftone_oversample.SetValue(str(self.op["oversample"]))
|
363
|
+
self.context.elements.do_image_update(self.node, self.context)
|
364
|
+
|
365
|
+
|
366
|
+
class ToneCurvePanel(wx.Panel):
|
367
|
+
name = _("Tone")
|
368
|
+
|
369
|
+
@staticmethod
|
370
|
+
def priority(node):
|
371
|
+
base_priority = 20
|
372
|
+
prop = "tone"
|
373
|
+
if hasattr(node, "as_image"):
|
374
|
+
for idx, n in enumerate(node.operations):
|
375
|
+
if n.get("name") == prop:
|
376
|
+
return base_priority + idx + 1
|
377
|
+
return base_priority
|
378
|
+
|
379
|
+
@staticmethod
|
380
|
+
def accepts(node):
|
381
|
+
if not hasattr(node, "as_image"):
|
382
|
+
return False
|
383
|
+
for n in node.operations:
|
384
|
+
if n.get("name") == "tone":
|
385
|
+
return True
|
386
|
+
return False
|
387
|
+
|
388
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
389
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
390
|
+
wx.Panel.__init__(self, *args, **kwds)
|
391
|
+
self.context = context
|
392
|
+
self.context.themes.set_window_colors(self)
|
393
|
+
self.node = node
|
394
|
+
|
395
|
+
self._tone_panel_buffer = None
|
396
|
+
self.check_enable_tone = wxCheckBox(self, wx.ID_ANY, _("Enable"))
|
397
|
+
self.button_reset_tone = wxButton(self, wx.ID_ANY, _("Reset"))
|
398
|
+
self.curve_panel = wx.Panel(self, wx.ID_ANY)
|
399
|
+
|
400
|
+
self.__set_properties()
|
401
|
+
self.__do_layout()
|
402
|
+
|
403
|
+
self.Bind(wx.EVT_CHECKBOX, self.on_check_enable_tone, self.check_enable_tone)
|
404
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_reset_tone, self.button_reset_tone)
|
405
|
+
# end wxGlade
|
406
|
+
self.curve_panel.Bind(wx.EVT_PAINT, self.on_tone_panel_paint)
|
407
|
+
# self.curve_panel.Bind(wx.EVT_ERASE_BACKGROUND, lambda e: None)
|
408
|
+
self.curve_panel.Bind(wx.EVT_MOTION, self.on_curve_mouse_move)
|
409
|
+
self.curve_panel.Bind(wx.EVT_LEFT_DOWN, self.on_curve_mouse_left_down)
|
410
|
+
self.curve_panel.Bind(wx.EVT_LEFT_UP, self.on_curve_mouse_left_up)
|
411
|
+
self.curve_panel.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.on_curve_mouse_lost)
|
412
|
+
self.point = -1
|
413
|
+
|
414
|
+
self.graph_brush = wx.Brush()
|
415
|
+
self.graph_pen = wx.Pen()
|
416
|
+
c = self.context.themes.get("win_bg")
|
417
|
+
self.graph_brush.SetColour(c)
|
418
|
+
self.graph_pen.SetColour(wx.Colour(255 - c[0], 255 - c[1], 255 - c[2]))
|
419
|
+
self.graph_pen.SetWidth(5)
|
420
|
+
|
421
|
+
op = None
|
422
|
+
for n in node.operations:
|
423
|
+
if n.get("name") == "tone":
|
424
|
+
op = n
|
425
|
+
if op is None:
|
426
|
+
raise ValueError
|
427
|
+
self.op = op
|
428
|
+
self.original_op = deepcopy(op)
|
429
|
+
self.check_enable_tone.SetValue(op["enable"])
|
430
|
+
self.Layout()
|
431
|
+
width, height = self.curve_panel.Size
|
432
|
+
if width <= 0:
|
433
|
+
width = 1
|
434
|
+
if height <= 0:
|
435
|
+
height = 1
|
436
|
+
self._tone_panel_buffer = wx.Bitmap(width, height)
|
437
|
+
self.update_in_gui_thread()
|
438
|
+
|
439
|
+
def __set_properties(self):
|
440
|
+
# begin wxGlade: ToneCurvePanel.__set_properties
|
441
|
+
self.check_enable_tone.SetToolTip(_("Enable Tone Curve"))
|
442
|
+
self.check_enable_tone.SetValue(1)
|
443
|
+
self.button_reset_tone.SetToolTip(_("Reset Tone Curve"))
|
444
|
+
self.curve_panel.SetMinSize(dip_size(self, 256, 256))
|
445
|
+
self.curve_panel.SetMaxSize(dip_size(self, 256, 256))
|
446
|
+
# end wxGlade
|
447
|
+
|
448
|
+
def __do_layout(self):
|
449
|
+
# begin wxGlade: ToneCurvePanel.__do_layout
|
450
|
+
sizer_tone = StaticBoxSizer(self, wx.ID_ANY, _("Tone Curve"), wx.VERTICAL)
|
451
|
+
sizer_tone_curve = wx.BoxSizer(wx.HORIZONTAL)
|
452
|
+
sizer_tone_curve.Add(self.check_enable_tone, 0, 0, 0)
|
453
|
+
sizer_tone_curve.Add(self.button_reset_tone, 0, 0, 0)
|
454
|
+
sizer_tone.Add(sizer_tone_curve, 0, wx.EXPAND, 0)
|
455
|
+
sizer_tone.Add(self.curve_panel, 0, wx.EXPAND, 0)
|
456
|
+
self.SetSizer(sizer_tone)
|
457
|
+
sizer_tone.Fit(self)
|
458
|
+
self.Layout()
|
459
|
+
# end wxGlade
|
460
|
+
|
461
|
+
def update_in_gui_thread(self):
|
462
|
+
self.on_update_tone()
|
463
|
+
try:
|
464
|
+
self.Refresh(True)
|
465
|
+
self.Update()
|
466
|
+
except RuntimeError:
|
467
|
+
pass
|
468
|
+
|
469
|
+
def on_tone_panel_paint(self, event=None):
|
470
|
+
try:
|
471
|
+
wx.BufferedPaintDC(self.curve_panel, self._tone_panel_buffer)
|
472
|
+
except RuntimeError:
|
473
|
+
pass
|
474
|
+
|
475
|
+
def on_curve_mouse_move(self, event):
|
476
|
+
if self.curve_panel.HasCapture():
|
477
|
+
pos = event.GetPosition()
|
478
|
+
try:
|
479
|
+
v = 255 - pos[1]
|
480
|
+
if self.op["type"] == "point":
|
481
|
+
current_x = pos[0]
|
482
|
+
if 0 <= current_x <= 255:
|
483
|
+
self.op["values"][pos[0]] = (pos[0], v)
|
484
|
+
else:
|
485
|
+
self.op["values"][self.point] = (pos[0], v)
|
486
|
+
self.context.elements.do_image_update(self.node, self.context)
|
487
|
+
self.update_in_gui_thread()
|
488
|
+
except (KeyError, IndexError):
|
489
|
+
pass
|
490
|
+
|
491
|
+
def on_curve_mouse_left_down(self, event):
|
492
|
+
if not self.curve_panel.HasCapture():
|
493
|
+
self.curve_panel.CaptureMouse()
|
494
|
+
distance = float("inf")
|
495
|
+
pos = event.GetPosition()
|
496
|
+
if self.op["type"] == "point":
|
497
|
+
v = 255 - pos[1]
|
498
|
+
self.point = pos[0]
|
499
|
+
self.op["values"][pos[0]] = (pos[0], v)
|
500
|
+
self.update_in_gui_thread()
|
501
|
+
else:
|
502
|
+
for i, q in enumerate(self.op["values"]):
|
503
|
+
dx = pos[0] - q[0]
|
504
|
+
dy = (255 - pos[1]) - q[1]
|
505
|
+
d = dx * dx + dy * dy
|
506
|
+
if d < distance:
|
507
|
+
distance = d
|
508
|
+
self.point = i
|
509
|
+
|
510
|
+
def on_curve_mouse_left_up(self, event=None):
|
511
|
+
if self.curve_panel.HasCapture():
|
512
|
+
self.curve_panel.ReleaseMouse()
|
513
|
+
|
514
|
+
def on_curve_mouse_lost(self, event=None):
|
515
|
+
pass
|
516
|
+
|
517
|
+
def on_update_tone(self, event=None):
|
518
|
+
if self._tone_panel_buffer is None:
|
519
|
+
return
|
520
|
+
dc = wx.MemoryDC()
|
521
|
+
dc.SelectObject(self._tone_panel_buffer)
|
522
|
+
dc.Clear()
|
523
|
+
gc = wx.GraphicsContext.Create(dc)
|
524
|
+
gc.PushState()
|
525
|
+
gc.SetBrush(self.graph_brush)
|
526
|
+
gc.DrawRectangle(0, 0, *self._tone_panel_buffer.Size)
|
527
|
+
gc.SetPen(self.graph_pen)
|
528
|
+
|
529
|
+
tone_values = self.op["values"]
|
530
|
+
if self.op["type"] == "spline":
|
531
|
+
spline = ImageNode.spline(tone_values)
|
532
|
+
starts = [(i, 255 - spline[i]) for i in range(255)]
|
533
|
+
ends = [(i, 255 - spline[i]) for i in range(1, 256)]
|
534
|
+
else:
|
535
|
+
tone_values = [q for q in tone_values if q is not None]
|
536
|
+
spline = ImageNode.line(tone_values)
|
537
|
+
starts = [(i, 255 - spline[i]) for i in range(255)]
|
538
|
+
ends = [(i, 255 - spline[i]) for i in range(1, 256)]
|
539
|
+
gc.StrokeLineSegments(starts, ends)
|
540
|
+
gc.PopState()
|
541
|
+
gc.Destroy()
|
542
|
+
del dc
|
543
|
+
|
544
|
+
def on_check_enable_tone(self, event=None): # wxGlade: RasterWizard.<event_handler>
|
545
|
+
self.op["enable"] = self.check_enable_tone.GetValue()
|
546
|
+
self.context.elements.do_image_update(self.node, self.context)
|
547
|
+
|
548
|
+
def on_button_reset_tone(self, event=None): # wxGlade: RasterWizard.<event_handler>
|
549
|
+
self.op["enable"] = self.original_op["enable"]
|
550
|
+
self.op["type"] = self.original_op["type"]
|
551
|
+
self.op["values"].clear()
|
552
|
+
self.op["values"].extend(self.original_op["values"])
|
553
|
+
self.context.elements.do_image_update(self.node, self.context)
|
554
|
+
self.on_update_tone()
|
555
|
+
self.update_in_gui_thread()
|
556
|
+
|
557
|
+
|
558
|
+
class SharpenPanel(wx.Panel):
|
559
|
+
name = _("Sharpen")
|
560
|
+
|
561
|
+
@staticmethod
|
562
|
+
def priority(node):
|
563
|
+
base_priority = 20
|
564
|
+
prop = "unsharp_mask"
|
565
|
+
if hasattr(node, "as_image"):
|
566
|
+
for idx, n in enumerate(node.operations):
|
567
|
+
if n.get("name") == prop:
|
568
|
+
return base_priority + idx + 1
|
569
|
+
return base_priority
|
570
|
+
|
571
|
+
@staticmethod
|
572
|
+
def accepts(node):
|
573
|
+
if not hasattr(node, "as_image"):
|
574
|
+
return False
|
575
|
+
if node.operations is None:
|
576
|
+
node.operations = list()
|
577
|
+
for n in node.operations:
|
578
|
+
if n.get("name") == "unsharp_mask":
|
579
|
+
return True
|
580
|
+
return False
|
581
|
+
|
582
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
583
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
584
|
+
wx.Panel.__init__(self, *args, **kwds)
|
585
|
+
self.context = context
|
586
|
+
self.context.themes.set_window_colors(self)
|
587
|
+
self.node = node
|
588
|
+
|
589
|
+
self.check_enable_sharpen = wxCheckBox(self, wx.ID_ANY, _("Enable"))
|
590
|
+
self.button_reset_sharpen = wxButton(self, wx.ID_ANY, _("Reset"))
|
591
|
+
self.slider_sharpen_percent = wx.Slider(
|
592
|
+
self, wx.ID_ANY, 500, 0, 1000, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
593
|
+
)
|
594
|
+
self.text_sharpen_percent = TextCtrl(
|
595
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
596
|
+
)
|
597
|
+
self.slider_sharpen_radius = wx.Slider(
|
598
|
+
self, wx.ID_ANY, 20, 0, 50, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
599
|
+
)
|
600
|
+
self.text_sharpen_radius = TextCtrl(
|
601
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
602
|
+
)
|
603
|
+
self.slider_sharpen_threshold = wx.Slider(
|
604
|
+
self, wx.ID_ANY, 6, 0, 50, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
605
|
+
)
|
606
|
+
self.text_sharpen_threshold = TextCtrl(
|
607
|
+
self, wx.ID_ANY, "", style=wx.TE_READONLY
|
608
|
+
)
|
609
|
+
|
610
|
+
self.__set_properties()
|
611
|
+
self.__do_layout()
|
612
|
+
|
613
|
+
self.Bind(
|
614
|
+
wx.EVT_CHECKBOX, self.on_check_enable_sharpen, self.check_enable_sharpen
|
615
|
+
)
|
616
|
+
self.Bind(
|
617
|
+
wx.EVT_BUTTON, self.on_button_reset_sharpen, self.button_reset_sharpen
|
618
|
+
)
|
619
|
+
self.Bind(
|
620
|
+
wx.EVT_SLIDER, self.on_slider_sharpen_percent, self.slider_sharpen_percent
|
621
|
+
)
|
622
|
+
self.Bind(wx.EVT_TEXT, self.on_text_sharpen_percent, self.text_sharpen_percent)
|
623
|
+
self.Bind(
|
624
|
+
wx.EVT_SLIDER, self.on_slider_sharpen_radius, self.slider_sharpen_radius
|
625
|
+
)
|
626
|
+
self.Bind(wx.EVT_TEXT, self.on_text_sharpen_radius, self.text_sharpen_radius)
|
627
|
+
self.Bind(
|
628
|
+
wx.EVT_SLIDER,
|
629
|
+
self.on_slider_sharpen_threshold,
|
630
|
+
self.slider_sharpen_threshold,
|
631
|
+
)
|
632
|
+
self.Bind(
|
633
|
+
wx.EVT_TEXT, self.on_text_sharpen_threshold, self.text_sharpen_threshold
|
634
|
+
)
|
635
|
+
# end wxGlade
|
636
|
+
|
637
|
+
op = None
|
638
|
+
for n in node.operations:
|
639
|
+
if n.get("name") == "unsharp_mask":
|
640
|
+
op = n
|
641
|
+
if op is None:
|
642
|
+
raise ValueError
|
643
|
+
self.op = op
|
644
|
+
self.original_op = deepcopy(op)
|
645
|
+
self.check_enable_sharpen.SetValue(op["enable"])
|
646
|
+
self.slider_sharpen_percent.SetValue(int(op["percent"]))
|
647
|
+
self.slider_sharpen_radius.SetValue(int(op["radius"]))
|
648
|
+
self.slider_sharpen_threshold.SetValue(int(op["threshold"]))
|
649
|
+
self.text_sharpen_percent.SetValue(str(op["percent"]))
|
650
|
+
self.text_sharpen_radius.SetValue(str(op["radius"]))
|
651
|
+
self.text_sharpen_threshold.SetValue(str(op["threshold"]))
|
652
|
+
|
653
|
+
def __set_properties(self):
|
654
|
+
# begin wxGlade: SharpenPanel.__set_properties
|
655
|
+
self.check_enable_sharpen.SetToolTip(_("Enable Sharpen"))
|
656
|
+
self.check_enable_sharpen.SetValue(1)
|
657
|
+
self.button_reset_sharpen.SetToolTip(_("Sharpen Reset"))
|
658
|
+
self.slider_sharpen_percent.SetToolTip(_("Strength of sharpening in percent"))
|
659
|
+
self.text_sharpen_percent.SetToolTip(_("amount of sharpening in %"))
|
660
|
+
self.slider_sharpen_radius.SetToolTip(
|
661
|
+
_("Blur radius for the sharpening operation")
|
662
|
+
)
|
663
|
+
self.text_sharpen_radius.SetToolTip(_("Sharpen radius amount"))
|
664
|
+
self.slider_sharpen_threshold.SetToolTip(
|
665
|
+
_("Threshold controls the minimum brighteness change to be sharpened.")
|
666
|
+
)
|
667
|
+
self.text_sharpen_threshold.SetToolTip(_("Sharpen Threshold Amount"))
|
668
|
+
# end wxGlade
|
669
|
+
|
670
|
+
def __do_layout(self):
|
671
|
+
# begin wxGlade: SharpenPanel.__do_layout
|
672
|
+
sizer_sharpen = StaticBoxSizer(self, wx.ID_ANY, _("Sharpen"), wx.VERTICAL)
|
673
|
+
sizer_sharpen_threshold = StaticBoxSizer(
|
674
|
+
self, wx.ID_ANY, _("Threshold"), wx.HORIZONTAL
|
675
|
+
)
|
676
|
+
sizer_sharpen_radius = StaticBoxSizer(
|
677
|
+
self, wx.ID_ANY, _("Radius"), wx.HORIZONTAL
|
678
|
+
)
|
679
|
+
sizer_sharpen_percent = StaticBoxSizer(
|
680
|
+
self, wx.ID_ANY, _("Percent"), wx.HORIZONTAL
|
681
|
+
)
|
682
|
+
sizer_sharpen_main = wx.BoxSizer(wx.HORIZONTAL)
|
683
|
+
sizer_sharpen_main.Add(self.check_enable_sharpen, 0, 0, 0)
|
684
|
+
sizer_sharpen_main.Add(self.button_reset_sharpen, 0, 0, 0)
|
685
|
+
sizer_sharpen.Add(sizer_sharpen_main, 0, wx.EXPAND, 0)
|
686
|
+
sizer_sharpen_percent.Add(self.slider_sharpen_percent, 5, wx.EXPAND, 0)
|
687
|
+
sizer_sharpen_percent.Add(self.text_sharpen_percent, 1, 0, 0)
|
688
|
+
sizer_sharpen.Add(sizer_sharpen_percent, 0, wx.EXPAND, 0)
|
689
|
+
sizer_sharpen_radius.Add(self.slider_sharpen_radius, 5, wx.EXPAND, 0)
|
690
|
+
sizer_sharpen_radius.Add(self.text_sharpen_radius, 1, 0, 0)
|
691
|
+
sizer_sharpen.Add(sizer_sharpen_radius, 0, wx.EXPAND, 0)
|
692
|
+
sizer_sharpen_threshold.Add(self.slider_sharpen_threshold, 5, wx.EXPAND, 0)
|
693
|
+
sizer_sharpen_threshold.Add(self.text_sharpen_threshold, 1, 0, 0)
|
694
|
+
sizer_sharpen.Add(sizer_sharpen_threshold, 0, wx.EXPAND, 0)
|
695
|
+
self.SetSizer(sizer_sharpen)
|
696
|
+
sizer_sharpen.Fit(self)
|
697
|
+
self.Layout()
|
698
|
+
# end wxGlade
|
699
|
+
|
700
|
+
def on_check_enable_sharpen(
|
701
|
+
self, event=None
|
702
|
+
): # wxGlade: RasterWizard.<event_handler>
|
703
|
+
self.op["enable"] = self.check_enable_sharpen.GetValue()
|
704
|
+
self.context.elements.do_image_update(self.node, self.context)
|
705
|
+
|
706
|
+
def on_button_reset_sharpen(
|
707
|
+
self, event=None
|
708
|
+
): # wxGlade: RasterWizard.<event_handler>
|
709
|
+
self.op["percent"] = self.original_op["percent"]
|
710
|
+
self.op["radius"] = self.original_op["radius"]
|
711
|
+
self.op["threshold"] = self.original_op["threshold"]
|
712
|
+
self.slider_sharpen_percent.SetValue(int(self.op["percent"]))
|
713
|
+
self.slider_sharpen_radius.SetValue(int(self.op["radius"]))
|
714
|
+
self.slider_sharpen_threshold.SetValue(int(self.op["threshold"]))
|
715
|
+
self.text_sharpen_percent.SetValue(str(self.op["percent"]))
|
716
|
+
self.text_sharpen_radius.SetValue(str(self.op["radius"]))
|
717
|
+
self.text_sharpen_threshold.SetValue(str(self.op["threshold"]))
|
718
|
+
self.context.elements.do_image_update(self.node, self.context)
|
719
|
+
|
720
|
+
def on_slider_sharpen_percent(
|
721
|
+
self, event=None
|
722
|
+
): # wxGlade: RasterWizard.<event_handler>
|
723
|
+
self.op["percent"] = int(self.slider_sharpen_percent.GetValue())
|
724
|
+
self.text_sharpen_percent.SetValue(str(self.op["percent"]))
|
725
|
+
self.context.elements.do_image_update(self.node, self.context)
|
726
|
+
|
727
|
+
def on_text_sharpen_percent(
|
728
|
+
self, event=None
|
729
|
+
): # wxGlade: RasterWizard.<event_handler>
|
730
|
+
pass
|
731
|
+
|
732
|
+
def on_slider_sharpen_radius(self, event): # wxGlade: RasterWizard.<event_handler>
|
733
|
+
self.op["radius"] = int(self.slider_sharpen_radius.GetValue())
|
734
|
+
self.text_sharpen_radius.SetValue(str(self.op["radius"]))
|
735
|
+
self.context.elements.do_image_update(self.node, self.context)
|
736
|
+
|
737
|
+
def on_text_sharpen_radius(
|
738
|
+
self, event=None
|
739
|
+
): # wxGlade: RasterWizard.<event_handler>
|
740
|
+
pass
|
741
|
+
|
742
|
+
def on_slider_sharpen_threshold(
|
743
|
+
self, event=None
|
744
|
+
): # wxGlade: RasterWizard.<event_handler>
|
745
|
+
self.op["threshold"] = int(self.slider_sharpen_threshold.GetValue())
|
746
|
+
self.text_sharpen_threshold.SetValue(str(self.op["threshold"]))
|
747
|
+
self.context.elements.do_image_update(self.node, self.context)
|
748
|
+
|
749
|
+
def on_text_sharpen_threshold(self, event): # wxGlade: RasterWizard.<event_handler>
|
750
|
+
pass
|
751
|
+
|
752
|
+
|
753
|
+
class GammaPanel(wx.Panel):
|
754
|
+
name = _("Gamma")
|
755
|
+
|
756
|
+
@staticmethod
|
757
|
+
def priority(node):
|
758
|
+
base_priority = 20
|
759
|
+
prop = "gamma"
|
760
|
+
if hasattr(node, "as_image"):
|
761
|
+
for idx, n in enumerate(node.operations):
|
762
|
+
if n.get("name") == prop:
|
763
|
+
return base_priority + idx + 1
|
764
|
+
return base_priority
|
765
|
+
|
766
|
+
@staticmethod
|
767
|
+
def accepts(node):
|
768
|
+
if not hasattr(node, "as_image"):
|
769
|
+
return False
|
770
|
+
for n in node.operations:
|
771
|
+
if n.get("name") == "gamma":
|
772
|
+
return True
|
773
|
+
return False
|
774
|
+
|
775
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
776
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
777
|
+
wx.Panel.__init__(self, *args, **kwds)
|
778
|
+
self.context = context
|
779
|
+
self.context.themes.set_window_colors(self)
|
780
|
+
self.node = node
|
781
|
+
|
782
|
+
self.check_enable_gamma = wxCheckBox(self, wx.ID_ANY, _("Enable"))
|
783
|
+
self.button_reset_gamma = wxButton(self, wx.ID_ANY, _("Reset"))
|
784
|
+
self.slider_gamma_factor = wx.Slider(
|
785
|
+
self, wx.ID_ANY, 100, 0, 500, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
|
786
|
+
)
|
787
|
+
self.text_gamma_factor = TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
|
788
|
+
|
789
|
+
self.__set_properties()
|
790
|
+
self.__do_layout()
|
791
|
+
|
792
|
+
self.Bind(wx.EVT_CHECKBOX, self.on_check_enable_gamma, self.check_enable_gamma)
|
793
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_reset_gamma, self.button_reset_gamma)
|
794
|
+
self.Bind(wx.EVT_SLIDER, self.on_slider_gamma_factor, self.slider_gamma_factor)
|
795
|
+
self.Bind(wx.EVT_TEXT, self.on_text_gamma_factor, self.text_gamma_factor)
|
796
|
+
# end wxGlade
|
797
|
+
self.last_x = None
|
798
|
+
|
799
|
+
op = None
|
800
|
+
for n in node.operations:
|
801
|
+
if n.get("name") == "gamma":
|
802
|
+
op = n
|
803
|
+
if op is None:
|
804
|
+
raise ValueError
|
805
|
+
self.op = op
|
806
|
+
self.original_op = deepcopy(op)
|
807
|
+
self.text_gamma_factor.SetValue(str(op["factor"]))
|
808
|
+
self.slider_gamma_factor.SetValue(int(op["factor"] * 100.0))
|
809
|
+
self.check_enable_gamma.SetValue(op["enable"])
|
810
|
+
|
811
|
+
def __set_properties(self):
|
812
|
+
# begin wxGlade: GammaPanel.__set_properties
|
813
|
+
self.check_enable_gamma.SetToolTip(_("Enable Gamma Shift"))
|
814
|
+
self.check_enable_gamma.SetValue(1)
|
815
|
+
self.button_reset_gamma.SetToolTip(_("Reset Gamma Shift"))
|
816
|
+
self.slider_gamma_factor.SetToolTip(_("Gamma factor slider"))
|
817
|
+
self.text_gamma_factor.SetToolTip(_("Amount of gamma factor"))
|
818
|
+
# end wxGlade
|
819
|
+
|
820
|
+
def __do_layout(self):
|
821
|
+
# begin wxGlade: GammaPanel.__do_layout
|
822
|
+
sizer_gamma = StaticBoxSizer(self, wx.ID_ANY, _("Gamma"), wx.VERTICAL)
|
823
|
+
sizer_gamma_factor = StaticBoxSizer(
|
824
|
+
self, wx.ID_ANY, _("Gamma Factor"), wx.HORIZONTAL
|
825
|
+
)
|
826
|
+
sizer_gamma_main = wx.BoxSizer(wx.HORIZONTAL)
|
827
|
+
sizer_gamma_main.Add(self.check_enable_gamma, 0, 0, 0)
|
828
|
+
sizer_gamma_main.Add(self.button_reset_gamma, 0, 0, 0)
|
829
|
+
sizer_gamma.Add(sizer_gamma_main, 0, wx.EXPAND, 0)
|
830
|
+
sizer_gamma_factor.Add(self.slider_gamma_factor, 5, wx.EXPAND, 0)
|
831
|
+
sizer_gamma_factor.Add(self.text_gamma_factor, 1, 0, 0)
|
832
|
+
sizer_gamma.Add(sizer_gamma_factor, 0, wx.EXPAND, 0)
|
833
|
+
self.SetSizer(sizer_gamma)
|
834
|
+
sizer_gamma.Fit(self)
|
835
|
+
self.Layout()
|
836
|
+
# end wxGlade
|
837
|
+
|
838
|
+
def on_check_enable_gamma(
|
839
|
+
self, event=None
|
840
|
+
): # wxGlade: RasterWizard.<event_handler>
|
841
|
+
self.op["enable"] = self.check_enable_gamma.GetValue()
|
842
|
+
self.context.elements.do_image_update(self.node, self.context)
|
843
|
+
|
844
|
+
def on_button_reset_gamma(
|
845
|
+
self, event=None
|
846
|
+
): # wxGlade: RasterWizard.<event_handler>
|
847
|
+
self.op["factor"] = self.original_op["factor"]
|
848
|
+
self.slider_gamma_factor.SetValue(int(self.op["factor"] * 100.0))
|
849
|
+
self.text_gamma_factor.SetValue(str(self.op["factor"]))
|
850
|
+
self.context.elements.do_image_update(self.node, self.context)
|
851
|
+
|
852
|
+
def on_slider_gamma_factor(
|
853
|
+
self, event=None
|
854
|
+
): # wxGlade: RasterWizard.<event_handler>
|
855
|
+
self.op["factor"] = self.slider_gamma_factor.GetValue() / 100.0
|
856
|
+
self.text_gamma_factor.SetValue(str(self.op["factor"]))
|
857
|
+
self.context.elements.do_image_update(self.node, self.context)
|
858
|
+
|
859
|
+
def on_text_gamma_factor(self, event=None): # wxGlade: RasterWizard.<event_handler>
|
860
|
+
pass
|
861
|
+
|
862
|
+
|
863
|
+
class EdgePanel(wx.Panel):
|
864
|
+
name = _("Edge Enhance")
|
865
|
+
|
866
|
+
@staticmethod
|
867
|
+
def priority(node):
|
868
|
+
base_priority = 20
|
869
|
+
prop = "edge_enhance"
|
870
|
+
if hasattr(node, "as_image"):
|
871
|
+
for idx, n in enumerate(node.operations):
|
872
|
+
if n.get("name") == prop:
|
873
|
+
return base_priority + idx + 1
|
874
|
+
return base_priority
|
875
|
+
|
876
|
+
@staticmethod
|
877
|
+
def accepts(node):
|
878
|
+
if not hasattr(node, "as_image"):
|
879
|
+
return False
|
880
|
+
for n in node.operations:
|
881
|
+
if n.get("name") == "edge_enhance":
|
882
|
+
return True
|
883
|
+
return False
|
884
|
+
|
885
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
886
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
887
|
+
wx.Panel.__init__(self, *args, **kwds)
|
888
|
+
self.context = context
|
889
|
+
self.context.themes.set_window_colors(self)
|
890
|
+
self.node = node
|
891
|
+
|
892
|
+
self.check_enable = wxCheckBox(self, wx.ID_ANY, _("Enable"))
|
893
|
+
|
894
|
+
self.__set_properties()
|
895
|
+
self.__do_layout()
|
896
|
+
|
897
|
+
self.Bind(wx.EVT_CHECKBOX, self.on_check_enable, self.check_enable)
|
898
|
+
# end wxGlade
|
899
|
+
|
900
|
+
op = None
|
901
|
+
for n in node.operations:
|
902
|
+
if n.get("name") == "edge_enhance":
|
903
|
+
op = n
|
904
|
+
if op is None:
|
905
|
+
raise ValueError
|
906
|
+
self.op = op
|
907
|
+
self.original_op = deepcopy(op)
|
908
|
+
self.check_enable.SetLabel(_("Enable {name}").format(name=op["name"]))
|
909
|
+
self.check_enable.SetValue(op["enable"])
|
910
|
+
|
911
|
+
def __set_properties(self):
|
912
|
+
# begin wxGlade: OutputPanel.__set_properties
|
913
|
+
self.check_enable.SetToolTip(_("Enable Operation"))
|
914
|
+
self.check_enable.SetValue(1)
|
915
|
+
# end wxGlade
|
916
|
+
|
917
|
+
def __do_layout(self):
|
918
|
+
# begin wxGlade: OutputPanel.__do_layout
|
919
|
+
sizer_output = StaticBoxSizer(self, wx.ID_ANY, _("Enable"), wx.VERTICAL)
|
920
|
+
sizer_output.Add(self.check_enable, 0, 0, 0)
|
921
|
+
self.SetSizer(sizer_output)
|
922
|
+
sizer_output.Fit(self)
|
923
|
+
self.Layout()
|
924
|
+
# end wxGlade
|
925
|
+
|
926
|
+
def on_check_enable(self, event=None):
|
927
|
+
self.op["enable"] = self.check_enable.GetValue()
|
928
|
+
self.context.elements.do_image_update(self.node, self.context)
|
929
|
+
|
930
|
+
|
931
|
+
class AutoContrastPanel(wx.Panel):
|
932
|
+
name = _("Auto Contrast")
|
933
|
+
@staticmethod
|
934
|
+
|
935
|
+
def priority(node):
|
936
|
+
base_priority = 20
|
937
|
+
prop = "auto_contrast"
|
938
|
+
if hasattr(node, "as_image"):
|
939
|
+
for idx, n in enumerate(node.operations):
|
940
|
+
if n.get("name") == prop:
|
941
|
+
return base_priority + idx + 1
|
942
|
+
return base_priority
|
943
|
+
|
944
|
+
@staticmethod
|
945
|
+
def accepts(node):
|
946
|
+
if not hasattr(node, "as_image"):
|
947
|
+
return False
|
948
|
+
for n in node.operations:
|
949
|
+
if n.get("name") == "auto_contrast":
|
950
|
+
return True
|
951
|
+
return False
|
952
|
+
|
953
|
+
def __init__(self, *args, context=None, node=None, **kwds):
|
954
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
955
|
+
wx.Panel.__init__(self, *args, **kwds)
|
956
|
+
self.context = context
|
957
|
+
self.context.themes.set_window_colors(self)
|
958
|
+
self.node = node
|
959
|
+
|
960
|
+
self.check_enable = wxCheckBox(self, wx.ID_ANY, _("Enable"))
|
961
|
+
|
962
|
+
self.__set_properties()
|
963
|
+
self.__do_layout()
|
964
|
+
|
965
|
+
self.Bind(wx.EVT_CHECKBOX, self.on_check_enable, self.check_enable)
|
966
|
+
# end wxGlade
|
967
|
+
|
968
|
+
op = None
|
969
|
+
for n in node.operations:
|
970
|
+
if n.get("name") == "auto_contrast":
|
971
|
+
op = n
|
972
|
+
if op is None:
|
973
|
+
raise ValueError
|
974
|
+
self.op = op
|
975
|
+
self.original_op = deepcopy(op)
|
976
|
+
self.check_enable.SetLabel(_("Enable {name}").format(name=op["name"]))
|
977
|
+
self.check_enable.SetValue(op["enable"])
|
978
|
+
|
979
|
+
def __set_properties(self):
|
980
|
+
# begin wxGlade: OutputPanel.__set_properties
|
981
|
+
self.check_enable.SetToolTip(_("Enable Operation"))
|
982
|
+
self.check_enable.SetValue(1)
|
983
|
+
# end wxGlade
|
984
|
+
|
985
|
+
def __do_layout(self):
|
986
|
+
# begin wxGlade: OutputPanel.__do_layout
|
987
|
+
sizer_output = StaticBoxSizer(self, wx.ID_ANY, _("Enable"), wx.VERTICAL)
|
988
|
+
sizer_output.Add(self.check_enable, 0, 0, 0)
|
989
|
+
self.SetSizer(sizer_output)
|
990
|
+
sizer_output.Fit(self)
|
991
|
+
self.Layout()
|
992
|
+
# end wxGlade
|
993
|
+
|
994
|
+
def on_check_enable(self, event=None):
|
995
|
+
self.op["enable"] = self.check_enable.GetValue()
|
996
|
+
self.context.elements.do_image_update(self.node, self.context)
|