skeletton for an io system
This commit is contained in:
parent
e8be36243d
commit
28905d301e
4 changed files with 97 additions and 0 deletions
|
@ -4,6 +4,8 @@ add_subdirectory(deps)
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
add_subdirectory(scene)
|
add_subdirectory(scene)
|
||||||
add_subdirectory(system)
|
add_subdirectory(system)
|
||||||
|
add_subdirectory(io)
|
||||||
|
|
||||||
#add_subdirectory(ui)
|
#add_subdirectory(ui)
|
||||||
add_subdirectory(scripting)
|
add_subdirectory(scripting)
|
||||||
add_subdirectory(visual)
|
add_subdirectory(visual)
|
||||||
|
|
27
src/io/CMakeLists.txt
Normal file
27
src/io/CMakeLists.txt
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
set(hdrs
|
||||||
|
include/pw/io/image_io.hpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(srcs
|
||||||
|
src/image_io.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(pwio
|
||||||
|
STATIC
|
||||||
|
${hdrs}
|
||||||
|
${srcs}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
pwio
|
||||||
|
PUBLIC
|
||||||
|
include
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(pwio pwcore)
|
||||||
|
|
||||||
|
|
||||||
|
#add_subdirectory(src)
|
||||||
|
#add_subdirectory(tests)
|
||||||
|
|
50
src/io/include/pw/io/image_io.hpp
Normal file
50
src/io/include/pw/io/image_io.hpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1999-2019 Hartmut Seichter
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PW_IO_IMAGE_IO_HPP
|
||||||
|
#define PW_IO_IMAGE_IO_HPP
|
||||||
|
|
||||||
|
#include <pw/core/image.hpp>
|
||||||
|
|
||||||
|
namespace pw {
|
||||||
|
|
||||||
|
class image_io {
|
||||||
|
public:
|
||||||
|
|
||||||
|
static image_io& get();
|
||||||
|
|
||||||
|
image read(std::string const& uri,uint32_t flags = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
struct impl;
|
||||||
|
std::unique_ptr<impl> _impl;
|
||||||
|
|
||||||
|
image_io() = default;
|
||||||
|
~image_io() = default;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
18
src/io/src/image_io.cpp
Normal file
18
src/io/src/image_io.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#include "pw/io/image_io.hpp"
|
||||||
|
|
||||||
|
namespace pw {
|
||||||
|
|
||||||
|
|
||||||
|
struct image_io::impl
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
image_io &image_io::get()
|
||||||
|
{
|
||||||
|
static image_io instance;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue