stretchdialog

Module that contains the StretchLayout, RuleLayout and StretchDefaultsDialog classes

class tuiview.stretchdialog.ColorButton(*args: Any, **kwargs: Any)[source]

Class that is a button with a icon that displays the current color. Clicking the button allows user to change color

getColorAsRGBATuple()[source]

return the current color

mouseReleaseEvent(event)[source]

Handle event - show dialog to allow color to be changed

setColor(color)[source]

Create icon and set color

setColorAsRGBATuple(rgbatuple)[source]

set the color as RGBA

class tuiview.stretchdialog.RuleLayout(*args: Any, **kwargs: Any)[source]

Layout that contains the ‘rules’. These are the number of bands, the comparison with the number of bands and the check for a color table

getRule()[source]

Return a StretchRule instance for the current GUI settings Note: the stretch field will be None

class tuiview.stretchdialog.StretchDefaultsDialog(*args: Any, **kwargs: Any)[source]

Dialog that contains a Tabs, each one describing a rule and is a combination of RuleLayout and StretchLayout

createWidget(rule, stretch)[source]

create a widget that contains the rule/stretch

static fromSettings()[source]

Read the default stretch rules from the settings and return a list of StretchRules. Supplies a default set of rules if none found.

onDelete()[source]

Delete the current page.

onNewAfter()[source]

The ‘add new page after’ button pressed. Add a new page in with the rule/stretch same as current page

onNewBefore()[source]

The ‘add new page before’ button pressed. Add a new page in with the rule/stretch same as current page

onOK()[source]

OK button pressed. Save settings

renumberTabs()[source]

A tab has been added or deleted so renumber the tabs

toSettings()[source]

Write the contents of the dialog as the default rules to be remembered for next time.

class tuiview.stretchdialog.StretchDockWidget(*args: Any, **kwargs: Any)[source]

Class that has a StretchLayout as a dockable window with apply and save buttons

exportToText()[source]

Export stretch and Lookup Table to JSON text

importFromGDAL()[source]

Import stretch and lookup table from file where these have already been saved

importFromText()[source]

Import stretch and lookup table from text file saved by exportToText()

onApply()[source]

Apply the new stretch to the view widget

onApplyAll()[source]

The function to be run when the ApplyAll button is clicked (applies a stretch to all files open in tuiview.

onDelete()[source]

Delete any stretch/LUT from the file

onLayersChanged()[source]

Called when the layers have changed. If the one we ‘belong’ to no longer exists then close this window

onSave()[source]

User wants to save the stretch to the file

setupActions()[source]

Create the actions to be shown on the toolbar

setupToolbar()[source]

Add the actions to the toolbar

class tuiview.stretchdialog.StretchLayout(*args: Any, **kwargs: Any)[source]

Layout that contains the actual stretch information

createComboBands(gdaldataset, parent)[source]

We have a dataset - create combo boxes with the band names

createSpinBands(parent)[source]

For the case where we are creating a rule we have no band names so create spin boxes

static getBandValue(widget)[source]

Depending on whether widget it a spinbox or a combo box extract the current value for it.

getStretch()[source]

Return a ViewerStretch object that reflects the current state of the GUI

modeChanged(index)[source]

Called when user changed the mode. Updates other GUI elements as needed

param1StatsChanged(state)[source]

Called when the ‘Statistics Min’ box is checked

param2StatsChanged(state)[source]

Called when the ‘Statistics Max’ box is checked

populateComboFromDataset(combo, gdaldataset)[source]

Go through all the bands in the dataset and add a combo item for each one. Set the current index to the currentBand

stretchChanged(index)[source]

Called when user changed the stretch. Updates other GUI elements as needed

updateStretch(stretch)[source]

Change the state of the GUI to match the given stretch