shinestacker 1.5.0__py3-none-any.whl → 1.5.2__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.

Potentially problematic release.


This version of shinestacker might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- # pylint: disable=C0114, C0115, C0116, E0611, W0221, R0902
1
+ # pylint: disable=C0114, C0115, C0116, E0611, W0221, R0902, R0913, R0917
2
2
  from PySide6.QtCore import Qt
3
3
  from PySide6.QtWidgets import QSpinBox, QCheckBox, QLabel, QHBoxLayout, QSlider, QComboBox
4
4
  from .. config.constants import constants
@@ -7,8 +7,9 @@ from .base_filter import OneSliderBaseFilter
7
7
 
8
8
 
9
9
  class VignettingFilter(OneSliderBaseFilter):
10
- def __init__(self, name, editor):
11
- super().__init__(name, editor, 1.0, 0.90, "Vignetting correction",
10
+ def __init__(self, name, parent, image_viewer, layer_collection, undo_manager):
11
+ super().__init__(name, parent, image_viewer, layer_collection, undo_manager,
12
+ 1.0, 0.90, "Vignetting correction",
12
13
  allow_partial_preview=False, preview_at_startup=False)
13
14
  self.subsample_box = None
14
15
  self.fast_subsampling_check = None
@@ -1,4 +1,5 @@
1
1
  # pylint: disable=C0114, C0115, C0116, E0611, W0221, R0913, R0914, R0917, R0902
2
+ import numpy as np
2
3
  from PySide6.QtWidgets import (QHBoxLayout, QPushButton, QFrame, QVBoxLayout, QLabel, QDialog,
3
4
  QApplication, QSlider, QDialogButtonBox, QLineEdit)
4
5
  from PySide6.QtCore import Qt, QTimer
@@ -8,8 +9,9 @@ from .base_filter import BaseFilter
8
9
 
9
10
 
10
11
  class WhiteBalanceFilter(BaseFilter):
11
- def __init__(self, name, editor):
12
- super().__init__(name, editor, preview_at_startup=True)
12
+ def __init__(self, name, parent, image_viewer, layer_collection, undo_manager):
13
+ super().__init__(name, parent, image_viewer, layer_collection, undo_manager,
14
+ preview_at_startup=True)
13
15
  self.max_range = 255
14
16
  self.initial_val = (128, 128, 128)
15
17
  self.sliders = {}
@@ -18,6 +20,7 @@ class WhiteBalanceFilter(BaseFilter):
18
20
  self.color_preview = None
19
21
  self.preview_timer = None
20
22
  self.original_mouse_press = None
23
+ self.original_cursor_style = None
21
24
 
22
25
  def setup_ui(self, dlg, layout, do_preview, restore_original, init_val=None):
23
26
  if init_val:
@@ -65,7 +68,7 @@ class WhiteBalanceFilter(BaseFilter):
65
68
  for slider in self.sliders.values():
66
69
  slider.valueChanged.connect(self.on_slider_change)
67
70
  self.preview_timer.timeout.connect(do_preview)
68
- self.editor.connect_preview_toggle(self.preview_check, do_preview, restore_original)
71
+ self.connect_preview_toggle(self.preview_check, do_preview, restore_original)
69
72
  pick_button.clicked.connect(self.start_color_pick)
70
73
  self.button_box.accepted.connect(dlg.accept)
71
74
  self.button_box.rejected.connect(dlg.reject)
@@ -107,27 +110,33 @@ class WhiteBalanceFilter(BaseFilter):
107
110
  widget.hide()
108
111
  widget.reject()
109
112
  break
110
- self.editor.image_viewer.set_cursor_style('outline')
111
- if self.editor.image_viewer.brush_cursor:
112
- self.editor.image_viewer.brush_cursor.hide()
113
- self.editor.brush_preview.hide()
113
+ self.original_cursor_style = self.image_viewer.get_cursor_style()
114
+ self.image_viewer.set_cursor_style('outline')
115
+ self.image_viewer.hide_brush_cursor()
116
+ self.image_viewer.hide_brush_preview()
114
117
  QApplication.setOverrideCursor(QCursor(Qt.CrossCursor))
115
- self.editor.image_viewer.setCursor(Qt.CrossCursor)
116
- self.original_mouse_press = self.editor.image_viewer.mousePressEvent
117
- self.editor.image_viewer.mousePressEvent = self.pick_color_from_click
118
+ self.image_viewer.strategy.setCursor(Qt.CrossCursor)
119
+ self.original_mouse_press = self.image_viewer.strategy.get_mouse_callbacks()
120
+ self.image_viewer.strategy.set_mouse_callbacks(self.pick_color_from_click)
121
+ self.filter_gui_set_enabled_requested.emit(False)
118
122
 
119
123
  def pick_color_from_click(self, event):
120
124
  if event.button() == Qt.LeftButton:
121
125
  pos = event.pos()
122
- bgr = self.editor.get_pixel_color_at(pos, radius=int(self.editor.brush.size))
126
+ bgr = self.get_pixel_color_at(
127
+ pos, radius=int(self.image_viewer.get_brush().size))
123
128
  rgb = (bgr[2], bgr[1], bgr[0])
124
- QApplication.restoreOverrideCursor()
125
- self.editor.image_viewer.unsetCursor()
126
- self.editor.image_viewer.mousePressEvent = self.original_mouse_press
127
- self.editor.image_viewer.brush_cursor.show()
128
- self.editor.brush_preview.show()
129
- new_filter = WhiteBalanceFilter(self.name, self.editor)
129
+ new_filter = WhiteBalanceFilter(
130
+ self.name, self.parent(), self.image_viewer, self.layer_collection,
131
+ self.undo_manager)
130
132
  new_filter.run_with_preview(init_val=rgb)
133
+ QApplication.restoreOverrideCursor()
134
+ self.image_viewer.unsetCursor()
135
+ self.image_viewer.strategy.set_mouse_callbacks(self.original_mouse_press)
136
+ self.image_viewer.set_cursor_style(self.original_cursor_style)
137
+ self.image_viewer.show_brush_cursor()
138
+ self.image_viewer.show_brush_preview()
139
+ self.filter_gui_set_enabled_requested.emit(True)
131
140
 
132
141
  def reset_rgb(self):
133
142
  for name, slider in self.sliders.items():
@@ -138,3 +147,39 @@ class WhiteBalanceFilter(BaseFilter):
138
147
 
139
148
  def apply(self, image, r, g, b):
140
149
  return white_balance_from_rgb(image, (r, g, b))
150
+
151
+ def get_pixel_color_at(self, pos, radius=None):
152
+ item_pos = self.image_viewer.strategy.position_on_image(pos)
153
+ x = int(item_pos.x())
154
+ y = int(item_pos.y())
155
+ master_layer = self.master_layer()
156
+ if (0 <= x < self.master_layer().shape[1]) and \
157
+ (0 <= y < self.master_layer().shape[0]):
158
+ if radius is None:
159
+ radius = int(self.brush.size)
160
+ if radius > 0:
161
+ y_indices, x_indices = np.ogrid[-radius:radius + 1, -radius:radius + 1]
162
+ mask = x_indices**2 + y_indices**2 <= radius**2
163
+ x0 = max(0, x - radius)
164
+ x1 = min(master_layer.shape[1], x + radius + 1)
165
+ y0 = max(0, y - radius)
166
+ y1 = min(master_layer.shape[0], y + radius + 1)
167
+ mask = mask[radius - (y - y0): radius + (y1 - y),
168
+ radius - (x - x0): radius + (x1 - x)]
169
+ region = master_layer[y0:y1, x0:x1]
170
+ if region.size == 0:
171
+ pixel = master_layer[y, x]
172
+ else:
173
+ if region.ndim == 3:
174
+ pixel = [region[:, :, c][mask].mean() for c in range(region.shape[2])]
175
+ else:
176
+ pixel = region[mask].mean()
177
+ else:
178
+ pixel = self.master_layer()[y, x]
179
+ if np.isscalar(pixel):
180
+ pixel = [pixel, pixel, pixel]
181
+ pixel = [np.float32(x) for x in pixel]
182
+ if master_layer.dtype == np.uint16:
183
+ pixel = [x / 256.0 for x in pixel]
184
+ return tuple(int(v) for v in pixel)
185
+ return (0, 0, 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shinestacker
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: ShineStacker
5
5
  Author-email: Luca Lista <luka.lista@gmail.com>
6
6
  License-Expression: LGPL-3.0
@@ -1,5 +1,5 @@
1
1
  shinestacker/__init__.py,sha256=uq2fjAw2z_6TpH3mOcWFZ98GoEPRsNhTAK8N0MMm_e8,448
2
- shinestacker/_version.py,sha256=XyInpe-Rlf1hgwkiRXtR0uPYm4ZwRFpgchjcpZZ9Pms,21
2
+ shinestacker/_version.py,sha256=7jrl0OaiREGeLqi1Vco5z6ma0w6Mxq8kDBXuswywlc8,21
3
3
  shinestacker/algorithms/__init__.py,sha256=1FwVJ3w9GGbFFkjYJRUedTvcdE4j0ieSgaH9RC9iCY4,877
4
4
  shinestacker/algorithms/align.py,sha256=mb44u-YxZI1TTSHz81nRpX_2c8awlOhnGrK0LyfTQeQ,33543
5
5
  shinestacker/algorithms/align_auto.py,sha256=pJetw6zZEWQLouzcelkI8gD4cPiOp887ePXzVbm0E6Q,3800
@@ -22,16 +22,17 @@ shinestacker/algorithms/vignetting.py,sha256=gJOv-FN3GnTgaVn70W_6d-qbw3WmqinDiO9
22
22
  shinestacker/algorithms/white_balance.py,sha256=PMKsBtxOSn5aRr_Gkx1StHS4eN6kBN2EhNnhg4UG24g,501
23
23
  shinestacker/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  shinestacker/app/about_dialog.py,sha256=pkH7nnxUP8yc0D3vRGd1jRb5cwi1nDVbQRk_OC9yLk8,4144
25
+ shinestacker/app/args.py,sha256=TlfMR5GBd6Zz9wZNrN7CGJ1_hm1FnLZn5EoP5mkRHrk,776
25
26
  shinestacker/app/gui_utils.py,sha256=fSpkwPXTON_l676UHdAnJNrGq7BPbSlPOiHpOF_LZaI,2519
26
27
  shinestacker/app/help_menu.py,sha256=g8lKG_xZmXtNQaC3SIRzyROKVWva_PLEgZsQWh6zUcQ,499
27
- shinestacker/app/main.py,sha256=JRfobAg_stqk7FZbGWNQChfdQHRzMXqFzVXe1gOci_I,10459
28
+ shinestacker/app/main.py,sha256=dcitc5vwIIyIXeDfZwQnC7KHRCdd3FaVJWyaU8mK86c,10935
28
29
  shinestacker/app/open_frames.py,sha256=bsu32iJSYJQLe_tQQbvAU5DuMDVX6MRuNdE7B5lojZc,1488
29
- shinestacker/app/project.py,sha256=oopOiqU6bOK1cQdpot88z49KbKrlB-LAz_q4-8Iui0U,2819
30
- shinestacker/app/retouch.py,sha256=dpSozNWSxL6wIO0SMjoviDbXZbbfRN_rVLjeL324c54,2527
30
+ shinestacker/app/project.py,sha256=X98pK_mMtE_NefTUZfebEaP1YCsVY97hcQD4bSxuNyY,2777
31
+ shinestacker/app/retouch.py,sha256=wlk-tHaei5YAFinGZWyzBopUhUqyxMT6jSH-4DMEwo8,2659
31
32
  shinestacker/config/__init__.py,sha256=aXxi-LmAvXd0daIFrVnTHE5OCaYeK1uf1BKMr7oaXQs,197
32
33
  shinestacker/config/config.py,sha256=eBko2D3ADhLTIm9X6hB_a_WsIjwgfE-qmBVkhP1XSvc,1636
33
34
  shinestacker/config/constants.py,sha256=EEdr7pZg4JpbIjUWaP7kJQfTuBB85FN739myDNAfn8A,8301
34
- shinestacker/config/gui_constants.py,sha256=YigJ5pRKjzjQKAN-ulosS6zLfnTj2BQESvVIvqXNzjA,2786
35
+ shinestacker/config/gui_constants.py,sha256=Aqan-AdUjtlARXpsefQvWW2uKVv1tvwc0gfKyo7xud4,2787
35
36
  shinestacker/core/__init__.py,sha256=IUEIx6SQ3DygDEHN3_E6uKpHjHtUa4a_U_1dLd_8yEU,484
36
37
  shinestacker/core/colors.py,sha256=kr_tJA1iRsdck2JaYDb2lS-codZ4Ty9gdu3kHfiWvuM,1340
37
38
  shinestacker/core/core_utils.py,sha256=1LYj19Dfc9jZN9-4dlf1paximDH5WZYa7DXvKr7R7QY,1719
@@ -50,7 +51,7 @@ shinestacker/gui/gui_logging.py,sha256=kiZcrC2AFYCWgPZo0O5SKw-E5cFrezwf4anS3HjPu
50
51
  shinestacker/gui/gui_run.py,sha256=zr7x4BVmM0n_ZRsSEaJVVKvHSWHuwhftgkUvgeg90gU,15767
51
52
  shinestacker/gui/main_window.py,sha256=5k_9TiZT9idKCmovUFYpUTSEQQj-DMQrlyq9dAgY1MU,24800
52
53
  shinestacker/gui/menu_manager.py,sha256=b5Cxh6uddOlio8i7fRISbGDJI-oe0ds6LIF5dWM7leI,11263
53
- shinestacker/gui/new_project.py,sha256=VSUaq1xm9CR0gimKHRKfCdQOQ-ErE1sxGmu6x14nlAQ,16113
54
+ shinestacker/gui/new_project.py,sha256=z8e3EhRMB-KtoPwYQSiKLSOQ2dS0-Okm7zVw21B7zy8,16391
54
55
  shinestacker/gui/project_controller.py,sha256=W4sbBGEPVtfF9F1rC-6Y0oKLq_y94HuFBvZRj87xNKQ,16272
55
56
  shinestacker/gui/project_converter.py,sha256=Gmna0HwbvACcXiX74TaQYumif8ZV8sZ2APLTMM-L1mU,7436
56
57
  shinestacker/gui/project_editor.py,sha256=lSgQ42IoaobHs-NQQWT88Qhg5l7nu5ejxAO5VgIupr8,25498
@@ -70,35 +71,35 @@ shinestacker/gui/img/forward-button-icon.png,sha256=lNw86T4TOEd_uokHYF8myGSGUXzd
70
71
  shinestacker/gui/img/play-button-round-icon.png,sha256=9j6Ks9mOGa-2cXyRFpimepAAvSaHzqJKBfxShRb4_dE,4595
71
72
  shinestacker/gui/img/plus-round-line-icon.png,sha256=LS068Hlu-CeBvJuB3dwwdJg1lZq6D5MUIv53lu1yKJA,7534
72
73
  shinestacker/retouch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
- shinestacker/retouch/base_filter.py,sha256=gvRGvhOhhWS05jKOXyNdMnia3b7rscQqR8-xnySIWFc,10260
74
+ shinestacker/retouch/base_filter.py,sha256=zpedVvTpof8BsENWdDeu9PDul7Uw0UAXUSsyLZjbcpg,11265
74
75
  shinestacker/retouch/brush.py,sha256=dzD2FzSpBIPdJRmTZobcrQ1FrVd3tF__ZPnUplNE72s,357
75
76
  shinestacker/retouch/brush_gradient.py,sha256=F5SFhyzl8YTMqjJU3jK8BrIlLCYLUvITd5wz3cQE4xk,1453
76
- shinestacker/retouch/brush_preview.py,sha256=03x7Hh-5g4JEQgBCK5mGUtVDtiOnJPOdU1JgeUJhGaA,4945
77
+ shinestacker/retouch/brush_preview.py,sha256=cOFVMCbEsgR_alzmr_-LLghtGU_unrE-hAjLHcvrZAY,5484
77
78
  shinestacker/retouch/brush_tool.py,sha256=8uVncTA375uC3Nhp2YM0eZjpOR-nN47i2eGjN8tJzOU,8714
78
- shinestacker/retouch/denoise_filter.py,sha256=TDUHzhRKlKvCa3D5SCYCZKTpjcl81kGwmONsgSDtO1k,440
79
- shinestacker/retouch/display_manager.py,sha256=wwbX4n7ulg53fM3E5QL5YEb5IFV0jN8za6yfYc74anA,8624
79
+ shinestacker/retouch/denoise_filter.py,sha256=UpNKbFs7uArdglEej8AUHan7oCVYV5E7HNzkovj7XMQ,571
80
+ shinestacker/retouch/display_manager.py,sha256=vRmaSfHP47rYQrqvJ3flx_GgMJnMZDfQO4PXTfKcpqE,8505
80
81
  shinestacker/retouch/exif_data.py,sha256=LF-fRXW-reMq-xJ_QRE5j8DC2LVGKIlC6MR3QbC1cdg,1896
81
82
  shinestacker/retouch/file_loader.py,sha256=z02-A8_uDZxayI1NFTxT2GVUvEBWStchX9hlN1o5-0U,4784
82
- shinestacker/retouch/filter_manager.py,sha256=SdYIZkZBUvuB6wDG0moGWav5sfEvIcB9ioUJR5wJFts,388
83
+ shinestacker/retouch/filter_manager.py,sha256=tOGIWj5HjViL1-iXHkd91X-sZ1c1G531pDmLO0x6zx0,866
83
84
  shinestacker/retouch/icon_container.py,sha256=6gw1HO1bC2FrdB4dc_iH81DQuLjzuvRGksZ2hKLT9yA,585
84
- shinestacker/retouch/image_editor_ui.py,sha256=0EW-jnKrQz9Z_xLS51AltWul7lHst4fAvubiWNH-g2o,33456
85
+ shinestacker/retouch/image_editor_ui.py,sha256=wvsYmS7cXt61KJlv7b3X9EbymMLgdUfeEOzi8jEuR3g,31662
85
86
  shinestacker/retouch/image_view_status.py,sha256=bdIhsXiYXm7eyjkTGWkw5PRShzaF_by-g7daqgmhwjM,1858
86
- shinestacker/retouch/image_viewer.py,sha256=jkFVuBxWxoZqtaOS8N1R8iZ9WnyGfKGdczEdET2KTWU,4452
87
- shinestacker/retouch/io_gui_handler.py,sha256=Upt8VWwDUrB-UnqCI54SQQwfR4w9kfznCdRL2UwupWQ,12010
87
+ shinestacker/retouch/image_viewer.py,sha256=H8w-ORug1aKf7X3FeSX4lQV-a0IewZ9OVG1-50BK4cE,4452
88
+ shinestacker/retouch/io_gui_handler.py,sha256=BRQ5eSt1tCMDYtOqxfdYGhx2BLCrncfNrNLGuWIy5Rk,11873
88
89
  shinestacker/retouch/io_manager.py,sha256=JUAA--AK0mVa1PTErJTnBFjaXIle5Qs7Ow0Wkd8at0o,2437
89
90
  shinestacker/retouch/layer_collection.py,sha256=fZlGrkm9-Ycc7AOzFSpImhafiTieBeCZRk-UlvlFHbo,5819
90
- shinestacker/retouch/overlaid_view.py,sha256=NoFEwokTqbx41xnzYEHS0xhprHEAd2pRlH5NRAHxc2Y,7960
91
- shinestacker/retouch/shortcuts_help.py,sha256=EDxwR7MZwUC9NHLjvqAlh5iEHT9g3g8Tzl18VUGErI4,4130
92
- shinestacker/retouch/sidebyside_view.py,sha256=d9Pc2P_apTd0krsERIuEVc8RYBxiXs5tC7X9__t8TBc,18883
91
+ shinestacker/retouch/overlaid_view.py,sha256=uIMolD1984uQPWXpd27tMvGBTcSrYT-4vxO0pWVlEO4,8686
92
+ shinestacker/retouch/shortcuts_help.py,sha256=BFWTT5QvodqMhqa_9LI25hZqjICfckgyWG4fGrGzvnM,4283
93
+ shinestacker/retouch/sidebyside_view.py,sha256=dN5uDG0ioFvYcbmZbx97slh4cOLmJ2T14jtTshg5F9w,17918
93
94
  shinestacker/retouch/transformation_manager.py,sha256=NSHGUF-JFv4Y81gSvizjQCTp49TLo1so7c0WoUElO08,1812
94
95
  shinestacker/retouch/undo_manager.py,sha256=cKUkqnJtnJ-Hq-LQs5Bv49FC6qkG6XSw9oCVySJ8jS0,4312
95
- shinestacker/retouch/unsharp_mask_filter.py,sha256=uFnth8fpZFGhdIgJCnS8x5v6lBQgJ3hX0CBke9pFXeM,3510
96
- shinestacker/retouch/view_strategy.py,sha256=ex_bNym9pBXk9GDcpZr1vh4sJXx4ytrzavLRkHzeEXc,21234
97
- shinestacker/retouch/vignetting_filter.py,sha256=MA97rQkSL0D-Nh-n2L4AiPR064RoTROkvza4tw84g9U,3658
98
- shinestacker/retouch/white_balance_filter.py,sha256=glMBYlmrF-i_OrB3sGUpjZE6X4FQdyLC4GBy2bWtaFc,6056
99
- shinestacker-1.5.0.dist-info/licenses/LICENSE,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
100
- shinestacker-1.5.0.dist-info/METADATA,sha256=FXzUo0Sa94vwqOVxvbUHFIeRrjRvGgNMqnmUgooYcIY,6978
101
- shinestacker-1.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
- shinestacker-1.5.0.dist-info/entry_points.txt,sha256=SY6g1LqtMmp23q1DGwLUDT_dhLX9iss8DvWkiWLyo_4,166
103
- shinestacker-1.5.0.dist-info/top_level.txt,sha256=MhijwnBVX5psfsyX8JZjqp3SYiWPsKe69f3Gnyze4Fw,13
104
- shinestacker-1.5.0.dist-info/RECORD,,
96
+ shinestacker/retouch/unsharp_mask_filter.py,sha256=Iapc8UmSVpj3V0LcJq_38P5qerRqTevMynbbk5Rk6iE,3634
97
+ shinestacker/retouch/view_strategy.py,sha256=_Zo-SU2hlVVSv1g5eWgp72njcmfMpAlkkPggd89XJFo,23326
98
+ shinestacker/retouch/vignetting_filter.py,sha256=JhFr6OVIripQzSJrZEG4lxq7wBsmpofLqJQ-aP2bKw8,3789
99
+ shinestacker/retouch/white_balance_filter.py,sha256=QlMnzWmBYqUQqckY8XTH3dWPdqo7mz4gTwTZafxldPw,8237
100
+ shinestacker-1.5.2.dist-info/licenses/LICENSE,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
101
+ shinestacker-1.5.2.dist-info/METADATA,sha256=AuETmZdF7h5LSior9SUBcdWaiSmCxenl_9bECasvSLk,6978
102
+ shinestacker-1.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
103
+ shinestacker-1.5.2.dist-info/entry_points.txt,sha256=SY6g1LqtMmp23q1DGwLUDT_dhLX9iss8DvWkiWLyo_4,166
104
+ shinestacker-1.5.2.dist-info/top_level.txt,sha256=MhijwnBVX5psfsyX8JZjqp3SYiWPsKe69f3Gnyze4Fw,13
105
+ shinestacker-1.5.2.dist-info/RECORD,,