Instrument Neutral Distributed Interface INDI 2.2.5
convolution.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2017 Jasem Mutlaq. All rights reserved.
3
4 DSP Convolution plugin
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*******************************************************************************/
20
21#pragma once
22
23#include "dspinterface.h"
24#include "dsp.h"
25#include <fitsio.h>
26#define N_WAVELETS 7
27#include <string>
28
29namespace DSP
30{
31class Convolution : public Interface
32{
33 public:
35 bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[],
36 char *names[], int n) override;
37 virtual bool processBLOB(uint8_t *out, uint32_t dims, int *sizes, int bits_per_sample) override;
38
39 protected:
41 void Activated() override;
42 void Deactivated() override;
43
44 private:
45 IBLOBVectorProperty DownloadBP;
46 IBLOB DownloadB;
47
48 dsp_stream_p matrix;
49 bool matrix_loaded { false };
50};
51
52class Wavelets : public Interface
53{
54 public:
56 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
57 virtual bool processBLOB(uint8_t *out, uint32_t dims, int *sizes, int bits_per_sample) override;
58
59 protected:
60 ~Wavelets();
61 void Activated() override;
62 void Deactivated() override;
63
64 private:
65 dsp_stream_p matrix;
66
67 INumberVectorProperty WaveletsNP;
68 INumber WaveletsN[N_WAVELETS];
69
70 bool matrix_loaded { false };
71 void Convolute();
72};
73}
void Activated() override
Activated Called after activation from client application.
void Deactivated() override
Deactivated Called after deactivation from client application.
bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) override
virtual bool processBLOB(uint8_t *out, uint32_t dims, int *sizes, int bits_per_sample) override
processBLOB Propagate to Callback and generate BLOBs for parent device.
virtual bool processBLOB(uint8_t *out, uint32_t dims, int *sizes, int bits_per_sample) override
processBLOB Propagate to Callback and generate BLOBs for parent device.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
void Deactivated() override
Deactivated Called after deactivation from client application.
void Activated() override
Activated Called after activation from client application.
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
#define N_WAVELETS
Definition convolution.h:26
The DSP Namespace adds signal processing to INDI drivers. Primarily written for sensors and detectors...
One Blob (Binary Large Object) descriptor.
One number descriptor.
BLOB (Binary Large Object) vector property descriptor.
Definition indiapi.h:469
Number vector property descriptor.
Definition indiapi.h:317
Contains a set of information and data relative to a buffer and how to use it.
Definition dsp.h:379