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
31namespace gr {
32namespace satnogs {
33
35{
36private:
37 std::string d_filename_png;
38 bool d_has_sync;
39 bool d_initial_sync;
40
41 float* d_line;
42 size_t d_line_pos;
43 size_t d_image_y;
44
45 png::image<png::rgb_pixel> d_image;
46
47 float to_frequency(float sample);
48 int to_color(float sample);
49 void ycbcr_to_rgb(int ycbcr[3], int rgb[3]);
50 bool is_sync(size_t pos, const float* samples);
51
52 void render_line();
53 void blank_image();
54
55public:
56 sstv_pd120_sink_impl(const char* filename_png);
58 bool stop();
59
60 // Where all the action really happens
61 int work(int noutput_items,
62 gr_vector_const_void_star& input_items,
63 gr_vector_void_star& output_items);
64};
65
66} // namespace satnogs
67} // namespace gr
68
69#endif /* INCLUDED_SATNOGS_SSTV_PD120_SINK_IMPL_H */
Definition: sstv_pd120_sink_impl.h:35
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
sstv_pd120_sink_impl(const char *filename_png)
SSTV demodulator block.
Definition: sstv_pd120_sink.h:37
Definition: amsat_duv_decoder.h:29