You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 lines
2.4 KiB

  1. /*
  2. * This file is part of Aptdec.
  3. * Copyright (c) 2004-2009 Thierry Leconte (F4DWV), Xerbo (xerbo@protonmail.com) 2019-2020
  4. * Copyright (c) 2021 Jon Beniston (M7RCE)
  5. *
  6. * Aptdec is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #ifndef APT_H
  21. #define APT_H
  22. #if defined (__GNUC__) && (__GNUC__ >= 4)
  23. #define APT_API __attribute__((visibility("default")))
  24. #elif defined (_MSC_VER)
  25. #define APT_API __declspec(dllexport)
  26. #else
  27. #define APT_API
  28. #endif
  29. // Maximum height of an APT image in number of scanlines
  30. #define APT_MAX_HEIGHT 3000
  31. // apt_getpixelrow callback function to get audio samples
  32. typedef int (*apt_getsample_t)(float *samples, int count);
  33. typedef struct {
  34. float *prow[APT_MAX_HEIGHT]; // Row buffers
  35. int nrow; // Number of rows
  36. int zenith; // Row in image where satellite reaches peak elevation
  37. int chA, chB; // ID of each channel
  38. char name[256]; // Stripped filename
  39. char *palette; // Filename of palette
  40. } apt_image_t;
  41. typedef struct {
  42. float r, g, b;
  43. } apt_rgb_t;
  44. int APT_API apt_init(double sample_rate);
  45. int APT_API apt_getpixelrow(float *pixelv, int nrow, int *zenith, int reset, apt_getsample_t getsample);
  46. void APT_API apt_histogramEqualise(float **prow, int nrow, int offset, int width);
  47. void APT_API apt_linearEnhance(float **prow, int nrow, int offset, int width);
  48. int APT_API apt_calibrate(float **prow, int nrow, int offset, int width) ;
  49. void APT_API apt_denoise(float **prow, int nrow, int offset, int width);
  50. void APT_API apt_flipImage(apt_image_t *img, int width, int offset);
  51. int APT_API apt_cropNoise(apt_image_t *img);
  52. apt_rgb_t APT_API apt_applyPalette(char *palette, int val);
  53. apt_rgb_t APT_API apt_RGBcomposite(apt_rgb_t top, float top_a, apt_rgb_t bottom, float bottom_a);
  54. char APT_API apt_TempPalette[256*3];
  55. char APT_API apt_PrecipPalette[58*3];
  56. #endif