IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 26, 2012, 11:46:01 AM (14 years ago)
Author:
eugene
Message:

updates for pedantic gcc, mods to relphot average mags to handle GPC1 stacks

Location:
trunk/Ohana/src/kapa2/src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/src/CheckVisual.c

    r25757 r34088  
    1010
    1111  int i, Nfound, N;
    12   int isColor, isDefault;
     12  int isDefault;
    1313  XVisualInfo *visual_list, visual_temp;
    1414  unsigned long planes[3];
     
    3535 
    3636  // set these based on selected visual
    37   isColor = isDefault = FALSE;
     37  isDefault = FALSE;
    3838
    3939  // attempt to select the most desirable type of visual: TrueColor
    4040  for (i = 0; (i < Nfound) && (visual_list[i].class != TrueColor); i++);
    4141  if (i != Nfound) {
    42     isColor = TRUE;
     42    // isColor = TRUE;
    4343    if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
    4444    isDefault = (graphic[0].visual == visual_list[i].visual);
     
    5252  for (i = 0; (i < Nfound) && (visual_list[i].class != DirectColor); i++);
    5353  if (i != Nfound) {
    54     isColor = TRUE;
     54    // isColor = TRUE;
    5555    if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
    5656    isDefault = (graphic[0].visual == visual_list[i].visual);
     
    6464  for (i = 0; (i < Nfound) && (visual_list[i].class != PseudoColor); i++);
    6565  if (i != Nfound) {
    66     isColor = TRUE;
     66    // isColor = TRUE;
    6767    if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class);
    6868    isDefault = (graphic[0].visual == visual_list[i].visual);
  • trunk/Ohana/src/kapa2/src/DrawFrame.c

    r32632 r34088  
    9191  int pos, dir, fontsize;
    9292  double size, n, pad;
    93   char string[64], *fontname;
     93  char string[64];
    9494
    9595  double fx  = axis->fx;
     
    130130    int xt, yt;
    131131
    132     fontname = GetRotFont (&fontsize);
     132    // char *fontname is returned by GetRotFont, but not used here
     133    GetRotFont (&fontsize);
    133134   
    134135    pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : fontsize + 4.0;
     
    231232
    232233  TickMarkData *ticks;
    233   double range, major, minor, first, value, dPixels, overshoot;
    234   int i, NTICKS, nPixels, done, ifirst, nsignif;
     234  double range, major, minor, first, value;
     235  int i, NTICKS, done, ifirst, nsignif;
    235236
    236237  *nticks = 0;
     
    249250
    250251  // length of the axis in pixels
    251   nPixels = hypot(axis->dfx, axis->dfy);
    252   dPixels = nPixels / range; // axis pixel-scale
     252  // int nPixels = hypot(axis->dfx, axis->dfy);
     253  // double dPixels = nPixels / range; // axis pixel-scale
    253254
    254255  AxisTickScale (axis, &major, &minor, &nsignif);
     
    263264 
    264265  // allow undershoot by 1 pixel
    265   overshoot = (axis->min - first) * dPixels;
     266  // double overshoot = (axis->min - first) * dPixels;
    266267  // if (overshoot > 0.5) {
    267268  //   if (range > 0) {
  • trunk/Ohana/src/kapa2/src/EraseOverlay.c

    r26891 r34088  
    44
    55  int i, N;
    6   Graphic *graphic;
    76  Section *section;
    87  KapaImageWidget *image;
     
    1110  KiiScanCommand (sock, 16, "%*s %d", &N);
    1211
    13   graphic = GetGraphic();
    1412  section = GetActiveSection();
    1513  image = section->image;
  • trunk/Ohana/src/kapa2/src/JPEGit24.c

    r29938 r34088  
    3333  int i_start, i_end, j_start, j_end;
    3434  int I_start, J_start;
    35   int dropback;  /* this is a bit of a kludge... */
    36   int dx, dy, DX, DY, inDX, inDY;
     35  int dx, dy, DX, inDX, inDY;
    3736  int quality;
    3837  int expand_in, expand_out;
    39   double expand, Ix, Iy;
     38  double Ix, Iy;
    4039  unsigned char *out_pix;
    4140  unsigned short *in_pix, *in_pix_ref;
     
    8584
    8685  assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2));
    87   expand = expand_in = expand_out = 1.0;
     86  expand_in = expand_out = 1.0;
    8887  if (image[0].picture.expand > 0) {
    89     expand = 1 / (1.0*image[0].picture.expand);
    9088    expand_out = image[0].picture.expand;
    9189    expand_in  = 1;
    9290  }
    9391  if (image[0].picture.expand < 0) {
    94     expand = fabs((double)image[0].picture.expand);
    9592    expand_out = 1;
    9693    expand_in  = -image[0].picture.expand;
     
    10097  dy = image[0].picture.dy;
    10198  DX = image[0].image[0].matrix.Naxis[0];
    102   DY = image[0].image[0].matrix.Naxis[1];
     99  // DY = image[0].image[0].matrix.Naxis[1];
    103100
    104101  // i_start, j_start are the closest lit screen pixel to 0,0
     
    118115  inDX = image[0].picture.flipx ? -1 : +1;
    119116  inDY = image[0].picture.flipy ? -1 : +1;
    120 
    121   dropback = expand_out - (i_end - i_start) % expand_out;
    122   if ((i_end - i_start) % expand_out == 0) dropback = 0;
    123117
    124118  /* output line buffer */
  • trunk/Ohana/src/kapa2/src/Layout.c

    r27790 r34088  
    55
    66  int N;
    7   Section *section;
    87  char *namedSocket = NULL;
    98 
     
    4342
    4443  /* create basic section, empty of image or graph */
    45   section = AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
     44  // Section *section is returned by not used
     45  AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
    4646}
  • trunk/Ohana/src/kapa2/src/PSFrame.c

    r29955 r34088  
    5757  int pos, dir, fontsize;
    5858  double size, n, pad;
    59   char string[64], *fontname;
     59  char string[64];
    6060
    6161  double fx  = axis->fx;
     
    9090    int xt, yt;
    9191
    92     fontname = GetRotFont (&fontsize);
     92    // char *fontname is returned by not needed
     93    GetRotFont (&fontsize);
    9394
    9495    pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : 0.8*fontsize + 1.0;
  • trunk/Ohana/src/kapa2/src/PSPixmap.c

    r32695 r34088  
    153153  int i_start, i_end, j_start, j_end;
    154154  int I_start, J_start;
    155   int dropback;  /* this is a bit of a kludge... */
    156   int dx, dy, DX, DY, inDX, inDY, Xs, Ys;
     155  int dx, dy, DX, inDX, inDY;
    157156  int expand_in, expand_out;
    158   double expand, Ix, Iy;
     157  double Ix, Iy;
    159158  unsigned short *in_pix, *in_pix_ref;
    160159  unsigned char *pixel1, *pixel2, *pixel3;
     
    174173
    175174  assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2));
    176   expand = expand_in = expand_out = 1.0;
     175  expand_in = expand_out = 1.0;
    177176  if (image[0].picture.expand > 0) {
    178     expand = 1 / (1.0*image[0].picture.expand);
    179177    expand_out = image[0].picture.expand;
    180178    expand_in  = 1;
    181179  }
    182180  if (image[0].picture.expand < 0) {
    183     expand = fabs((double)image[0].picture.expand);
    184181    expand_out = 1;
    185182    expand_in  = -image[0].picture.expand;
    186183  }
    187184
    188   Xs = image[0].picture.x;
    189   Ys = image[0].picture.y;
    190185  dx = image[0].picture.dx;
    191186  dy = image[0].picture.dy;
    192187  DX = image[0].image[0].matrix.Naxis[0];
    193   DY = image[0].image[0].matrix.Naxis[1];
    194188
    195189  // i_start, j_start are the closest lit screen pixel to 0,0
     
    209203  inDX = image[0].picture.flipx ? -1 : +1;
    210204  inDY = image[0].picture.flipy ? -1 : +1;
    211 
    212   dropback = expand_out - (i_end - i_start) % expand_out;
    213   if ((i_end - i_start) % expand_out == 0) dropback = 0;
    214205
    215206  in_pix_ref  = &image[0].pixmap[DX*(int)MAX(Iy,0) + (int)MAX(Ix,0)];
  • trunk/Ohana/src/kapa2/src/PaintOverlay.c

    r25757 r34088  
    55  int i;
    66  int dX, dY, dx, dy;
    7   int Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
     7  int Xmin, Ymin, Xmax, Ymax;
    88  double t, expand, X, Y, pX, pY;
    99 
     
    2323  Xmax = image[0].picture.x + image[0].picture.dx;
    2424  Ymax = image[0].picture.y + image[0].picture.dy;
    25   Xrange = image[0].picture.dx;
    26   Yrange = image[0].picture.dy;
    2725
    2826  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
  • trunk/Ohana/src/kapa2/src/Remap16.c

    r25978 r34088  
    1313  int I_start, J_start;
    1414  int dropback, inDX, inDY;
    15   int dx, dy, DX, DY;
    16   double expand, Ix, Iy;
     15  int dx, dy, DX;
     16  double Ix, Iy;
    1717  int expand_in, expand_out;
    1818  OUT_TYPE *out_pix, *out_pix2, *data;
     
    4949  if (picture[0].expand == -1) picture[0].expand = 1;
    5050  assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
    51   expand = expand_in = expand_out = 1.0;
     51  expand_in = expand_out = 1.0;
    5252  if (picture[0].expand > 0) {
    53     expand = 1 / (1.0*picture[0].expand);
    5453    expand_out = picture[0].expand;
    5554    expand_in  = 1;
    5655  }
    5756  if (picture[0].expand < 0) {
    58     expand = fabs((double)picture[0].expand);
    5957    expand_out = 1;
    6058    expand_in  = -picture[0].expand;
     
    6563  dy = picture[0].dy;
    6664  DX = matrix[0].Naxis[0];
    67   DY = matrix[0].Naxis[1];
     65  // int DY = matrix[0].Naxis[1];
    6866
    6967  // i_start, j_start are the closest lit screen pixel to 0,0
  • trunk/Ohana/src/kapa2/src/Remap24.c

    r25978 r34088  
    77  int I_start, J_start;
    88  int dropback, extra, inDX, inDY;
    9   int dx, dy, DX, DY;
    10   double expand, Ix, Iy;
     9  int dx, dy, DX;
     10  double Ix, Iy;
    1111  int expand_in, expand_out;
    1212  unsigned char *out_pix, *out_pix2, *data;
     
    3333  if (picture[0].expand == -1) picture[0].expand = 1;
    3434  assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
    35   expand = expand_in = expand_out = 1.0;
     35  expand_in = expand_out = 1.0;
    3636  if (picture[0].expand == 0) /* set up expansions */
    3737    picture[0].expand = 1;
    3838  if (picture[0].expand > 0) {
    39     expand = 1 / (1.0*picture[0].expand);
    4039    expand_out = picture[0].expand;
    4140    expand_in  = 1;
    4241  }
    4342  if (picture[0].expand < 0) {
    44     expand = fabs((double)picture[0].expand);
    4543    expand_out = 1;
    4644    expand_in  = -picture[0].expand;
     
    5048  dy = picture[0].dy;
    5149  DX = matrix[0].Naxis[0];
    52   DY = matrix[0].Naxis[1];
     50  // int DY = matrix[0].Naxis[1];
    5351
    5452  // each row is padded to a 4-byte word
  • trunk/Ohana/src/kapa2/src/Remap32.c

    r25978 r34088  
    1616  int I_start, J_start;
    1717  int dropback, inDX, inDY;
    18   int dx, dy, DX, DY;
    19   double expand, Ix, Iy;
     18  int dx, dy, DX;
     19  double Ix, Iy;
    2020  int expand_in, expand_out;
    2121  OUT_TYPE *out_pix, *out_pix2, *data;
     
    5252  if (picture[0].expand == -1) picture[0].expand = 1;
    5353  assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
    54   expand = expand_in = expand_out = 1.0;
     54  expand_in = expand_out = 1.0;
    5555  if (picture[0].expand > 0) {
    56     expand = 1 / (1.0*picture[0].expand);
    5756    expand_out = picture[0].expand;
    5857    expand_in  = 1;
    5958  }
    6059  if (picture[0].expand < 0) {
    61     expand = fabs((double)picture[0].expand);
    6260    expand_out = 1;
    6361    expand_in  = -picture[0].expand;
     
    6866  dy = picture[0].dy;
    6967  DX = matrix[0].Naxis[0];
    70   DY = matrix[0].Naxis[1];
     68  // int DY = matrix[0].Naxis[1];
    7169
    7270  // i_start, j_start are the closest lit screen pixel to 0,0
  • trunk/Ohana/src/kapa2/src/Remap8.c

    r25978 r34088  
    88  int I_start, J_start;
    99  int dropback, inDX, inDY;
    10   int dx, dy, DX, DY;
    11   double expand, Ix, Iy;
     10  int dx, dy, DX;
     11  double Ix, Iy;
    1212  int expand_in, expand_out;
    1313  OUT_TYPE *out_pix, *out_pix2, *data;
     
    3232  if (picture[0].expand == -1) picture[0].expand = 1;
    3333  assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
    34   expand = expand_in = expand_out = 1.0;
     34  expand_in = expand_out = 1.0;
    3535  if (picture[0].expand == 0) /* set up expansions */
    3636    picture[0].expand = 1;
    3737  if (picture[0].expand > 0) {
    38     expand = 1 / (1.0*picture[0].expand);
    3938    expand_out = picture[0].expand;
    4039    expand_in  = 1;
    4140  }
    4241  if (picture[0].expand < 0) {
    43     expand = fabs((double)picture[0].expand);
    4442    expand_out = 1;
    4543    expand_in  = -picture[0].expand;
     
    5048  dy = picture[0].dy;
    5149  DX = matrix[0].Naxis[0];
    52   DY = matrix[0].Naxis[1];
     50  // int DY = matrix[0].Naxis[1];
    5351
    5452  // i_start, j_start are the closest lit screen pixel to 0,0
  • trunk/Ohana/src/kapa2/src/SetGraphSize.c

    r29938 r34088  
    7777  double minPADx, maxPADx, minPADy;
    7878  double minPAD, maxPAD;
    79   char string[64], *fontname;
     79  char string[64];
    8080  KapaGraphWidget *graph;
    8181  Graphic *graphic;
     
    9797
    9898  graphic = GetGraphic ();
    99   fontname = GetRotFont (&fontsize);
     99  // char *fontname;
     100  GetRotFont (&fontsize);
    100101
    101102  minPAD = 1.0*fontsize + 0;
  • trunk/Ohana/src/kapa2/src/SetImageData.c

    r31160 r34088  
    33int SetImageData (int sock) {
    44 
    5   Graphic *graphic;
    65  Section *section;
    76  KapaImageWidget *image;
    87
    9   graphic = GetGraphic();
     8  // XXX needed for XClearWindow below
     9  // Graphic *graphic = GetGraphic();
    1010
    1111  section = GetActiveSection();
     
    5353int SetImageCoords (int sock) {
    5454 
    55   Graphic *graphic;
    5655  Section *section;
    5756  KapaImageWidget *image;
    58 
    59   graphic = GetGraphic();
    6057
    6158  section = GetActiveSection();
  • trunk/Ohana/src/kapa2/src/bDrawFrame.c

    r29955 r34088  
    6060  int pos, dir, fontsize;
    6161  double size, n, pad;
    62   char string[64], *fontname;
     62  char string[64];
    6363
    6464  double fx  = axis->fx;
     
    9393    int xt, yt;
    9494
    95     fontname = GetRotFont (&fontsize);
     95    // char *fontname is returned but ignored
     96    GetRotFont (&fontsize);
    9697
    9798    pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : 0.8*fontsize + 1.0;
  • trunk/Ohana/src/kapa2/src/bDrawImage.c

    r32695 r34088  
    1111  int i_start, i_end, j_start, j_end;
    1212  int I_start, J_start;
    13   int dropback;  /* this is a bit of a kludge... */
    14   int dx, dy, DX, DY, inDX, inDY, Xs, Ys;
     13  // int dropback;  /* this is a bit of a kludge... */
     14  int dx, dy, DX, inDX, inDY, Xs, Ys;
    1515  int expand_in, expand_out;
    16   double expand, Ix, Iy;
     16  double Ix, Iy;
    1717  unsigned char *out_pix;
    1818  unsigned short *in_pix, *in_pix_ref;
     
    3535
    3636  assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2));
    37   expand = expand_in = expand_out = 1.0;
     37  expand_in = expand_out = 1.0;
    3838  if (image[0].picture.expand > 0) {
    39     expand = 1 / (1.0*image[0].picture.expand);
    4039    expand_out = image[0].picture.expand;
    4140    expand_in  = 1;
    4241  }
    4342  if (image[0].picture.expand < 0) {
    44     expand = fabs((double)image[0].picture.expand);
    4543    expand_out = 1;
    4644    expand_in  = -image[0].picture.expand;
     
    5351  dy = image[0].picture.dy;
    5452  DX = image[0].image[0].matrix.Naxis[0];
    55   DY = image[0].image[0].matrix.Naxis[1];
     53  // int DY = image[0].image[0].matrix.Naxis[1];
    5654
    5755  // the created buffer is supposed to contain the output windows
     
    8280  inDY = image[0].picture.flipy ? -1 : +1;
    8381
    84   dropback = expand_out - (i_end - i_start) % expand_out;
    85   if ((i_end - i_start) % expand_out == 0) dropback = 0;
     82  // dropback = expand_out - (i_end - i_start) % expand_out;
     83  // if ((i_end - i_start) % expand_out == 0) dropback = 0;
    8684
    8785  ALLOCATE (line_buffer, bDrawColor, 3*dx);
  • trunk/Ohana/src/kapa2/src/bDrawOverlay.c

    r29938 r34088  
    88  int i;
    99  int dx, dy;
    10   int Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
     10  int Xmin, Ymin, Xmax, Ymax;
    1111  double expand, X, Y, dX, dY, pX, pY;
    1212  bDrawColor color;
     
    2828  Xmax = image[0].picture.dx;
    2929  Ymax = image[0].picture.dy;
    30   Xrange = image[0].picture.dx;
    31   Yrange = image[0].picture.dy;
    3230
    3331  if (N == INFRONT) {
Note: See TracChangeset for help on using the changeset viewer.