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