aseprite/src/app/color_spaces.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.2 KiB
C
Raw Normal View History

2018-10-19 02:29:16 +08:00
// Aseprite
// Copyright (c) 2018-2025 Igara Studio S.A.
2018-10-19 02:29:16 +08:00
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_COLOR_SPACES_H_INCLUDED
#define APP_COLOR_SPACES_H_INCLUDED
#pragma once
#include "gfx/color.h"
#include "gfx/color_space.h"
2018-10-19 02:29:16 +08:00
#include "os/color_space.h"
namespace doc {
class Sprite;
}
namespace ui {
class Display;
}
2018-10-19 02:29:16 +08:00
namespace app {
class Doc;
class Preferences;
2018-10-19 02:29:16 +08:00
void initialize_color_spaces(Preferences& pref);
2018-10-19 02:29:16 +08:00
// Returns the color space of the current document.
os::ColorSpaceRef get_current_color_space(ui::Display* display, Doc* doc = nullptr);
2018-10-19 02:29:16 +08:00
gfx::ColorSpaceRef get_working_rgb_space_from_preferences();
2018-10-19 02:29:16 +08:00
class ConvertCS {
public:
ConvertCS() = delete;
ConvertCS(ui::Display* display, Doc* doc = nullptr);
ConvertCS(const os::ColorSpaceRef& srcCS, const os::ColorSpaceRef& dstCS);
2018-10-19 02:29:16 +08:00
ConvertCS(ConvertCS&&);
ConvertCS& operator=(const ConvertCS&) = delete;
gfx::Color operator()(const gfx::Color c);
2024-12-17 01:52:19 +08:00
private:
os::Ref<os::ColorSpaceConversion> m_conversion;
2024-12-17 01:52:19 +08:00
};
ConvertCS convert_from_current_to_display_color_space(ui::Display* display);
ConvertCS convert_from_custom_to_srgb(const os::ColorSpaceRef& from);
2018-10-19 02:29:16 +08:00
} // namespace app
#endif