IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 30, 2005, 2:14:17 PM (21 years ago)
Author:
drobbin
Message:

Changed psPixelCoord to use float's instead of int's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/types/tst_psPixels.c

    r5101 r5214  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $
     7 *  @version $Revision: 1.3 $
    88 *           $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-09-23 00:04:36 $
     9 *  @date $Date: 2005-10-01 00:14:17 $
    1010 *
    1111 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    8888    if (p1->n != p1->nalloc) {
    8989        psError(PS_ERR_UNKNOWN, true,
    90                 "psPixelsAlloc failed to set n = %d", p1->nalloc);
     90                "psPixelsAlloc failed to set n = %ld", p1->nalloc);
    9191        return 13;
    9292    }
    9393    if (p1->nalloc != 1) {
    9494        psError(PS_ERR_UNKNOWN, true,
    95                 "psPixelsAlloc failed to set nalloc = 1 (%d)",
     95                "psPixelsAlloc failed to set nalloc = 1 (%ld)",
    9696                p1->nalloc);
    9797        return 14;
     
    117117    if (p2->n != p2->nalloc) {
    118118        psError(PS_ERR_UNKNOWN, true,
    119                 "psPixelsAlloc failed to set n = %d", p2->nalloc);
     119                "psPixelsAlloc failed to set n = %ld", p2->nalloc);
    120120        return 13;
    121121    }
    122122    if (p2->nalloc != 10) {
    123123        psError(PS_ERR_UNKNOWN, true,
    124                 "psPixelsAlloc failed to set nalloc = 1 (%d)",
     124                "psPixelsAlloc failed to set nalloc = 1 (%ld)",
    125125                p2->nalloc);
    126126        return 14;
     
    192192        if (p0->data[i].x != i || p0->data[i].y != 100+i) {
    193193            psError(PS_ERR_UNKNOWN, true,
    194                     "The value of pixel %d was not preserved (%d,%d) vs (%d,%d).",
     194                    "The value of pixel %d was not preserved (%f,%f) vs (%d,%d).",
    195195                    i, p0->data[i].x, p0->data[i].y, i, 100+i);
    196196            return 15;
     
    284284        return 3;
    285285    }
    286     for (int i = 0; i < out1->n; i++) {
     286    for (long i = 0; i < out1->n; i++) {
    287287        if (out1->data[i].x != in1->data[i].x || out1->data[i].y != in1->data[i].y) {
    288288            psError(PS_ERR_UNKNOWN, true,
    289                     "failed to copy the values correctly at index %d", i);
     289                    "failed to copy the values correctly at index %ld", i);
    290290            return 4;
    291291        }
     
    402402    if (pixels->n != numRows) {
    403403        psError(PS_ERR_UNKNOWN, false,
    404                 "wrong number of pixels in list.  Got %d, should be %d.",
     404                "wrong number of pixels in list.  Got %ld, should be %d.",
    405405                pixels->n, numRows);
    406406        return 2;
    407407    }
    408408
    409     for (int i = 0; i < pixels->n; i++) {
    410         if (mask->data.PS_TYPE_MASK_DATA[pixels->data[i].y][pixels->data[i].x] != 1) {
     409    for (long i = 0; i < pixels->n; i++) {
     410        if (mask->data.PS_TYPE_MASK_DATA[(int)pixels->data[i].y][(int)pixels->data[i].x] != 1) {
    411411            psError(PS_ERR_UNKNOWN, false,
    412                     "Item in psPixels list (%d,%d) didn't coorespond to a masked value in image",
     412                    "Item in psPixels list (%f,%f) didn't coorespond to a masked value in image",
    413413                    pixels->data[i].x, pixels->data[i].y);
    414414            return 3;
     
    468468        return 3;
    469469    }
    470     for (int i = 0; i < pixels2->n; i++) {
     470    for (long i = 0; i < pixels2->n; i++) {
    471471        if (pixels2->data[i].x != pixels->data[i].x || pixels2->data[i].y != pixels->data[i].y) {
    472472            psError(PS_ERR_UNKNOWN, true,
    473                     "failed to copy the values correctly at index %d", i);
     473                    "failed to copy the values correctly at index %ld", i);
    474474            return 4;
    475475        }
     
    486486    if (pixels3->n != 15) {
    487487        psError(PS_ERR_UNKNOWN, true,
    488                 "pixels3->n != 15, == %d", pixels3->n);
     488                "pixels3->n != 15, == %ld", pixels3->n);
    489489        return 11;
    490490    }
     
    526526    out = psPixelsGet(in, 1);
    527527    if ( out.x != 3 || out.y != 13 ) {
    528         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %d,%d",
     528        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %f,%f",
    529529                out.x, out.y);
    530530        return 4;
     
    538538    out = psPixelsGet(in, 0);
    539539    if (out.x != 1 || out.y != 2) {
    540         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %d,%d",
     540        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %f,%f",
    541541                out.x, out.y);
    542542        return 6;
Note: See TracChangeset for help on using the changeset viewer.