Move pixmap from util to gfx
This commit is contained in:
parent
0424bae480
commit
2d6b947809
8 changed files with 29 additions and 14 deletions
13
libs/gfx/include/psemek/gfx/color.hpp
Normal file
13
libs/gfx/include/psemek/gfx/color.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <psemek/geom/vector.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace psemek::gfx
|
||||
{
|
||||
|
||||
using color_rgb = geom::vector<std::uint8_t, 3>;
|
||||
using color_rgba = geom::vector<std::uint8_t, 4>;
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
#include <psemek/gfx/color.hpp>
|
||||
|
||||
namespace psemek::util
|
||||
#include <memory>
|
||||
|
||||
namespace psemek::gfx
|
||||
{
|
||||
|
||||
template <typename Pixel>
|
||||
|
|
@ -53,8 +54,8 @@ namespace psemek::util
|
|||
};
|
||||
|
||||
using pixmap_monochrome = basic_pixmap<std::uint8_t>;
|
||||
using pixmap_rgb = basic_pixmap<std::array<std::uint8_t, 3>>;
|
||||
using pixmap_rgba = basic_pixmap<std::array<std::uint8_t, 4>>;
|
||||
using pixmap_rgb = basic_pixmap<color_rgb>;
|
||||
using pixmap_rgba = basic_pixmap<color_rgba>;
|
||||
using pixmap_float = basic_pixmap<float>;
|
||||
|
||||
pixmap_monochrome read_pgm(std::istream & is);
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <psemek/gfx/gl.hpp>
|
||||
#include <psemek/util/pixmap.hpp>
|
||||
#include <psemek/gfx/pixmap.hpp>
|
||||
#include <psemek/geom/vector.hpp>
|
||||
|
||||
namespace psemek::gfx
|
||||
|
|
@ -76,7 +76,7 @@ namespace psemek::gfx
|
|||
}
|
||||
|
||||
template <typename Pixel>
|
||||
void load(util::basic_pixmap<Pixel> const & p)
|
||||
void load(basic_pixmap<Pixel> const & p)
|
||||
{
|
||||
load(p.width(), p.height(), p.data());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include <psemek/util/pixmap.hpp>
|
||||
#include <psemek/gfx/pixmap.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace psemek::util
|
||||
namespace psemek::gfx
|
||||
{
|
||||
|
||||
pixmap_monochrome read_pgm(std::istream & is)
|
||||
|
|
@ -3,4 +3,4 @@ file(GLOB_RECURSE PSEMEK_PCG_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "sou
|
|||
|
||||
add_library(pcg ${PSEMEK_PCG_HEADERS} ${PSEMEK_PCG_SOURCES})
|
||||
target_include_directories(pcg PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
target_link_libraries(pcg PUBLIC util geom)
|
||||
target_link_libraries(pcg PUBLIC util geom gfx)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <psemek/util/pixmap.hpp>
|
||||
#include <psemek/gfx/pixmap.hpp>
|
||||
#include <psemek/geom/vector.hpp>
|
||||
|
||||
namespace psemek::pcg
|
||||
|
|
@ -9,7 +9,7 @@ namespace psemek::pcg
|
|||
struct perlin
|
||||
{
|
||||
perlin() = default;
|
||||
perlin(util::basic_pixmap<geom::vector<float, 2>> grad_map);
|
||||
perlin(gfx::basic_pixmap<geom::vector<float, 2>> grad_map);
|
||||
perlin(perlin &&) = default;
|
||||
|
||||
perlin & operator = (perlin &&) = default;
|
||||
|
|
@ -29,7 +29,7 @@ namespace psemek::pcg
|
|||
float operator()(float x, float y) const;
|
||||
|
||||
private:
|
||||
util::basic_pixmap<geom::vector<float, 2>> grad_map_;
|
||||
gfx::basic_pixmap<geom::vector<float, 2>> grad_map_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace psemek::pcg
|
||||
{
|
||||
|
||||
perlin::perlin(util::basic_pixmap<geom::vector<float, 2>> grad_map)
|
||||
perlin::perlin(gfx::basic_pixmap<geom::vector<float, 2>> grad_map)
|
||||
: grad_map_(std::move(grad_map))
|
||||
{}
|
||||
|
||||
|
|
|
|||
1
todo.md
1
todo.md
|
|
@ -3,3 +3,4 @@
|
|||
* Create a simple generic primive painter
|
||||
* Design ui system
|
||||
* Add platform deployment tools
|
||||
* Add color utilities
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue