1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Add color channel filter to editor texture previews

This commit is contained in:
Marc Gilleron
2024-12-07 22:12:05 +00:00
parent 0c763602f9
commit c7a9d64eaf
13 changed files with 582 additions and 38 deletions

View File

@@ -39,6 +39,8 @@
class AspectRatioContainer;
class ColorRect;
class TextureRect;
class ShaderMaterial;
class ColorChannelSelector;
class TexturePreview : public MarginContainer {
GDCLASS(TexturePreview, MarginContainer);
@@ -47,10 +49,14 @@ private:
TextureRect *texture_display = nullptr;
MarginContainer *margin_container = nullptr;
Control *outline_overlay = nullptr;
AspectRatioContainer *centering_container = nullptr;
ColorRect *bg_rect = nullptr;
TextureRect *checkerboard = nullptr;
Label *metadata_label = nullptr;
Ref<ShaderMaterial> material;
ColorChannelSelector *channel_selector = nullptr;
Color cached_outline_color;
@@ -61,6 +67,8 @@ protected:
void _notification(int p_what);
void _update_texture_display_ratio();
void on_selected_channels_changed();
public:
TextureRect *get_texture_display();
TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata);