GNU Radio's SATNOGS Package
sstv_pd120_sink_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4  *
5  * Copyright (C) 2019, 2020,
6  * Libre Space Foundation <http://librespacefoundation.org/>
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU 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  * This program 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 General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef INCLUDED_SATNOGS_SSTV_PD120_SINK_IMPL_H
24 #define INCLUDED_SATNOGS_SSTV_PD120_SINK_IMPL_H
25 
27 
28 #define PNG_DEBUG 3
29 #include <png++/png.hpp>
30 
31 namespace gr {
32 namespace satnogs {
33 
35 private:
36  std::string d_filename_png;
37  bool d_has_sync;
38  bool d_initial_sync;
39 
40  float *d_line;
41  size_t d_line_pos;
42  size_t d_image_y;
43 
44  png::image<png::rgb_pixel> d_image;
45 
46  float to_frequency(float sample);
47  int to_color(float sample);
48  void ycbcr_to_rgb(int ycbcr[3], int rgb[3]);
49  bool is_sync(size_t pos, const float *samples);
50 
51  void render_line();
52  void blank_image();
53 
54 public:
55  sstv_pd120_sink_impl(const char *filename_png);
57  bool stop();
58 
59  // Where all the action really happens
60  int work(int noutput_items,
61  gr_vector_const_void_star &input_items,
62  gr_vector_void_star &output_items);
63 };
64 
65 } // namespace satnogs
66 } // namespace gr
67 
68 #endif /* INCLUDED_SATNOGS_SSTV_PD120_SINK_IMPL_H */
sstv_pd120_sink_impl(const char *filename_png)
SSTV demodulator block.
Definition: sstv_pd120_sink.h:37
Definition: sstv_pd120_sink_impl.h:34
Definition: amsat_duv_decoder.h:29
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)