libpgplotxx.a (C++ interface to PGPLOT)

◆ create_transform()

Ttransform pgplot::pgaff::create_transform ( const Tarray::Tcoc &  a,
const pgplot::Trect rect,
const bool &  xisfirst 
)

create standard transform array

Definition at line 102 of file affpgplot.cc.

References pgplot::Trange::fullrange(), pgplot::Trange::min, pgplot::Trect::x, and pgplot::Trect::y.

Referenced by gray().

105  {
106  Ttransform retval;
107  Tarray::Tshape shape(a.shape());
108  shape.setfirst(Tarray::Tshape::TIndexVec(1));
109  retval=0.;
110  int ix,iy,ibx,iby,nx,ny,fx,fy;
111  ibx=0;
112  iby=3;
113  if (xisfirst)
114  {
115  ix=1;
116  iy=5;
117  nx=shape.size(0);
118  ny=shape.size(1);
119  fx=shape.first(0);
120  fy=shape.first(1);
121  }
122  else
123  {
124  ix=2;
125  iy=4;
126  nx=shape.size(1);
127  ny=shape.size(0);
128  fx=shape.first(1);
129  fy=shape.first(0);
130  }
131  Trange xrange=rect.x;
132  Trange yrange=rect.y;
133  retval[ix]=xrange.fullrange()/float(nx);
134  retval[iy]=yrange.fullrange()/float(ny);
135  retval[ibx]=xrange.min-retval[ix]*(float(fx)-0.5);
136  retval[iby]=yrange.min-retval[iy]*(float(fy)-0.5);
137  return(retval);
138  }
Trange x
coordinate ranges
Definition: structs.h:132
float fullrange() const
return absolute range
Definition: structs.h:91
Trange y
Definition: structs.h:132
aff::SimpleRigidArray< float, 6 > Ttransform
transform matrix for gray shade plot function
Definition: affpgplot.h:63
Here is the call graph for this function:
Here is the caller graph for this function: