~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/display/libsrc/wimclo.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)wimclo.c 19.1 (ES0-DMD) 02/25/03 14:00:02 */
 
2
/*===========================================================================
 
3
  Copyright (C) 1995 European Southern Observatory (ESO)
 
4
 
 
5
  This program is free software; you can redistribute it and/or 
 
6
  modify it under the terms of the GNU General Public License as 
 
7
  published by the Free Software Foundation; either version 2 of 
 
8
  the License, or (at your option) any later version.
 
9
 
 
10
  This program is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
  GNU General Public License for more details.
 
14
 
 
15
  You should have received a copy of the GNU General Public 
 
16
  License along with this program; if not, write to the Free 
 
17
  Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
  MA 02139, USA.
 
19
 
 
20
  Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
        Internet e-mail: midas@eso.org
 
22
        Postal address: European Southern Observatory
 
23
                        Data Management Division 
 
24
                        Karl-Schwarzschild-Strasse 2
 
25
                        D 85748 Garching bei Muenchen 
 
26
                        GERMANY
 
27
===========================================================================*/
 
28
 
 
29
/* @(#)wimclo.c 1.3 (ESO-IPG) 7/4/94 10:27:17 */
 
30
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
31
.COPYRIGHT   (c) 1994 European Southern Observatory
 
32
.IDENTIFIER  WIMCLO_C
 
33
.LANGUAGE    C
 
34
.AUTHOR      K. Banse                   IPG-ESO Garching
 
35
.KEYWORDS    Image Display, memory board
 
36
.PURPOSE     do the final things to cleanly save all information 
 
37
             about an image loaded via LOADWN(-100,...) before
 
38
.ALGORITHM   copy the stuff done in WIMGA
 
39
.INPUT/OUTPUT
 
40
  call as    WIMCLO_C( dsplay, chan, vis, frame, start, step, cuts )
 
41
 
 
42
  input:
 
43
         int    dsplay          device id
 
44
         int    chan            memory channel no.
 
45
         int    vis             visibility (1/0)
 
46
         char   *frame          name of loaded image
 
47
         double *start          world coord start(x,y) of frame
 
48
         double *step           world coord step(x,y) of frame
 
49
         float  *cuts           contains low cut, high cut, min and max
 
50
 
 
51
.RETURNS     nothing
 
52
.ENVIRONment MIDAS
 
53
             #include <midas_def.h>   Prototypes for MIDAS interfaces
 
54
             #include <idinumd.h>     Global variables for DISPLAY interfaces
 
55
 
 
56
.VERSIONS    1.00       940325  F2C, taken from LOADWN.FOR   RvH
 
57
------------------------------------------------------------*/
 
58
/*
 
59
 * Define _POSIX_SOURCE to indicate
 
60
 * that this is a POSIX program
 
61
 */
 
62
#define  _POSIX_SOURCE 1
 
63
 
 
64
/*
 
65
 * definition of the used functions in this module
 
66
 */
 
67
#include <midas_def.h>
 
68
 
 
69
/*
 
70
 * define some macros and constants
 
71
 */
 
72
#include <string.h>
 
73
#include <idinumd.h>
 
74
 
 
75
/*
 
76
 * here starts the code of the function
 
77
 */
 
78
void WIMCLO_C( dsplay, chan, vis, frame, start, step, cuts )
 
79
char   *frame;
 
80
int    dsplay, chan, vis;
 
81
float  *cuts;
 
82
double *start, *step;
 
83
{
 
84
int  nn;
 
85
 
 
86
if ( chan != QOVCH ) (void) Cdazvis( dsplay, chan, 1, vis );
 
87
 
 
88
/*
 
89
 * copy "frame" into global variable "dzmemc"
 
90
 */
 
91
(void) strcpy( dzmemc, frame );
 
92
 
 
93
/*
 
94
 * buffer DZMEMR = xsta,ysta,xend,yend,locut,hicut,min,max -> keyword IDIMEMR
 
95
 */
 
96
dzmemr[0] = (float) (start[0] + (SFPX - 1) * step[0]);
 
97
dzmemr[1] = (float) (start[1] + (SFPY - 1) * step[1]);
 
98
 
 
99
if ( SCALX < 0 )     
 
100
   nn = NSX / - SCALX;
 
101
else
 
102
   nn = NSX * SCALX;
 
103
dzmemr[2] = dzmemr[0] + (float) (nn - 1) * step[0];
 
104
 
 
105
if ( SCALY < 0 )     
 
106
   nn = NSY / - SCALY;
 
107
else
 
108
   nn = NSY * SCALY;
 
109
dzmemr[3] = dzmemr[1] + (float) (nn-1) * step[1];
 
110
 
 
111
for (nn=0; nn<4; nn++) dzmemr[nn+4] = *cuts++;
 
112
 
 
113
DCPICH(chan);
 
114
 
 
115
/*
 
116
 * now also display everything in the Image Display
 
117
 * if either we loaded into currently displayed channel or split_screen mode
 
118
 */
 
119
(void) Cdazvis( dsplay, chan, 2, 1 );
 
120
 
 
121
return;
 
122
}