Kstars

sepcore.h
1/*
2 SPDX-FileCopyrightText: 1993-2011 Emmanuel Bertin -- IAP /CNRS/UPMC
3 SPDX-FileCopyrightText: 2014 SEP developers
4
5 SPDX-License-Identifier: LGPL-3.0-or-later
6*/
7
8#define RETURN_OK 0 /* must be zero */
9#define MEMORY_ALLOC_ERROR 1
10#define PIXSTACK_FULL 2
11#define ILLEGAL_DTYPE 3
12#define ILLEGAL_SUBPIX 4
13#define NON_ELLIPSE_PARAMS 5
14#define ILLEGAL_APER_PARAMS 6
15#define DEBLEND_OVERFLOW 7
16#define LINE_NOT_IN_BUF 8
17#define RELTHRESH_NO_NOISE 9
18#define UNKNOWN_NOISE_TYPE 10
19
20#define BIG 1e+30 /* a huge number (< biggest value a float can store) */
21#define PI 3.1415926535898
22#define DEG (PI/180.0) /* 1 deg in radians */
23
24typedef int LONG;
25typedef unsigned int ULONG;
26typedef unsigned char BYTE; /* a byte */
27
28/* keep these synchronized */
29typedef float PIXTYPE; /* type used inside of functions */
30#define PIXDTYPE SEP_TFLOAT /* dtype code corresponding to PIXTYPE */
31
32
33/* signature of converters */
34typedef PIXTYPE (*converter)(void *ptr);
35typedef void (*array_converter)(void *ptr, int n, PIXTYPE *target);
36typedef void (*array_writer)(float *ptr, int n, void *target);
37
38#define QCALLOC(ptr, typ, nel, status) \
39 {if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
40 { \
41 char errtext[160]; \
42 sprintf(errtext, #ptr " (" #nel "=%lu elements) " \
43 "at line %d in module " __FILE__ " !", \
44 (size_t)(nel)*sizeof(typ), __LINE__); \
45 put_errdetail(errtext); \
46 status = MEMORY_ALLOC_ERROR; \
47 goto exit; \
48 }; \
49 }
50
51#define QMALLOC(ptr, typ, nel, status) \
52 {if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
53 { \
54 char errtext[160]; \
55 sprintf(errtext, #ptr " (" #nel "=%lu elements) " \
56 "at line %d in module " __FILE__ " !", \
57 (size_t)(nel)*sizeof(typ), __LINE__); \
58 put_errdetail(errtext); \
59 status = MEMORY_ALLOC_ERROR; \
60 goto exit; \
61 }; \
62 }
63
64float fqmedian(float *ra, int n);
65void put_errdetail(char *errtext);
66
67int get_converter(int dtype, converter *f, int *size);
68int get_array_converter(int dtype, array_converter *f, int *size);
69int get_array_writer(int dtype, array_writer *f, int *size);
70int get_array_subtractor(int dtype, array_writer *f, int *size);
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.