mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-29 02:16:31 -05:00
Add Color Correction Menu
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
This commit is contained in:
32
include/Menus/ColorCorrectionMenu.hpp
Normal file
32
include/Menus/ColorCorrectionMenu.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef __COLORCORRECTIONMENU_HPP
|
||||
#define __COLORCORRECTIONMENU_HPP
|
||||
|
||||
#include "OptionSelectionMenu.hpp"
|
||||
#include <chrono>
|
||||
|
||||
#include "TextRectangle.hpp"
|
||||
#include "sfml_gfx_structs.hpp"
|
||||
#include "display_structs.hpp"
|
||||
|
||||
#define COLORCORRECTION_MENU_NO_ACTION -1
|
||||
#define COLORCORRECTION_MENU_BACK -2
|
||||
|
||||
class ColorCorrectionMenu : public OptionSelectionMenu {
|
||||
public:
|
||||
ColorCorrectionMenu(bool font_load_success, sf::Font &text_font);
|
||||
~ColorCorrectionMenu();
|
||||
void setup_title(std::string added_name);
|
||||
void prepare(float scaling_factor, int view_size_x, int view_size_y, int current_crop);
|
||||
void insert_data(std::vector<const ShaderColorEmulationData*>* possible_correction_data);
|
||||
int selected_index = COLORCORRECTION_MENU_NO_ACTION;
|
||||
void reset_output_option();
|
||||
protected:
|
||||
void set_output_option(int index, int action);
|
||||
int get_num_options();
|
||||
std::string get_string_option(int index, int action);
|
||||
void class_setup();
|
||||
private:
|
||||
const std::string base_name = "Color Correction";
|
||||
std::vector<const ShaderColorEmulationData*>* possible_correction_data;
|
||||
};
|
||||
#endif
|
||||
@@ -15,6 +15,7 @@ enum VideoEffectsMenuOutAction{
|
||||
VIDEO_EFFECTS_MENU_INPUT_COLORSPACE_DEC,
|
||||
VIDEO_EFFECTS_MENU_FRAME_BLENDING_INC,
|
||||
VIDEO_EFFECTS_MENU_FRAME_BLENDING_DEC,
|
||||
VIDEO_EFFECTS_MENU_COLOR_CORRECTION_MENU,
|
||||
};
|
||||
|
||||
class VideoEffectsMenu : public OptionSelectionMenu {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
enum ScreenType { TOP, BOTTOM, JOINT };
|
||||
enum BottomRelativePosition { UNDER_TOP, LEFT_TOP, ABOVE_TOP, RIGHT_TOP, BOT_REL_POS_END };
|
||||
enum NonIntegerScalingModes { SMALLER_PRIORITY, INVERSE_PROPORTIONAL_PRIORITY, EQUAL_PRIORITY, PROPORTIONAL_PRIORITY, BIGGER_PRIORITY, END_NONINT_SCALE_MODES };
|
||||
enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_MENU_TYPE, AUDIO_MENU_TYPE, CROP_MENU_TYPE, TOP_PAR_MENU_TYPE, BOTTOM_PAR_MENU_TYPE, ROTATION_MENU_TYPE, OFFSET_MENU_TYPE, BFI_MENU_TYPE, LOAD_MENU_TYPE, SAVE_MENU_TYPE, RESOLUTION_MENU_TYPE, EXTRA_MENU_TYPE, STATUS_MENU_TYPE, LICENSES_MENU_TYPE, RELATIVE_POS_MENU_TYPE, SHORTCUTS_MENU_TYPE, ACTION_SELECTION_MENU_TYPE, SCALING_RATIO_MENU_TYPE, ISN_MENU_TYPE, VIDEO_EFFECTS_MENU_TYPE, INPUT_MENU_TYPE, AUDIO_DEVICE_MENU_TYPE, SEPARATOR_MENU_TYPE };
|
||||
enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_MENU_TYPE, AUDIO_MENU_TYPE, CROP_MENU_TYPE, TOP_PAR_MENU_TYPE, BOTTOM_PAR_MENU_TYPE, ROTATION_MENU_TYPE, OFFSET_MENU_TYPE, BFI_MENU_TYPE, LOAD_MENU_TYPE, SAVE_MENU_TYPE, RESOLUTION_MENU_TYPE, EXTRA_MENU_TYPE, STATUS_MENU_TYPE, LICENSES_MENU_TYPE, RELATIVE_POS_MENU_TYPE, SHORTCUTS_MENU_TYPE, ACTION_SELECTION_MENU_TYPE, SCALING_RATIO_MENU_TYPE, ISN_MENU_TYPE, VIDEO_EFFECTS_MENU_TYPE, INPUT_MENU_TYPE, AUDIO_DEVICE_MENU_TYPE, SEPARATOR_MENU_TYPE, COLOR_CORRECTION_MENU_TYPE };
|
||||
enum InputColorspaceMode { FULL_COLORSPACE, DS_COLORSPACE, GBA_COLORSPACE, INPUT_COLORSPACE_END };
|
||||
enum FrameBlendingMode { NO_FRAME_BLENDING, FULL_FRAME_BLENDING, DS_3D_BOTH_SCREENS_FRAME_BLENDING, FRAME_BLENDING_END };
|
||||
|
||||
@@ -70,6 +70,8 @@ struct ScreenInfo {
|
||||
bool use_non_integer_scaling_bottom;
|
||||
bool failed_fullscreen;
|
||||
bool have_titlebar;
|
||||
int top_color_correction;
|
||||
int bot_color_correction;
|
||||
InputColorspaceMode in_colorspace_top;
|
||||
InputColorspaceMode in_colorspace_bot;
|
||||
FrameBlendingMode frame_blending_top;
|
||||
@@ -133,4 +135,13 @@ struct PARData {
|
||||
std::string name;
|
||||
};
|
||||
|
||||
struct ShaderColorEmulationData {
|
||||
float targetGamma;
|
||||
float lum;
|
||||
float rgb_mod[3][3];
|
||||
float displayGamma;
|
||||
bool is_valid;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "InputMenu.hpp"
|
||||
#include "AudioDeviceMenu.hpp"
|
||||
#include "SeparatorMenu.hpp"
|
||||
#include "ColorCorrectionMenu.hpp"
|
||||
#include "display_structs.hpp"
|
||||
#include "event_structs.hpp"
|
||||
#include "shaders_list.hpp"
|
||||
@@ -81,6 +82,7 @@ public:
|
||||
int get_ret_val();
|
||||
|
||||
private:
|
||||
enum PossibleShaderTypes { BASE_INPUT_SHADER_TYPE, BASE_FINAL_OUTPUT_SHADER_TYPE, COLOR_PROCESSING_SHADER_TYPE };
|
||||
struct ScreenOperations {
|
||||
bool call_create;
|
||||
bool call_close;
|
||||
@@ -157,11 +159,13 @@ private:
|
||||
InputMenu *input_menu;
|
||||
AudioDeviceMenu *audio_device_menu;
|
||||
SeparatorMenu *separator_menu;
|
||||
ColorCorrectionMenu *color_correction_menu;
|
||||
std::vector<const CropData*> possible_crops;
|
||||
std::vector<const CropData*> possible_crops_ds;
|
||||
std::vector<const CropData*> possible_crops_with_games;
|
||||
std::vector<const CropData*> possible_crops_ds_with_games;
|
||||
std::vector<const PARData*> possible_pars;
|
||||
std::vector<const ShaderColorEmulationData*> possible_color_profiles;
|
||||
std::vector<sf::VideoMode> possible_resolutions;
|
||||
std::vector<std::string> possible_audio_devices;
|
||||
std::vector<FileData> possible_files;
|
||||
@@ -192,6 +196,8 @@ private:
|
||||
out_rect_data m_out_rect_top, m_out_rect_bot;
|
||||
ScreenType m_stype;
|
||||
|
||||
const ShaderColorEmulationData* sent_shader_color_data;
|
||||
|
||||
std::queue<SFEvent> events_queue;
|
||||
|
||||
sf::View m_view;
|
||||
@@ -257,6 +263,7 @@ private:
|
||||
void separator_multiplier_change(bool positive, float& multiplier_to_check, float lower_limit, float upper_limit);
|
||||
void separator_windowed_multiplier_change(bool positive);
|
||||
void separator_fullscreen_multiplier_change(bool positive);
|
||||
void color_correction_value_change(int new_color_correction_value);
|
||||
bool query_reset_request();
|
||||
void reset_held_times(bool force = true);
|
||||
void poll_window(bool do_everything);
|
||||
@@ -267,8 +274,11 @@ private:
|
||||
bool window_needs_work();
|
||||
void window_factory(bool is_main_thread);
|
||||
void update_texture();
|
||||
int _choose_shader(bool is_input, bool is_top);
|
||||
int choose_shader(bool is_input, bool is_top);
|
||||
int _choose_base_input_shader(bool is_top);
|
||||
int _choose_color_emulation_shader(bool is_top);
|
||||
int _choose_shader(PossibleShaderTypes shader_type, bool is_top);
|
||||
int choose_shader(PossibleShaderTypes shader_type, bool is_top);
|
||||
bool apply_shaders_to_input(out_rect_data &rect_data, const sf::RectangleShape &final_in_rect, bool is_top);
|
||||
void pre_texture_conversion_processing();
|
||||
void post_texture_conversion_processing(out_rect_data &rect_data, const sf::RectangleShape &in_rect, bool actually_draw, bool is_top, bool is_debug);
|
||||
void draw_rect_to_window(const sf::RectangleShape &out_rect, bool is_top);
|
||||
@@ -327,6 +337,7 @@ private:
|
||||
void setup_video_effects_menu(bool reset_data = true);
|
||||
void setup_input_menu(bool reset_data = true);
|
||||
void setup_separator_menu(bool reset_data = true);
|
||||
void setup_color_correction_menu(bool reset_data = true);
|
||||
void update_connection();
|
||||
};
|
||||
|
||||
@@ -344,6 +355,7 @@ void FPSArrayDestroy(FPSArray *array);
|
||||
void FPSArrayInsertElement(FPSArray *array, double frame_time);
|
||||
void insert_basic_crops(std::vector<const CropData*> &crop_vector, ScreenType s_type, bool is_ds, bool allow_game_specific);
|
||||
void insert_basic_pars(std::vector<const PARData*> &par_vector);
|
||||
void insert_basic_color_profiles(std::vector<const ShaderColorEmulationData*> &color_profiles_vector);
|
||||
void reset_display_data(DisplayData *display_data);
|
||||
void reset_input_data(InputData* input_data);
|
||||
void reset_shared_data(SharedData* shared_data);
|
||||
|
||||
@@ -35,6 +35,7 @@ enum shader_list_enum {
|
||||
FRAME_BLENDING_BIT_CRUSHER_FRAGMENT_SHADER_5,
|
||||
FRAME_BLENDING_BIT_CRUSHER_FRAGMENT_SHADER_6,
|
||||
FRAME_BLENDING_BIT_CRUSHER_FRAGMENT_SHADER_7,
|
||||
COLOR_EMULATION_FRAGMENT_SHADER,
|
||||
|
||||
TOTAL_NUM_SHADERS
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user