Debian Codegraph @

cvd/internal/io/save_postscript.h

raw symbols SCIP
1 #ifndef PNM_SAVE_POSTSCRIPT_H
2 #define PNM_SAVE_POSTSCRIPT_H
3
4 #include <cvd/byte.h>
5 #include <cvd/image.h>
6 #include <cvd/internal/convert_pixel_types.h>
7 #include <cvd/internal/io/parameter.h>
8 #include <cvd/rgb.h>
9 #include <iostream>
10 #include <memory>
11 #include <string>
12
13 namespace CVD
14 {
15 namespace PS
16 {
17
18 class WritePimpl;
19
20 class writer
21 {
22 public:
23 writer(std::ostream&, ImageRef size, const std::string& type, const std::map<std::string, Parameter<>>& p);
24 ~writer();
25
26 void write_raw_pixel_line(const byte*);
27 void write_raw_pixel_line(const Rgb<byte>*);
28
29 template <class Incoming>
30 struct Outgoing
31 {
32 typedef byte type;
33 };
34
35 static const int top_row_first = 0;
36
37 protected:
38 std::unique_ptr<WritePimpl> t;
39 };
40
41 template <class C>
42 struct writer::Outgoing<Rgb<C>>
43 {
44 typedef Rgb<byte> type;
45 };
46
47 template <class C>
48 struct writer::Outgoing<Rgba<C>>
49 {
50 typedef Rgb<byte> type;
51 };
52
53 template <>
54 struct writer::Outgoing<Rgb8>
55 {
56 typedef Rgb<byte> type;
57 };
58
59 class eps_writer
60 {
61 public:
62 eps_writer(std::ostream&, ImageRef size, const std::string& type, const std::map<std::string, Parameter<>>& p);
63 ~eps_writer();
64
65 void write_raw_pixel_line(const byte*);
66 void write_raw_pixel_line(const Rgb<byte>*);
67
68 template <class Incoming>
69 struct Outgoing
70 {
71 typedef typename writer::Outgoing<Incoming>::type type;
72 };
73
74 static const int top_row_first = 1;
75
76 protected:
77 std::unique_ptr<WritePimpl> t;
78 };
79
80 }
81 }
82 #endif