[go: up one dir, main page]

File: proto.h

package info (click to toggle)
siril 0.9.10-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,168 kB
  • sloc: ansic: 43,770; cpp: 6,893; sh: 2,958; makefile: 365; xml: 185
file content (245 lines) | stat: -rw-r--r-- 7,938 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
#ifndef PROTO_H_
#define PROTO_H_
#include "core/siril.h"
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif
#include <fftw3.h>
#include <gsl/gsl_histogram.h>
#include <stdint.h>

#ifdef HAVE_LIBTIFF
#define uint64 uint64_hack_
#define int64 int64_hack_
#include <tiffio.h>
#undef uint64
#undef int64
#endif

/****************** image_format_fits.h ******************/
int	readfits(const char *filename, fits *fit, char *realname);
double get_exposure_from_fitsfile(fitsfile *fptr);
int import_metadata_from_fitsfile(fitsfile *fptr, fits *to);
void	clearfits(fits *);
int	readfits_partial(const char *filename, int layer, fits *fit, const rectangle *area, gboolean read_date);
int	read_opened_fits_partial(sequence *seq, int layer, int index, WORD *buffer, const rectangle *area);
int 	savefits(const char *, fits *);
int	copyfits(fits *from, fits *to, unsigned char oper, int layer);
int	copy_fits_metadata(fits *from, fits *to);
int	save1fits16(const char *filename, fits *fit, int layer);
int siril_fits_open_diskfile(fitsfile **fptr, const char *filename, int iomode, int *status);

void	rgb24bit_to_fits48bit(unsigned char *rgbbuf, fits *fit, gboolean inverted);
void	rgb8bit_to_fits16bit(unsigned char *graybuf, fits *fit);
void	rgb48bit_to_fits48bit(WORD *rgbbuf, fits *fit, gboolean inverted, gboolean change_endian);

void	fits_flip_top_to_bottom(fits *fit);
void	extract_region_from_fits(fits *from, int layer, fits *to, const rectangle *area);
int 	new_fit_image(fits **fit, int width, int height, int nblayer);
void	keep_first_channel_from_fits(fits *fit);

/****************** image_formats_internal.h ******************/
/* BMP */
int 	readbmp(const char *, fits *);
int 	savebmp(const char *, fits *);

/* PNM */
int 	import_pnm_to_fits(const char *filename, fits *fit);
int	saveNetPBM(const char *name, fits *fit);

/* PIC */
struct pic_struct {
	unsigned long magic;
	unsigned short width;
	unsigned short height;
	unsigned short bin[6];
	unsigned short nbplane;
	unsigned short hi;
	unsigned short lo;
	char *date;			
	char *time;		

	// internal stuff
	FILE *file;
};
int	readpic(const char *name, fits *fit);

/****************** image_formats_libraries.h ******************/
#ifdef HAVE_LIBTIFF
int readtif(const char *name, fits *fit);
int savetif(const char *name, fits *fit, uint16 bitspersample);
#endif

#ifdef HAVE_LIBJPEG
int readjpg(const char*, fits *);
int savejpg(const char *, fits *, int);
#endif

#ifdef HAVE_LIBPNG
int readpng(const char*, fits *);
int savepng(const char *filename, fits *fit, uint32_t bytes_per_sample,
		gboolean is_colour);
#endif

#ifdef HAVE_LIBRAW
int open_raw_files(const char *, fits *, int);
#endif

/****************** utils.h ******************/
int	round_to_int(double x);
int	roundf_to_int(float x);
WORD	round_to_WORD(double x);
BYTE	round_to_BYTE(double x);
BYTE	conv_to_BYTE(double x);
gboolean isrgb(fits *fit);
char *f2utf8(const char *filename);
gboolean ends_with(const char *str, const char *ending);
int	get_extension_index(const char *filename);
int	is_readable_file(const char *filename);
int	stat_file(const char *filename2, image_type *type, char **realname);
const char *get_filename_ext(const char *filename);

gchar *siril_get_startup_dir();
int	changedir(const char *dir, gchar **err);
gchar *get_locale_filename(const gchar *path);
int	update_sequences_list(const char *sequence_name_to_select);
void	update_used_memory();
double test_available_space(double seq_size);
int	get_available_memory_in_MB();
#ifdef _WIN32
gchar *get_special_folder(int csidl);
#endif
void	expand_home_in_filename(char *filename, int size);
WORD	get_normalized_value(fits*);
void	read_and_show_textfile(char*, char*);
void	swap_param(double *, double *);
void	quicksort_d (double *a, int n);
void	quicksort_s (WORD *a, int n);
char*	remove_ext_from_filename(const char *basename);
char*	str_append(char** data, const char* newdata);
char*	format_basename(char *root);
float	computePente(WORD *lo, WORD *hi);
void	load_css_style_sheet (char *path);
double	encodeJD(dateTime dt);
gint strcompare(gconstpointer *a, gconstpointer *b);
gboolean allow_to_open_files(int nb_frames, int *nb_allowed_file);
GtkWindow *siril_get_active_window();

