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.
 
 
 
 
 

74 regels
2.5 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. #ifdef APT_API_EXPORT
  26. #define APT_API __declspec(dllexport)
  27. #elif APT_API_STATIC
  28. #define APT_API
  29. #else if
  30. #define APT_API __declspec(dllimport)
  31. #endif
  32. #else
  33. #define APT_API
  34. #endif
  35. // Maximum height of an APT image in number of scanlines
  36. #define APT_MAX_HEIGHT 3000
  37. // apt_getpixelrow callback function to get audio samples
  38. typedef int (*apt_getsample_t)(float *samples, int count);
  39. typedef struct {
  40. float *prow[APT_MAX_HEIGHT]; // Row buffers
  41. int nrow; // Number of rows
  42. int zenith; // Row in image where satellite reaches peak elevation
  43. int chA, chB; // ID of each channel
  44. char name[256]; // Stripped filename
  45. char *palette; // Filename of palette
  46. } apt_image_t;
  47. typedef struct {
  48. float r, g, b;
  49. } apt_rgb_t;
  50. int APT_API apt_init(double sample_rate);
  51. int APT_API apt_getpixelrow(float *pixelv, int nrow, int *zenith, int reset, apt_getsample_t getsample);
  52. void APT_API apt_histogramEqualise(float **prow, int nrow, int offset, int width);
  53. void APT_API apt_linearEnhance(float **prow, int nrow, int offset, int width);
  54. int APT_API apt_calibrate(float **prow, int nrow, int offset, int width) ;
  55. void APT_API apt_denoise(float **prow, int nrow, int offset, int width);
  56. void APT_API apt_flipImage(apt_image_t *img, int width, int offset);
  57. int APT_API apt_cropNoise(apt_image_t *img);
  58. apt_rgb_t APT_API apt_applyPalette(char *palette, int val);
  59. apt_rgb_t APT_API apt_RGBcomposite(apt_rgb_t top, float top_a, apt_rgb_t bottom, float bottom_a);
  60. extern char APT_API apt_TempPalette[256*3];
  61. extern char APT_API apt_PrecipPalette[58*3];
  62. #endif