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
|
include "qpoe.h"
# QP_SAVEWCS -- Save the given WCS in the QPOE header, as a variable length
# binary array (machine independent) in the default WCS parameter QPWCS.
procedure qp_savewcs (qp, mw)
pointer qp #I QPOE descriptor
pointer mw #I MWCS descriptor
pointer bp
int buflen, nchars
int mw_save(), qp_accessf()
errchk mw_save, qp_accessf, qp_addf, qp_write
string s_opaque "opaque"
string s_qpwcs QPWCS
begin
bp = NULL
buflen = 0
# Encode the WCS as a machine independent binary array.
nchars = mw_save (mw, bp, buflen)
# Save it in the QPOE header.
if (nchars > 0) {
if (qp_accessf (qp, s_qpwcs) == NO)
call qp_addf (qp, s_qpwcs,
s_opaque, 0, "World coordinate system", SF_INHERIT)
call qp_write (qp, s_qpwcs, Memc[bp], nchars, 1, s_opaque)
}
if (bp != NULL)
call mfree (bp, TY_CHAR)
end
|