/****************** quantize.h ***************/
int fits_img_stats_ushort(WORD *array, long nx, long ny, int nullcheck,
		WORD nullvalue, long *ngoodpix, WORD *minvalue, WORD *maxvalue,
		double *mean, double *sigma, double *noise1, double *noise2, double *noise3,
		double *noise5, int *status);

/****************** siril.h ******************/
/* crop sequence data from GUI */
struct crop_sequence_data {
	sequence *seq;
	rectangle area;
	const char *prefix;
	int retvalue;
};

/* median filter data from GUI */
struct median_filter_data {
	fits *fit;
	int ksize;
	double amount;
	int iterations;
};

/* rgradient filter data from GUI */
struct rgradient_filter_data {
	fits *fit;
	double xc, yc, dR, da;
};

/* Banding data from GUI */
struct banding_data {
	fits *fit;
	double sigma;
	double amount;
	gboolean protect_highlights;
	gboolean applyRotation;
	const gchar *seqEntry;
};

/* Noise data from GUI */
struct noise_data {
	gboolean verbose;
	gboolean use_idle;
	fits *fit;
	double bgnoise[3];
	struct timeval t_start;
	int retval;
};

/* Lucy-Richardson data from GUI */
struct RL_data {
	fits *fit;
	double sigma;
	int iter;
};


int 	threshlo(fits *fit, int level);
int 	threshhi(fits *fit, int level);
int 	nozero(fits *fit, int level);
int	soper(fits *a, double scalar, char oper);
int	imoper(fits *a, fits *b, char oper);
int sub_background(fits* image, fits* background, int layer);
int 	addmax(fits *a, fits *b);
int	siril_fdiv(fits *a, fits *b, float scalar);
int siril_ndiv(fits *a, fits *b);
double 	gaussienne(double sigma, int size, double *gauss);
int 	unsharp(fits *,double sigma, double mult, gboolean verbose);
int 	shift(int sx, int sy);
double entropy(fits *fit, int layer, rectangle *area, imstats *opt_stats);
int 	loglut(fits *fit);
int asinhlut(fits *fit, double beta, double offset, gboolean RGBspace);
int	ddp(fits *a, int lev, float coef, float sig);
int	visu(fits *fit, int low, int high);
int	fill(fits *fit, int level, rectangle *arearg);
int 	off(fits *a, int level);
int	lrgb(fits *l, fits *r, fits *g, fits *b, fits *lrgb);
gpointer seqpreprocess(gpointer empty);
void	initialize_preprocessing();
double	background(fits* fit, int reqlayer, rectangle *selection);
int backgroundnoise(fits* fit, double sigma[]);
void	show_FITS_header(fits *);
double gauss_cvf(double p);
int get_wavelet_layers(fits *fit, int Nbr_Plan, int Plan, int Type, int reqlayer);
int extract_plans(fits *fit, int Nbr_Plan, int Type);
gpointer median_filter(gpointer p);
void apply_banding_to_sequence(struct banding_data *banding_args);
gpointer BandingEngineThreaded(gpointer p);
int BandingEngine(fits *fit, double sigma, double amount, gboolean protect_highlights, gboolean applyRotation);
gpointer noise(gpointer p);
gpointer LRdeconv(gpointer p);
void compute_grey_flat(fits *fit);

/****************** seqfile.h ******************/
sequence * readseqfile(const char *name);
int	writeseqfile(sequence *seq);
gboolean existseq(const char *name);
int	buildseqfile(sequence *seq, int force_recompute);

/****************** registration_preview.h ******************/
void	redraw_previews();
void	set_preview_area(int preview_area, int centerX, int centerY);
void	init_mouse();
void	adjust_reginfo();
void	on_spinbut_shift_value_change(GtkSpinButton *spinbutton, gpointer user_data);

/****************** sequence_list.h ******************/
void	sequence_list_change_selection(gchar *path, gboolean new_value);
void	sequence_list_change_selection_index(int index);
void	sequence_list_change_current();
void	sequence_list_change_reference();
void	fill_sequence_list(sequence *seq, int layer, gboolean as_idle);
void	clear_sequence_list();

/****************** statistics_list.h ******************/
void computeStat();

#endif