mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:30:06 +00:00
Color table implementation
This commit is contained in:
parent
6c25ce4230
commit
d734bc6a0a
12 changed files with 437 additions and 5 deletions
48
wxdata/include/scwx/common/color_table.hpp
Normal file
48
wxdata/include/scwx/common/color_table.hpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/gil.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace common
|
||||
{
|
||||
|
||||
class ColorTableImpl;
|
||||
|
||||
/**
|
||||
* @brief Color Table
|
||||
*
|
||||
* Implementation based on:
|
||||
* Color Table File Specification
|
||||
* Mike Gibson
|
||||
* Gibson Ridge Software, LLC. Used with permission.
|
||||
* http://www.grlevelx.com/manuals/color_tables/files_color_table.htm
|
||||
*/
|
||||
class ColorTable
|
||||
{
|
||||
public:
|
||||
explicit ColorTable();
|
||||
~ColorTable();
|
||||
|
||||
ColorTable(const ColorTable&) = delete;
|
||||
ColorTable& operator=(const ColorTable&) = delete;
|
||||
|
||||
ColorTable(ColorTable&&) noexcept;
|
||||
ColorTable& operator=(ColorTable&&) noexcept;
|
||||
|
||||
boost::gil::rgba8_pixel_t Color(float value) const;
|
||||
|
||||
static std::shared_ptr<ColorTable> Load(const std::string& filename);
|
||||
|
||||
private:
|
||||
std::unique_ptr<ColorTableImpl> p;
|
||||
|
||||
void ProcessLine(const std::vector<std::string>& tokenList);
|
||||
};
|
||||
|
||||
} // namespace common
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue