WCSLIB 8.3
Loading...
Searching...
No Matches
tab.h
Go to the documentation of this file.
1/*============================================================================
2 WCSLIB 8.3 - an implementation of the FITS WCS standard.
3 Copyright (C) 1995-2024, 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/people/Mark.Calabretta
22 $Id: tab.h,v 8.3 2024/05/08 16:02:37 mcalabre Exp $
23*=============================================================================
24*
25* WCSLIB 8.3 - 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* 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, which
280* implies that it has been set up (see
281* tabset()).
282* These may be combined by logical OR, e.g.
283* TABENQ_MEM | TABENQ_SET. The enquiry result will be
284* the logical AND of the individual results.
285*
286* Function return value:
287* int Enquiry result:
288* 0: No.
289* 1: Yes.
290*
291*
292* tabprt() - Print routine for the tabprm struct
293* ----------------------------------------------
294* tabprt() prints the contents of a tabprm struct using wcsprintf(). Mainly
295* intended for diagnostic purposes.
296*
297* Given:
298* tab const struct tabprm*
299* Tabular transformation parameters.
300*
301* Function return value:
302* int Status return value:
303* 0: Success.
304* 1: Null tabprm pointer passed.
305*
306*
307* tabperr() - Print error messages from a tabprm struct
308* -----------------------------------------------------
309* tabperr() prints the error message(s) (if any) stored in a tabprm struct.
310* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v.
311*
312* Given:
313* tab const struct tabprm*
314* Tabular transformation parameters.
315*
316* prefix const char *
317* If non-NULL, each output line will be prefixed with
318* this string.
319*
320* Function return value:
321* int Status return value:
322* 0: Success.
323* 1: Null tabprm pointer passed.
324*
325*
326* tabset() - Setup routine for the tabprm struct
327* -----------------------------------------------
328* tabset() allocates memory for work arrays in the tabprm struct and sets up
329* the struct according to information supplied within it.
330*
331* Note that this routine need not be called directly; it will be invoked by
332* tabx2s() and tabs2x() if tabprm::flag is anything other than a predefined
333* magic value.
334*
335* tabset() normally operates regardless of the value of tabprm::flag; i.e.
336* even if a struct was previously set up it will be reset unconditionally.
337* However, a tabprm struct may be put into "bypass" mode by invoking tabset()
338* initially with tabprm::flag == 1 (rather than 0). tabset() will return
339* immediately if invoked on a struct in that state. To take a struct out of
340* bypass mode, simply reset tabprm::flag to zero. See also tabenq().
341*
342* Given and returned:
343* tab struct tabprm*
344* Tabular transformation parameters.
345*
346* Function return value:
347* int Status return value:
348* 0: Success.
349* 1: Null tabprm pointer passed.
350* 3: Invalid tabular parameters.
351*
352* For returns > 1, a detailed error message is set in
353* tabprm::err if enabled, see wcserr_enable().
354*
355*
356* tabx2s() - Pixel-to-world transformation
357* ----------------------------------------
358* tabx2s() transforms intermediate world coordinates to world coordinates
359* using coordinate lookup.
360*
361* Given and returned:
362* tab struct tabprm*
363* Tabular transformation parameters.
364*
365* Given:
366* ncoord,
367* nelem int The number of coordinates, each of vector length
368* nelem.
369*
370* x const double[ncoord][nelem]
371* Array of intermediate world coordinates, SI units.
372*
373* Returned:
374* world double[ncoord][nelem]
375* Array of world coordinates, in SI units.
376*
377* stat int[ncoord]
378* Status return value status for each coordinate:
379* 0: Success.
380* 1: Invalid intermediate world coordinate.
381*
382* Function return value:
383* int Status return value:
384* 0: Success.
385* 1: Null tabprm pointer passed.
386* 3: Invalid tabular parameters.
387* 4: One or more of the x coordinates were invalid,
388* as indicated by the stat vector.
389*
390* For returns > 1, a detailed error message is set in
391* tabprm::err if enabled, see wcserr_enable().
392*
393*
394* tabs2x() - World-to-pixel transformation
395* ----------------------------------------
396* tabs2x() transforms world coordinates to intermediate world coordinates.
397*
398* Given and returned:
399* tab struct tabprm*
400* Tabular transformation parameters.
401*
402* Given:
403* ncoord,
404* nelem int The number of coordinates, each of vector length
405* nelem.
406* world const double[ncoord][nelem]
407* Array of world coordinates, in SI units.
408*
409* Returned:
410* x double[ncoord][nelem]
411* Array of intermediate world coordinates, SI units.
412* stat int[ncoord]
413* Status return value status for each vector element:
414* 0: Success.
415* 1: Invalid world coordinate.
416*
417* Function return value:
418* int Status return value:
419* 0: Success.
420* 1: Null tabprm pointer passed.
421* 3: Invalid tabular parameters.
422* 5: One or more of the world coordinates were
423* invalid, as indicated by the stat vector.
424*
425* For returns > 1, a detailed error message is set in
426* tabprm::err if enabled, see wcserr_enable().
427*
428*
429* tabprm struct - Tabular transformation parameters
430* -------------------------------------------------
431* The tabprm struct contains information required to transform tabular
432* coordinates. It consists of certain members that must be set by the user
433* ("given") and others that are set by the WCSLIB routines ("returned"). Some
434* of the latter are supplied for informational purposes while others are for
435* internal use only.
436*
437* int flag
438* (Given and returned) This flag must be set to zero (or 1, see tabset())
439* whenever any of the following tabprm members are set or changed:
440*
441* - tabprm::M (q.v., not normally set by the user),
442* - tabprm::K (q.v., not normally set by the user),
443* - tabprm::map,
444* - tabprm::crval,
445* - tabprm::index,
446* - tabprm::coord.
447*
448* This signals the initialization routine, tabset(), to recompute the
449* returned members of the tabprm struct. tabset() will reset flag to
450* indicate that this has been done.
451*
452* PLEASE NOTE: flag should be set to -1 when tabini() is called for the
453* first time for a particular tabprm struct in order to initialize memory
454* management. It must ONLY be used on the first initialization otherwise
455* memory leaks may result.
456*
457* int M
458* (Given or returned) Number of tabular coordinate axes.
459*
460* If tabini() is used to initialize the tabprm struct (as would normally
461* be the case) then it will set M from the value passed to it as a
462* function argument. The user should not subsequently modify it.
463*
464* int *K
465* (Given or returned) Pointer to the first element of a vector of length
466* tabprm::M whose elements (K_1, K_2,... K_M) record the lengths of the
467* axes of the coordinate array and of each indexing vector.
468*
469* If tabini() is used to initialize the tabprm struct (as would normally
470* be the case) then it will set K from the array passed to it as a
471* function argument. The user should not subsequently modify it.
472*
473* int *map
474* (Given) Pointer to the first element of a vector of length tabprm::M
475* that defines the association between axis m in the M-dimensional
476* coordinate array (1 <= m <= M) and the indices of the intermediate world
477* coordinate and world coordinate arrays, x[] and world[], in the argument
478* lists for tabx2s() and tabs2x().
479*
480* When x[] and world[] contain the full complement of coordinate elements
481* in image-order, as will usually be the case, then map[m-1] == i-1 for
482* axis i in the N-dimensional image (1 <= i <= N). In terms of the FITS
483* keywords
484*
485* map[PVi_3a - 1] == i - 1.
486*
487* However, a different association may result if x[], for example, only
488* contains a (relevant) subset of intermediate world coordinate elements.
489* For example, if M == 1 for an image with N > 1, it is possible to fill
490* x[] with the relevant coordinate element with nelem set to 1. In this
491* case map[0] = 0 regardless of the value of i.
492*
493* double *crval
494* (Given) Pointer to the first element of a vector of length tabprm::M
495* whose elements contain the index value for the reference pixel for each
496* of the tabular coordinate axes.
497*
498* double **index
499* (Given) Pointer to the first element of a vector of length tabprm::M of
500* pointers to vectors of lengths (K_1, K_2,... K_M) of 0-relative indexes
501* (see tabprm::K).
502*
503* The address of any or all of these index vectors may be set to zero,
504* i.e.
505*
506= index[m] == 0;
507*
508* this is interpreted as default indexing, i.e.
509*
510= index[m][k] = k;
511*
512* double *coord
513* (Given) Pointer to the first element of the tabular coordinate array,
514* treated as though it were defined as
515*
516= double coord[K_M]...[K_2][K_1][M];
517*
518* (see tabprm::K) i.e. with the M dimension varying fastest so that the
519* M elements of a coordinate vector are stored contiguously in memory.
520*
521* int nc
522* (Returned) Total number of coordinate vectors in the coordinate array
523* being the product K_1 * K_2 * ... * K_M (see tabprm::K).
524*
525* int padding
526* (An unused variable inserted for alignment purposes only.)
527*
528* int *sense
529* (Returned) Pointer to the first element of a vector of length tabprm::M
530* whose elements indicate whether the corresponding indexing vector is
531* monotonic increasing (+1), or decreasing (-1).
532*
533* int *p0
534* (Returned) Pointer to the first element of a vector of length tabprm::M
535* of interpolated indices into the coordinate array such that Upsilon_m,
536* as defined in Paper III, is equal to (p0[m] + 1) + tabprm::delta[m].
537*
538* double *delta
539* (Returned) Pointer to the first element of a vector of length tabprm::M
540* of interpolated indices into the coordinate array such that Upsilon_m,
541* as defined in Paper III, is equal to (tabprm::p0[m] + 1) + delta[m].
542*
543* double *extrema
544* (Returned) Pointer to the first element of an array that records the
545* minimum and maximum value of each element of the coordinate vector in
546* each row of the coordinate array, treated as though it were defined as
547*
548= double extrema[K_M]...[K_2][2][M]
549*
550* (see tabprm::K). The minimum is recorded in the first element of the
551* compressed K_1 dimension, then the maximum. This array is used by the
552* inverse table lookup function, tabs2x(), to speed up table searches.
553*
554* struct wcserr *err
555* (Returned) If enabled, when an error status is returned, this struct
556* contains detailed information about the error, see wcserr_enable().
557*
558* int m_flag
559* (For internal use only.)
560* int m_M
561* (For internal use only.)
562* int m_N
563* (For internal use only.)
564* int set_M
565* (For internal use only.)
566* int m_K
567* (For internal use only.)
568* int m_map
569* (For internal use only.)
570* int m_crval
571* (For internal use only.)
572* int m_index
573* (For internal use only.)
574* int m_indxs
575* (For internal use only.)
576* int m_coord
577* (For internal use only.)
578*
579*
580* Global variable: const char *tab_errmsg[] - Status return messages
581* ------------------------------------------------------------------
582* Error messages to match the status value returned from each function.
583*
584*===========================================================================*/
585
586#ifndef WCSLIB_TAB
587#define WCSLIB_TAB
588
589#ifdef __cplusplus
590extern "C" {
591#endif
592
594 TABENQ_MEM = 1, // tabprm struct memory is managed by WCSLIB.
595 TABENQ_SET = 2, // tabprm struct has been set up.
596 TABENQ_BYP = 4, // tabprm struct is in bypass mode.
597};
598
599extern const char *tab_errmsg[];
600
602 TABERR_SUCCESS = 0, // Success.
603 TABERR_NULL_POINTER = 1, // Null tabprm pointer passed.
604 TABERR_MEMORY = 2, // Memory allocation failed.
605 TABERR_BAD_PARAMS = 3, // Invalid tabular parameters.
606 TABERR_BAD_X = 4, // One or more of the x coordinates were
607 // invalid.
608 TABERR_BAD_WORLD = 5 // One or more of the world coordinates were
609 // invalid.
611
612struct tabprm {
613 // Initialization flag (see the prologue above).
614 //--------------------------------------------------------------------------
615 int flag; // Set to zero to force initialization.
616
617 // Parameters to be provided (see the prologue above).
618 //--------------------------------------------------------------------------
619 int M; // Number of tabular coordinate axes.
620 int *K; // Vector of length M whose elements
621 // (K_1, K_2,... K_M) record the lengths of
622 // the axes of the coordinate array and of
623 // each indexing vector.
624 int *map; // Vector of length M usually such that
625 // map[m-1] == i-1 for coordinate array
626 // axis m and image axis i (see above).
627 double *crval; // Vector of length M containing the index
628 // value for the reference pixel for each
629 // of the tabular coordinate axes.
630 double **index; // Vector of pointers to M indexing vectors
631 // of lengths (K_1, K_2,... K_M).
632 double *coord; // (1+M)-dimensional tabular coordinate
633 // array (see above).
634
635 // Information derived from the parameters supplied.
636 //--------------------------------------------------------------------------
637 int nc; // Number of coordinate vectors (of length
638 // M) in the coordinate array.
639 int padding; // (Dummy inserted for alignment purposes.)
640 int *sense; // Vector of M flags that indicate whether
641 // the Mth indexing vector is monotonic
642 // increasing, or else decreasing.
643 int *p0; // Vector of M indices.
644 double *delta; // Vector of M increments.
645 double *extrema; // (1+M)-dimensional array of coordinate
646 // extrema.
647
648 // Error handling
649 //--------------------------------------------------------------------------
650 struct wcserr *err;
651
652 // Private - the remainder are for memory management.
653 //--------------------------------------------------------------------------
655 int set_M;
656 int *m_K, *m_map;
658};
659
660// Size of the tabprm struct in int units, used by the Fortran wrappers.
661#define TABLEN (sizeof(struct tabprm)/sizeof(int))
662
663
664int tabini(int alloc, int M, const int K[], struct tabprm *tab);
665
666int tabmem(struct tabprm *tab);
667
668int tabcpy(int alloc, const struct tabprm *tabsrc, struct tabprm *tabdst);
669
670int tabcmp(int cmp, double tol, const struct tabprm *tab1,
671 const struct tabprm *tab2, int *equal);
672
673int tabfree(struct tabprm *tab);
674
675int tabsize(const struct tabprm *tab, int size[2]);
676
677int tabenq(const struct tabprm *tab, int enquiry);
678
679int tabprt(const struct tabprm *tab);
680
681int tabperr(const struct tabprm *tab, const char *prefix);
682
683int tabset(struct tabprm *tab);
684
685int tabx2s(struct tabprm *tab, int ncoord, int nelem, const double x[],
686 double world[], int stat[]);
687
688int tabs2x(struct tabprm *tab, int ncoord, int nelem, const double world[],
689 double x[], int stat[]);
690
691
692// Deprecated.
693#define tabini_errmsg tab_errmsg
694#define tabcpy_errmsg tab_errmsg
695#define tabfree_errmsg tab_errmsg
696#define tabprt_errmsg tab_errmsg
697#define tabset_errmsg tab_errmsg
698#define tabx2s_errmsg tab_errmsg
699#define tabs2x_errmsg tab_errmsg
700
701#ifdef __cplusplus
702}
703#endif
704
705#endif // WCSLIB_TAB
Tabular transformation parameters.
Definition tab.h:612
int padding
Definition tab.h:639
double ** m_index
Definition tab.h:657
double * crval
Definition tab.h:627
int flag
Definition tab.h:615
int * map
Definition tab.h:624
int m_N
Definition tab.h:654
struct wcserr * err
Definition tab.h:650
int nc
Definition tab.h:637
double ** m_indxs
Definition tab.h:657
int * p0
Definition tab.h:643
int * m_K
Definition tab.h:656
int M
Definition tab.h:619
int set_M
Definition tab.h:655
double * delta
Definition tab.h:644
int m_flag
Definition tab.h:654
int * m_map
Definition tab.h:656
double * extrema
Definition tab.h:645
double * m_crval
Definition tab.h:657
double * m_coord
Definition tab.h:657
double * coord
Definition tab.h:632
int * sense
Definition tab.h:640
int m_M
Definition tab.h:654
int * K
Definition tab.h:620
double ** index
Definition tab.h:630
Error message handling.
Definition wcserr.h:243
int tabx2s(struct tabprm *tab, int ncoord, int nelem, const double x[], double world[], int stat[])
Pixel-to-world transformation.
int tabsize(const struct tabprm *tab, int size[2])
Compute the size of a tabprm struct.
int tabfree(struct tabprm *tab)
Destructor for the tabprm struct.
tabenq_enum
Definition tab.h:593
@ TABENQ_MEM
Definition tab.h:594
@ TABENQ_SET
Definition tab.h:595
@ TABENQ_BYP
Definition tab.h:596
int tabset(struct tabprm *tab)
Setup routine for the tabprm struct.
int tabcmp(int cmp, double tol, const struct tabprm *tab1, const struct tabprm *tab2, int *equal)
Compare two tabprm structs for equality.
int tabperr(const struct tabprm *tab, const char *prefix)
Print error messages from a tabprm struct.
int tabprt(const struct tabprm *tab)
Print routine for the tabprm struct.
int tabenq(const struct tabprm *tab, int enquiry)
enquire about the state of a tabprm struct.
const char * tab_errmsg[]
Status return messages.
int tabcpy(int alloc, const struct tabprm *tabsrc, struct tabprm *tabdst)
Copy routine for the tabprm struct.
int tabs2x(struct tabprm *tab, int ncoord, int nelem, const double world[], double x[], int stat[])
World-to-pixel transformation.
int tabini(int alloc, int M, const int K[], struct tabprm *tab)
Default constructor for the tabprm struct.
tab_errmsg_enum
Definition tab.h:601
@ TABERR_BAD_PARAMS
Definition tab.h:605
@ TABERR_MEMORY
Definition tab.h:604
@ TABERR_SUCCESS
Definition tab.h:602
@ TABERR_BAD_WORLD
Definition tab.h:608
@ TABERR_NULL_POINTER
Definition tab.h:603
@ TABERR_BAD_X
Definition tab.h:606
int tabmem(struct tabprm *tab)
Acquire tabular memory.