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.
 
 
 
 
 

70 line
2.0 KiB

  1. /*
  2. * This file is part of Aptdec.
  3. * Copyright (c) 2004-2009 Thierry Leconte (F4DWV), Xerbo (xerbo@protonmail.com) 2019-2020
  4. *
  5. * Aptdec is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program 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
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. *
  18. */
  19. // Constants
  20. #define VERSION "Aptdec; (c) 2004-2009 Thierry Leconte F4DWV, Xerbo (xerbo@protonmail.com) 2019-2020"
  21. #define MAX_HEIGHT 3000
  22. // Useful macros
  23. #define CLIP(v, lo, hi) (v > hi ? hi : (v > lo ? v : lo))
  24. #define CONTAINS(str, char) (strchr(str, (int) char) != NULL)
  25. // Typedefs
  26. typedef struct {
  27. float r, g, b;
  28. } rgb_t;
  29. typedef struct {
  30. float *prow[MAX_HEIGHT]; // Row buffers
  31. int nrow; // Number of rows
  32. int zenith; // Row in image where satellite reaches peak elevation
  33. int chA, chB; // ID of each channel
  34. char name[256]; // Stripped filename
  35. char *palette; // Filename of palette
  36. } image_t;
  37. typedef struct {
  38. char *type; // Output image type
  39. char *effects; // Effects on the image
  40. int satnum; // The satellite number
  41. char *map; // Path to a map file
  42. char *path; // Output directory
  43. int realtime; // Realtime decoding
  44. char *filename; // Output filename
  45. char *palette; // Filename of palette
  46. float gamma; // Gamma
  47. } options_t;
  48. enum imagetypes {
  49. Raw_Image='r',
  50. MCIR='m',
  51. Palleted='p',
  52. Temperature='t',
  53. Channel_A='a',
  54. Channel_B='b',
  55. Distribution='d'
  56. };
  57. enum effects {
  58. Crop_Telemetry='t',
  59. Histogram_Equalise='h',
  60. Denoise='d',
  61. Precipitation_Overlay='p',
  62. Flip_Image='f',
  63. Linear_Equalise='l',
  64. Crop_Noise='c'
  65. };