IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 12, 2004, 2:10:50 PM (22 years ago)
Author:
desonia
Message:

adjusted the reference count increment so that psFPA assumes ownership
of psChips, psChips assumes ownership of psCells, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageExtraction.c

    r2022 r2067  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-10-08 19:44:32 $
     8*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-10-13 00:10:50 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2121static int testImageSubset(void);
    2222static int testImageSubsection(void);
     23static int testImageTrim(void);
     24
    2325
    2426testDescription tests[] = {
     
    2729                              {testImageSubsection,730,"psImageSubsection",0,false},
    2830                              {testImageSlice, 552, "psImageSlice", 0, false},
     31                              {testImageTrim, 744, "psImageTrim", 0, false},
    2932                              {NULL}
    3033                          };
     
    743746    return 0;
    744747}
     748
     749static int testImageTrim(void)
     750{
     751    int r = 200;
     752    int c = 300;
     753    int quarterR = r/4;
     754    int quarterC = c/4;
     755    int halfR = r/2;
     756    psImage* image = psImageAlloc(c,r,PS_TYPE_F32);
     757    for (int row = 0; row < image->numRows; row++) {
     758        for (int col = 0; col < image->numCols; col++) {
     759            image->data.F32[row][col] = ((psF32)row+1.0f)/((psF32)col+1.0f);
     760        }
     761    }
     762
     763    psImage* image1 = psImageCopy(NULL,image,PS_TYPE_F32);
     764    psImage* image2 = psImageTrim(image1,c/4,r/4,c*3/4,r*3/4);
     765
     766
     767
     768    return 0;
     769}
Note: See TracChangeset for help on using the changeset viewer.