Line |
Branch |
Exec |
Source |
1 |
|
|
/************************************************************************ |
2 |
|
|
* |
3 |
|
|
* Copyright (C) 2009-2024 IRCAD France |
4 |
|
|
* Copyright (C) 2012-2019 IHU Strasbourg |
5 |
|
|
* |
6 |
|
|
* This file is part of Sight. |
7 |
|
|
* |
8 |
|
|
* Sight is free software: you can redistribute it and/or modify it under |
9 |
|
|
* the terms of the GNU Lesser General Public License as published by |
10 |
|
|
* the Free Software Foundation, either version 3 of the License, or |
11 |
|
|
* (at your option) any later version. |
12 |
|
|
* |
13 |
|
|
* Sight is distributed in the hope that it will be useful, |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
|
* GNU Lesser General Public License for more details. |
17 |
|
|
* |
18 |
|
|
* You should have received a copy of the GNU Lesser General Public |
19 |
|
|
* License along with Sight. If not, see <https://www.gnu.org/licenses/>. |
20 |
|
|
* |
21 |
|
|
***********************************************************************/ |
22 |
|
|
|
23 |
|
|
#pragma once |
24 |
|
|
|
25 |
|
|
#include <sight/io/__/config.hpp> |
26 |
|
|
|
27 |
|
|
#include "io/__/writer/generic_object_writer.hpp" |
28 |
|
|
|
29 |
|
|
#include <core/location/single_file.hpp> |
30 |
|
|
|
31 |
|
|
#include <data/image.hpp> |
32 |
|
|
|
33 |
|
|
#include <filesystem> |
34 |
|
|
|
35 |
|
|
namespace sight::io::writer |
36 |
|
|
{ |
37 |
|
|
|
38 |
|
|
/** |
39 |
|
|
* @brief image Writer. Writes .raw.gz files. |
40 |
|
|
* |
41 |
|
|
* |
42 |
|
|
* Writes `sight::data::image` into a `.raw.gz` file. |
43 |
|
|
* The buffer is written in a file using zlib. |
44 |
|
|
*/ |
45 |
|
|
class SIGHT_IO_CLASS_API gz_buffer_image_writer : public generic_object_writer<data::image>, |
46 |
|
|
public core::location::single_file |
47 |
|
|
{ |
48 |
|
|
public: |
49 |
|
|
|
50 |
|
✗ |
SIGHT_DECLARE_CLASS(gz_buffer_image_writer, generic_object_writer<data::image>) |
51 |
|
|
|
52 |
|
|
/// Destructor. Does nothing. |
53 |
|
2 |
SIGHT_IO_API ~gz_buffer_image_writer() override = default; |
54 |
|
|
|
55 |
|
|
/// Reads the file using the zlib API. |
56 |
|
|
SIGHT_IO_API void write() override; |
57 |
|
|
|
58 |
|
|
/// Defines the extensions supported by this writer. Here: ".raw.gz" |
59 |
|
|
SIGHT_IO_API std::string extension() const override; |
60 |
|
|
}; |
61 |
|
|
|
62 |
|
|
} // namespace sight::io::writer |
63 |
|
|
|