Affect area now affects the previews. (#320)

This commit is contained in:
Darshan Phaldesai 2020-08-26 16:59:49 +05:30 committed by GitHub
parent 719708fb10
commit 60c5ec9ad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 5 deletions

View file

@ -69,7 +69,11 @@ func _on_AButton_toggled(button_pressed : bool) -> void:
func update_preview() -> void:
preview_image.copy_from(current_cel)
match affect:
CEL:
preview_image.copy_from(current_cel)
_:
preview_image.copy_from(current_frame)
DrawingAlgos.desaturate_image(preview_image, pixels, red, green, blue, alpha)
preview_image.unlock()
preview_texture.create_from_image(preview_image, 0)

View file

@ -60,7 +60,11 @@ func _on_SelectionCheckBox_toggled(button_pressed : bool) -> void:
func update_preview() -> void:
preview_image.copy_from(current_cel)
match affect:
CEL:
preview_image.copy_from(current_cel)
_:
preview_image.copy_from(current_frame)
flip_image(preview_image, pixels)
preview_texture.create_from_image(preview_image, 0)
preview.texture = preview_texture

View file

@ -65,7 +65,11 @@ func reset() -> void:
func update_preview() -> void:
preview_image.copy_from(current_cel)
match affect:
CEL:
preview_image.copy_from(current_cel)
_:
preview_image.copy_from(current_frame)
DrawingAlgos.adjust_hsv(preview_image, hue_slider.value, sat_slider.value, val_slider.value, pixels)
preview_texture.create_from_image(preview_image, 0)
preview.texture = preview_texture

View file

@ -69,7 +69,11 @@ func _on_AButton_toggled(button_pressed : bool) -> void:
func update_preview() -> void:
preview_image.copy_from(current_cel)
match affect:
CEL:
preview_image.copy_from(current_cel)
_:
preview_image.copy_from(current_frame)
DrawingAlgos.invert_image_colors(preview_image, pixels, red, green, blue, alpha)
preview_image.unlock()
preview_texture.create_from_image(preview_image, 0)

View file

@ -76,7 +76,11 @@ func _on_InsideImageCheckBox_toggled(button_pressed : bool) -> void:
func update_preview() -> void:
preview_image.copy_from(current_cel)
match affect:
CEL:
preview_image.copy_from(current_cel)
_:
preview_image.copy_from(current_frame)
DrawingAlgos.generate_outline(preview_image, pixels, color, thickness, diagonal, inside_image)
preview_texture.create_from_image(preview_image, 0)
preview.texture = preview_texture