1
/*===========================================================================
2
Copyright (C) 1994-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
19
Correspondence concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
28
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
.AUTHOR R.M. van Hees IPG-ESO Garching
32
.KEYWORDS ImageDisplay, memory board
33
.PURPOSE read a 2-D image/mask from given memory board of ImageDisplay
34
.ALGORITHM use IDI interfaces to read memory and store into real data array
36
call as void RIMG_C( chan, ittflg, bgnA, dimA, pntrA )
39
int chan : memory board to read image/mask from
40
int ittflg : if = 1, map pixel data with current ITT
41
int bgnA[2]: start screen (x,y)
42
int dimA[2]: no. of x,y-pixels on screen
45
float *pntrA : array to be filled with image for RIMG
49
#include <midas_def.h> Prototypes for MIDAS interfaces
51
.VERSIONS 1.00 940517 F2C, taken from RIMG.FOR RvH
54
------------------------------------------------------------*/
57
* Define _POSIX_SOURCE to indicate
58
* that this is a POSIX program
60
#define _POSIX_SOURCE 1
63
* definition of the used functions in this module
65
#include <midas_def.h>
68
* define some macros and constants
74
* here starts the code of the function
76
void RIMG_C( chan, ittflg, bgnA, dimA, pntrA )
77
int chan, ittflg, *bgnA, *dimA;
84
* Initialised variables
86
int imx = 0, imy = 0, kpack = 4; /* data offset and packing factor */
89
* Set up transfer window
91
(void) IIMSTW_C( QDSPNO, chan, LOADDR, *dimA, dimA[1], QMDEP, *bgnA, bgnA[1] );
94
* Read all data at once from Display memory
96
nopix = *dimA * dimA[1];
97
cdata = (unsigned char *) osmmget( nopix * sizeof( unsigned char ) );
98
(void) IIMRMY_C( QDSPNO, chan, nopix, imx, imy, QMDEP, kpack, ittflg, cdata );
103
F1UNPA_C( cdata, nopix, pntrA );
108
(void) osmmfree( (char *) cdata );