-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat.h
33 lines (28 loc) · 890 Bytes
/
format.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Mathieu Malaterre
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <string>
namespace jlst {
class source;
class dest;
class image;
class image_info;
struct jls_options;
class format
{
public:
virtual ~format()
{
}
virtual format* clone() const = 0;
virtual bool handle_type(std::string const& type) const = 0;
virtual bool detect(source& s, image_info const& ii) const = 0;
image load(source& s, image_info const& ii) const;
void save(dest& d, image const& i, jls_options const& options) const;
protected:
virtual void read_info(source& s, image& i) const = 0;
virtual void read_data(source& s, image& i) const = 0;
virtual void write_info(dest& d, const image& i, const jls_options& jo) const = 0;
virtual void write_data(dest& d, const image& i, const jls_options& jo) const = 0;
};
} // namespace jlst