WCSLIB 8.9

Loading...
Searching...
No Matches
tab.h
Go to the documentation of this file.
1/*============================================================================
2 WCSLIB 8.9 - an implementation of the FITS WCS standard.
3 Copyright (C) 1995-2026, Mark Calabretta
4
5 This file is part of WCSLIB.
6
7 WCSLIB is free software: you can redistribute it and/or modify it under the
8 terms of the GNU Lesser General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or (at your option)
10 any later version.
11
12 WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with WCSLIB. If not, see http://www.gnu.org/licenses.
19
20 Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
21 http://www.atnf.csiro.au/computing/software/wcs
22 $Id: tab.h,v 8.9 2026/06/18 13:00:03 mcalabre Exp $
23*=============================================================================
24*
25* WCSLIB 8.9 - C routines that implement the FITS World Coordinate System
26* (WCS) standard. Refer to the README file provided with WCSLIB for an
27* overview of the library.
28*
29*
30* Summary of the tab routines
31* ---------------------------
32* Routines in this suite implement the part of the FITS World Coordinate
33* System (WCS) standard that deals with tabular coordinates, i.e. coordinates
34* that are defined via a lookup table, as described in
35*
36= "Representations of world coordinates in FITS",
37= Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)
38=
39= "Representations of spectral coordinates in FITS",
40= Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
41= 2006, A&A, 446, 747 (WCS Paper III)
42*
43* These routines define methods to be used for computing tabular world
44* coordinates from intermediate world coordinates (a linear transformation
45* of image pixel coordinates), and vice versa. They are based on the tabprm
46* struct which contains all information needed for the computations. The
47* struct contains some members that must be set by the user, and others that
48* are maintained by these routines, somewhat like a C++ class but with no
49* encapsulation.
50*
51* tabini(), tabmem(), tabcpy(), and tabfree() are provided to manage the
52* tabprm struct, tabsize() computes its total size including allocated memory,
53* tabenq() returns information about the state of the struct, and tabprt()
54* prints its contents.
55*
56* tabperr() prints the error message(s) (if any) stored in a tabprm struct.
57*
58* A setup routine, tabset(), computes intermediate values in the tabprm struct
59* from parameters in it that were supplied by the user. The struct always
60* needs to be set up by tabset() but it need not be called explicitly - refer
61* to the explanation of tabprm::flag.
62*
63* tabx2s() and tabs2x() implement the WCS tabular coordinate transformations.
64*
65* Accuracy:
66* ---------
67* No warranty is given for the accuracy of these routines (refer to the
68* copyright notice); intending users must satisfy for themselves their
69* adequacy for the intended purpose. However, closure effectively to within
70* double precision rounding error was demonstrated by test routine ttab.c
71* which accompanies this software.
72*
73*
74* tabini() - Default constructor for the tabprm struct
75* ----------------------------------------------------
76* tabini() allocates memory for arrays in a tabprm struct and sets all members
77* of the struct to default values.
78*
79* PLEASE NOTE: every tabprm struct should be initialized by tabini(), possibly
80* repeatedly. On the first invokation, and only the first invokation, the
81* flag member of the tabprm struct must be set to -1 to initialize memory
82* management, regardless of whether tabini() will actually be used to allocate
83* memory.
84*
85* Given:
86* alloc int If true, allocate memory unconditionally for arrays in
87* the tabprm struct.
88*
89* If false, it is assumed that pointers to these arrays
90* have been set by the user except if they are null
91* pointers in which case memory will be allocated for
92* them regardless. (In other words, setting alloc true
93* saves having to initalize these pointers to zero.)
94*
95* M int The number of tabular coordinate axes.
96*
97* K const int[]
98* Vector of length M whose elements (K_1, K_2,... K_M)
99* record the lengths of the axes of the coordinate array
100* and of each indexing vector. M and K[] are used to
101* determine the length of the various tabprm arrays and
102* therefore the amount of memory to allocate for them.
103* Their values are copied into the tabprm struct.
104*
105* It is permissible to set K (i.e. the address of the
106* array) to zero which has the same effect as setting
107* each element of K[] to zero. In this case no memory
108* will be allocated for the index vectors or coordinate
109* array in the tabprm struct. These together with the
110* K vector must be set separately before calling
111* tabset().
112*
113* Given and returned:
114* tab struct tabprm*
115* Tabular transformation parameters. Note that, in
116* order to initialize memory management tabprm::flag
117* should be set to -1 when tab is initialized for the
118* first time (memory leaks may result if it had already
119* been initialized).
120*
121* Function return value:
122* int Status return value:
123* 0: Success.
124* 1: Null tabprm pointer passed.
125* 2: Memory allocation failed.
126* 3: Invalid tabular parameters.
127*
128* For returns > 1, a detailed error message is set in
129* tabprm::err if enabled, see wcserr_enable().
130*
131*
132* tabmem() - Acquire tabular memory
133* ---------------------------------
134* tabmem() takes control of memory allocated by the user for arrays in the
135* tabprm struct.
136*
137* Given and returned:
138* tab struct tabprm*
139* Tabular transformation parameters.
140*
141* Function return value:
142* int Status return value:
143* 0: Success.
144* 1: Null tabprm pointer passed.
145* 2: Memory allocation failed.
146*
147* For returns > 1, a detailed error message is set in
148* tabprm::err if enabled, see wcserr_enable().
149*
150*
151* tabcpy() - Copy routine for the tabprm struct
152* ---------------------------------------------
153* tabcpy() does a deep copy of one tabprm struct to another, using tabini() to
154* allocate memory for its arrays if required. Only the "information to be
155* provided" part of the struct is copied; a call to tabset() is required to
156* set up the remainder.
157*
158* Given:
159* alloc int If true, allocate memory unconditionally for arrays in
160* the tabprm struct.
161*
162* If false, it is assumed that pointers to these arrays
163* have been set by the user except if they are null
164* pointers in which case memory will be allocated for
165* them regardless. (In other words, setting alloc true
166* saves having to initalize these pointers to zero.)
167*
168* tabsrc const struct tabprm*
169* Struct to copy from.
170*
171* Given and returned:
172* tabdst struct tabprm*
173* Struct to copy to. tabprm::flag should be set to -1
174* if tabdst was not previously initialized (memory leaks
175* may result if it was previously initialized).
176*
177* Function return value:
178* int Status return value:
179* 0: Success.
180* 1: Null tabprm pointer passed.
181* 2: Memory allocation failed.
182*
183* For returns > 1, a detailed error message is set in
184* tabprm::err (associated with tabdst) if enabled, see
185* wcserr_enable().
186*
187*
188* tabcmp() - Compare two tabprm structs for equality
189* --------------------------------------------------
190* tabcmp() compares two tabprm structs for equality.
191*
192* Given:
193* cmp int A bit field controlling the strictness of the
194* comparison. At present, this value must always be 0,
195* indicating a strict comparison. In the future, other
196* options may be added.
197*
198* tol double Tolerance for comparison of floating-point values.
199* For example, for tol == 1e-6, all floating-point
200* values in the structs must be equal to the first 6
201* decimal places. A value of 0 implies exact equality.
202*
203* tab1 const struct tabprm*
204* The first tabprm struct to compare.
205*
206* tab2 const struct tabprm*
207* The second tabprm struct to compare.
208*
209* Returned:
210* equal int* Non-zero when the given structs are equal.
211*
212* Function return value:
213* int Status return value:
214* 0: Success.
215* 1: Null pointer passed.
216*
217*
218* tabfree() - Destructor for the tabprm struct
219* --------------------------------------------
220* tabfree() frees memory allocated for the tabprm arrays by tabini().
221* tabini() records the memory it allocates and tabfree() will only attempt to
222* free this.
223*
224* PLEASE NOTE: tabfree() must not be invoked on a tabprm struct that was not
225* initialized by tabini().
226*
227* Given and returned:
228* tab struct tabprm*
229* Coordinate transformation parameters.
230*
231* Function return value:
232* int Status return value:
233* 0: Success.
234* 1: Null tabprm pointer passed.
235*
236*
237* tabsize() - Compute the size of a tabprm struct
238* -----------------------------------------------
239* tabsize() computes the full size of a tabprm struct, including allocated
240* memory.
241*
242* Given:
243* tab const struct tabprm*
244* Tabular transformation parameters.
245*
246* If NULL, the base size of the struct and the allocated
247* size are both set to zero.
248*
249* Returned:
250* sizes int[2] The first element is the base size of the struct as
251* returned by sizeof(struct tabprm). The second element
252* is the total allocated size, in bytes, assuming that
253* the allocation was done by tabini(). This figure
254* includes memory allocated for the constituent struct,
255* tabprm::err.
256*
257* It is not an error for the struct not to have been set
258* up via tabset(), which normally results in additional
259* memory allocation.
260*
261* Function return value:
262* int Status return value:
263* 0: Success.
264*
265*
266* tabenq() - enquire about the state of a tabprm struct
267* -----------------------------------------------------
268* tabenq() may be used to obtain information about the state of a tabprm
269* struct. The function returns a true/false answer for the enquiry asked.
270*
271* Given:
272* tab const struct tabprm*
273* Tabular transformation parameters.
274*
275* enquiry int Enquiry according to the following parameters:
276* TABENQ_MEM: memory in the struct is being managed by
277* WCSLIB (see tabini()).
278* TABENQ_SET: the struct has been set up by tabset().
279* TABENQ_BYP: the struct is in bypass mode (see
280* tabset()).
281* These may be combined by logical OR, e.g.
282* TABENQ_MEM | TABENQ_SET. The enquiry result will be
283* the logical AND of the individual results.
284*
285* Function return value:
286* int Enquiry result:
287* 0: No.
288* 1: Yes.
289*
290*
291* tabprt() - Print routine for the tabprm struct
292* ----------------------------------------------
293* tabprt() prints the contents of a tabprm struct using wcsprintf(). Mainly
294* intended for diagnostic purposes.
295*
296* Given:
297* tab const struct tabprm*
298* Tabular transformation parameters.
299*
300* Function return value:
301* int Status return value:
302* 0: Success.
303* 1: Null tabprm pointer passed.
304*
305*
306* tabperr() - Print error messages from a tabprm struct
307* -----------------------------------------------------
308* tabperr() prints the error message(s) (if any) stored in a tabprm struct.
309* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v.
310*
311* Given:
312* tab const struct tabprm*
313* Tabular transformation parameters.
314*
315* prefix const char *
316* If non-NULL, each output line will be prefixed with
317* this string.
318*
319* Function return value:
320* int Status return value:
321* 0: Success.
322* 1: Null tabprm pointer passed.
323*
324*
325* tabset() - Setup routine for the tabprm struct
326* -----------------------------------------------
327* tabset() allocates memory for work arrays in the tabprm struct and sets up
328* the struct according to information supplied within it.
329*
330* Note that this routine need not be called directly; it will be invoked by
331* tabx2s() and tabs2x() if tabprm::flag is anything other than a predefined
332* magic value.
333*
334* tabset() normally operates regardless of the value of tabprm::flag; i.e.
335* even if a struct was previously set up it will be reset unconditionally.
336* However, a tabprm struct may be put into "bypass" mode by invoking tabset()
337* initially with tabprm::flag == 1 (rather than 0). tabset() will return
338* immediately if invoked on a struct in that state. To take a struct out of
339* bypass mode, simply reset tabprm::flag to zero. See also tabenq().
340*
341* Given and returned:
342* tab struct tabprm*
343* Tabular transformation parameters.
344*
345* Function return value:
346* int Status return value:
347* 0: Success.
348* 1: Null tabprm pointer passed.
349* 3: Invalid tabular parameters.
350*
351* For returns > 1, a detailed error message is set in
352* tabprm::err if enabled, see wcserr_enable().
353*
354*
355* tabx2s() - Pixel-to-world transformation
356* ----------------------------------------
357* tabx2s() transforms intermediate world coordinates to world coordinates
358* using coordinate lookup.
359*
360* Given and returned:
361* tab struct tabprm*
362* Tabular transformation parameters.
363*
364* Given:
365* ncoord,
366* nelem int The number of coordinates, each of vector length
367* nelem.
368*
369* x const double[ncoord][nelem]
370* Array of intermediate world coordinates, SI units.
371*
372* Returned:
373* world double[ncoord][nelem]
374* Array of world coordinates, in SI units.
375*
376* stat int[ncoord]
377* Status return value status for each coordinate:
378* 0: Success.
379* 1: Invalid intermediate world coordinate.
380*
381* Function return value:
382* int Status return value:
383* 0: Success.
384* 1: Null tabprm pointer passed.
385* 3: Invalid tabular parameters.
386* 4: One or more of the x coordinates were invalid,
387* as indicated by the stat vector.
388*
389* For returns > 1, a detailed error message is set in
390* tabprm::err if enabled, see wcserr_enable().
391*
392*
393* tabs2x() - World-to-pixel transformation
394* ----------------------------------------
395* tabs2x() transforms world coordinates to intermediate world coordinates.
396*
397* Given and returned:
398* tab struct tabprm*
399* Tabular transformation parameters.
400*
401* Given:
402* ncoord,
403* nelem int The number of coordinates, each of vector length
404* nelem.
405* world const double[ncoord][nelem]
406* Array of world coordinates, in SI units.
407*
408* Returned:
409* x double[ncoord][nelem]
410* Array of intermediate world coordinates, SI units.
411* stat int[ncoord]
412* Status return value status for each vector element:
413* 0: Success.
414* 1: Invalid world coordinate.
415*
416* Function return value:
417* int Status return value:
418* 0: Success.
419* 1: Null tabprm pointer passed.
420* 3: Invalid tabular parameters.
421* 5: One or more of the world coordinates were
422* invalid, as indicated by the stat vector.
423*
424* For returns > 1, a detailed error message is set in
425* tabprm::err if enabled, see wcserr_enable().
426*
427*
428* tabprm struct - Tabular transformation parameters
429* -------------------------------------------------
430* The tabprm struct contains information required to transform tabular
431* coordinates. It consists of certain members that must be set by the user
432* ("given") and others that are set by the WCSLIB routines ("returned"). Some
433* of the latter are supplied for informational purposes while others are for
434* internal use only.
435*
436* int flag
437* (Given and returned) This flag must be set to zero (or 1, see tabset())
438* whenever any of the following tabprm members are set or changed:
439*
440* - tabprm::M (q.v., not normally set by the user),
441* - tabprm::K (q.v., not normally set by the user),
442* - tabprm::map,
443* - tabprm::crval,
444* - tabprm::index,
445* - tabprm::coord.
446*
447* This signals the initialization routine, tabset(), to recompute the
448* returned members of the tabprm struct. tabset() will reset flag to
449* indicate that this has been done.
450*
451* PLEASE NOTE: flag should be set to -1 when tabini() is called for the
452* first time for a particular tabprm struct in order to initialize memory
453* management. It must ONLY be used on the first initialization otherwise
454* memory leaks may result.
455*
456* int M
457* (Given or returned) Number of tabular coordinate axes.
458*
459* If tabini() is used to initialize the tabprm struct (as would normally
460* be the case) then it will set M from the value passed to it as a
461* function argument. The user should not subsequently modify it.
462*
463* int *K
464* (Given or returned) Pointer to the first element of a vector of length
465* tabprm::M whose elements (K_1, K_2,... K_M) record the lengths of the
466* axes of the coordinate array and of each indexing vector.
467*
468* If tabini() is used to initialize the tabprm struct (as would normally
469* be the case) then it will set K from the array passed to it as a
470* function argument. The user should not subsequently modify it.
471*
472* int *map
473* (Given) Pointer to the first element of a vector of length tabprm::M
474* that defines the association between axis m in the M-dimensional
475* coordinate array (1 <= m <= M) and the indices of the intermediate world
476* coordinate and world coordinate arrays, x[] and world[], in the argument
477* lists for tabx2s() and tabs2x().
478*
479* When x[] and world[] contain the full complement of coordinate elements
480* in image-order, as will usually be the case, then map[m-1] == i-1 for
481* axis i in the N-dimensional image (1 <= i <= N). In terms of the FITS
482* keywords
483*
484* map[PVi_3a - 1] == i - 1.
485*
486* However, a different association may result if x[], for example, only
487* contains a (relevant) subset of intermediate world coordinate elements.
488* For example, if M == 1 for an image with N > 1, it is possible to fill
489* x[] with the relevant coordinate element with nelem set to 1. In this
490* case map[0] = 0 regardless of the value of i.
491*
492* double *crval
493* (Given) Pointer to the first element of a vector of length tabprm::M
494* whose elements contain the index value for the reference pixel for each
495* of the tabular coordinate axes.
496*
497* double **index
498* (Given) Pointer to the first element of a vector of length tabprm::M of
499* pointers to vectors of lengths (K_1, K_2,... K_M) of 0-relative indexes
500* (see tabprm::K).
501*
502* The address of any or all of these index vectors may be set to zero,
503* i.e.
504*
505= index[m] == 0;
506*
507* this is interpreted as default indexing, i.e.
508*
509= index[m][k] = k;
510*
511* double *coord
512* (Given) Pointer to the first element of the tabular coordinate array,
513* treated as though it were defined as
514*
515= double coord[K_M]...[K_2][K_1][M];
516*
517* (see tabprm::K) i.e. with the M dimension varying fastest so that the
518* M elements of a coordinate vector are stored contiguously in memory.
519*
520* int nc
521* (Returned) Total number of coordinate vectors in the coordinate array
522* being the product K_1 * K_2 * ... * K_M (see tabprm::K).
523*
524* int padding
525* (An unused variable inserted for alignment purposes only.)
526*
527* int *sense
528* (Returned) Pointer to the first element of a vector of length tabprm::M
529* whose elements indicate whether the corresponding indexing vector is
530* monotonic increasing (+1), or decreasing (-1).
531*
532* int *p0
533* (Returned) Pointer to the first element of a vector of length tabprm::M
534* of interpolated indices into the coordinate array such that Upsilon_m,
535* as defined in Paper III, is equal to (p0[m] + 1) + tabprm::delta[m].
536*
537* double *delta
538* (Returned) Pointer to the first element of a vector of length tabprm::M
539* of interpolated indices into the coordinate array such that Upsilon_m,
540* as defined in Paper III, is equal to (tabprm::p0[m] + 1) + delta[m].
541*
542* double *extrema
543* (Returned) Pointer to the first element of an array that records the
544* minimum and maximum value of each element of the coordinate vector in
545* each row of the coordinate array, treated as though it were defined as
546*
547= double extrema[K_M]...[K_2][2][M]
548*
549* (see tabprm::K). The minimum is recorded in the first element of the
550* compressed K_1 dimension, then the maximum. This array is used by the
551* inverse table lookup function, tabs2x(), to speed up table searches.
552*
553* struct wcserr *err
554* (Returned) If enabled, when an error status is returned, this struct
555* contains detailed information about the error, see wcserr_enable().
556*
557* int m_flag
558* (For internal use only.)
559* int m_M
560* (For internal use only.)
561* int m_N
562* (For internal use only.)
563* int set_M
564* (For internal use only.)
565* int m_K
566* (For internal use only.)
567* int m_map
568* (For internal use only.)
569* int m_crval
570* (For internal use only.)
571* int m_index
572* (For internal use only.)
573* int m_indxs
574* (For internal use only.)
575* int m_coord
576* (For internal use only.)
577*
578*
579* Global variable: const char *tab_errmsg[] - Status return messages
580* ------------------------------------------------------------------
581* Error messages to match the status value returned from each function.
582*
583*===========================================================================*/
584
585#ifndef WCSLIB_TAB
586#define WCSLIB_TAB
587
588#ifdef __cplusplus
589 extern "C" {
590#endif
591
592 enum tabenq_enum {
593 TABENQ_MEM = 1, // tabprm struct memory is managed by WCSLIB.
594 TABENQ_SET = 2, // tabprm struct has been set up.
595 TABENQ_BYP = 4, // tabprm struct is in bypass mode.
596};
597
598 extern const char *tab_errmsg[];
599
600 enum tab_errmsg_enum {
601 TABERR_SUCCESS = 0, // Success.
602 TABERR_NULL_POINTER = 1, // Null tabprm pointer passed.
603 TABERR_MEMORY = 2, // Memory allocation failed.
604 TABERR_BAD_PARAMS = 3, // Invalid tabular parameters.
605 TABERR_BAD_X = 4, // One or more of the x coordinates were
606 // invalid.
607 TABERR_BAD_WORLD = 5 // One or more of the world coordinates were
608 // invalid.
609};
610
611 struct tabprm {
612 // Initialization flag (see the prologue above).
613 //--------------------------------------------------------------------------
614 int flag; // Set to zero to force initialization.
615
616 // Parameters to be provided (see the prologue above).
617 //--------------------------------------------------------------------------
618 int M; // Number of tabular coordinate axes.
619 int *K; // Vector of length M whose elements
620 // (K_1, K_2,... K_M) record the lengths of
621 // the axes of the coordinate array and of
622 // each indexing vector.
623 int *map; // Vector of length M usually such that
624 // map[m-1] == i-1 for coordinate array
625 // axis m and image axis i (see above).
626 double *crval; // Vector of length M containing the index
627 // value for the reference pixel for each
628 // of the tabular coordinate axes.
629 double **index; // Vector of pointers to M indexing vectors
630 // of lengths (K_1, K_2,... K_M).
631 double *coord; // (1+M)-dimensional tabular coordinate
632 // array (see above).
633
634 // Information derived from the parameters supplied.
635 //--------------------------------------------------------------------------
636 int nc; // Number of coordinate vectors (of length
637 // M) in the coordinate array.
638 int padding; // (Dummy inserted for alignment purposes.)
639 int *sense; // Vector of M flags that indicate whether
640 // the Mth indexing vector is monotonic
641 // increasing, or else decreasing.
642 int *p0; // Vector of M indices.
643 double *delta; // Vector of M increments.
644 double *extrema; // (1+M)-dimensional array of coordinate
645 // extrema.
646
647 // Error messaging, if enabled.
648 //--------------------------------------------------------------------------
649 struct wcserr *err;
650
651 //--------------------------------------------------------------------------
652 // Private - the remainder are for internal use.
653 //--------------------------------------------------------------------------
654 // Memory management.
655 int m_flag, m_M, m_N;
656 int set_M;
657 int *m_K, *m_map;
658 double *m_crval, **m_index, **m_indxs, *m_coord;
659};
660
661// Size of the tabprm struct in int units, used by the Fortran wrappers.
662#define TABLEN (sizeof(struct tabprm)/sizeof(int))
663
664
665 int tabini(int alloc, int M, const int K[], struct tabprm *tab);
666
667 int tabmem(struct tabprm *tab);
668
669 int tabcpy(int alloc, const struct tabprm *tabsrc, struct tabprm *tabdst);
670
671 int tabcmp(int cmp, double tol, const struct tabprm *tab1,
672 const struct tabprm *tab2, int *equal);
673
674 int tabfree(struct tabprm *tab);
675
676 int tabsize(const struct tabprm *tab, int size[2]);
677
678 int tabenq(const struct tabprm *tab, int enquiry);
679
680 int tabprt(const struct tabprm *tab);
681
682 int tabperr(const struct tabprm *tab, const char *prefix);
683
684 int tabset(struct tabprm *tab);
685
686 int tabx2s(struct tabprm *tab, int ncoord, int nelem, const double x[],
687 double world[], int stat[]);
688
689 int tabs2x(struct tabprm *tab, int ncoord, int nelem, const double world[],
690 double x[], int stat[]);
691
692
693// Deprecated.
694#define tabini_errmsg tab_errmsg
695#define tabcpy_errmsg tab_errmsg
696#define tabfree_errmsg tab_errmsg
697#define tabprt_errmsg tab_errmsg
698#define tabset_errmsg tab_errmsg
699#define tabx2s_errmsg tab_errmsg
700#define tabs2x_errmsg tab_errmsg
701
702#ifdef __cplusplus
703}
704#endif
705
706#endif // WCSLIB_TAB
tabprm
Tabular transformation parameters.
Definition tab.h:611
tabprm::m_coord
double * m_coord
Definition tab.h:658
tabprm::padding
int padding
Definition tab.h:638
tabprm::sense
int * sense
Definition tab.h:639
tabprm::flag
int flag
Definition tab.h:614
tabprm::m_N
int m_N
Definition tab.h:655
tabprm::m_crval
double * m_crval
Definition tab.h:658
tabprm::nc
int nc
Definition tab.h:636
tabprm::index
double ** index
Definition tab.h:629
tabprm::p0
int * p0
Definition tab.h:642
tabprm::crval
double * crval
Definition tab.h:626
tabprm::M
int M
Definition tab.h:618
tabprm::coord
double * coord
Definition tab.h:631
tabprm::m_K
int * m_K
Definition tab.h:657
tabprm::set_M
int set_M
Definition tab.h:656
tabprm::m_map
int * m_map
Definition tab.h:657
tabprm::map
int * map
Definition tab.h:623
tabprm::m_flag
int m_flag
Definition tab.h:655
tabprm::extrema
double * extrema
Definition tab.h:644
tabprm::delta
double * delta
Definition tab.h:643
tabprm::K
int * K
Definition tab.h:619
tabprm::err
struct wcserr * err
Definition tab.h:649
tabprm::m_indxs
double ** m_indxs
Definition tab.h:658
tabprm::m_M
int m_M
Definition tab.h:655
tabprm::m_index
double ** m_index
Definition tab.h:658
wcserr
Error message handling.
Definition wcserr.h:243
tabx2s
int tabx2s(struct tabprm *tab, int ncoord, int nelem, const double x[], double world[], int stat[])
Pixel-to-world transformation.
tabsize
int tabsize(const struct tabprm *tab, int size[2])
Compute the size of a tabprm struct.
tabfree
int tabfree(struct tabprm *tab)
Destructor for the tabprm struct.
tabenq_enum
tabenq_enum
Definition tab.h:592
TABENQ_MEM
@ TABENQ_MEM
Definition tab.h:593
TABENQ_SET
@ TABENQ_SET
Definition tab.h:594
TABENQ_BYP
@ TABENQ_BYP
Definition tab.h:595
tabset
int tabset(struct tabprm *tab)
Setup routine for the tabprm struct.
tabcmp
int tabcmp(int cmp, double tol, const struct tabprm *tab1, const struct tabprm *tab2, int *equal)
Compare two tabprm structs for equality.
tabperr
int tabperr(const struct tabprm *tab, const char *prefix)
Print error messages from a tabprm struct.
tabprt
int tabprt(const struct tabprm *tab)
Print routine for the tabprm struct.
tabenq
int tabenq(const struct tabprm *tab, int enquiry)
enquire about the state of a tabprm struct.
tabcpy
int tabcpy(int alloc, const struct tabprm *tabsrc, struct tabprm *tabdst)
Copy routine for the tabprm struct.
tabs2x
int tabs2x(struct tabprm *tab, int ncoord, int nelem, const double world[], double x[], int stat[])
World-to-pixel transformation.
tabini
int tabini(int alloc, int M, const int K[], struct tabprm *tab)
Default constructor for the tabprm struct.
tab_errmsg_enum
tab_errmsg_enum
Definition tab.h:600
TABERR_BAD_PARAMS
@ TABERR_BAD_PARAMS
Definition tab.h:604
TABERR_MEMORY
@ TABERR_MEMORY
Definition tab.h:603
TABERR_SUCCESS
@ TABERR_SUCCESS
Definition tab.h:601
TABERR_BAD_WORLD
@ TABERR_BAD_WORLD
Definition tab.h:607
TABERR_NULL_POINTER
@ TABERR_NULL_POINTER
Definition tab.h:602
TABERR_BAD_X
@ TABERR_BAD_X
Definition tab.h:605
tab_errmsg
const char * tab_errmsg[]
Status return messages.
tabmem
int tabmem(struct tabprm *tab)
Acquire tabular memory.