Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

volpack.h

Go to the documentation of this file.
00001 /*
00002  * volpack.h
00003  *
00004  * Header file for VolPack.
00005  *
00006  * Copyright (c) 1994 The Board of Trustees of The Leland Stanford
00007  * Junior University.  All rights reserved.
00008  *
00009  * Permission to use, copy, modify and distribute this software and its
00010  * documentation for any purpose is hereby granted without fee, provided
00011  * that the above copyright notice and this permission notice appear in
00012  * all copies of this software and that you do not sell the software.
00013  * Commercial licensing is available by contacting the author.
00014  * 
00015  * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
00016  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
00017  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00018  *
00019  * Author:
00020  *    Phil Lacroute
00021  *    Computer Systems Laboratory
00022  *    Electrical Engineering Dept.
00023  *    Stanford University
00024  */
00025 
00026 /*
00027  * $Date: 2001/12/17 16:16:20 $
00028  * $Revision: 1.1 $
00029  */
00030 
00031 #ifndef _VOLPACK
00032 #define _VOLPACK
00033 
00034 /*******************************************************************
00035  * Definitions to customize declarations for different C dialects. *
00036  *******************************************************************/
00037 
00038 #define ANSI_C   /* RWCox */
00039 
00040 #ifdef __STDC__
00041 #ifndef NO_PROTOTYPE
00042 #define ANSI_C
00043 #endif
00044 #endif
00045 
00046 #ifdef __cplusplus
00047 #define ANSI_C
00048 #define EXTERN extern "C"
00049 #else
00050 #define EXTERN extern
00051 #endif
00052 
00053 #ifdef ANSI_C
00054 #define ANSI_ARGS(x)    x
00055 #else
00056 #define ANSI_ARGS(x)    ()
00057 #endif
00058 
00059 /*******************************************************************
00060  * Configuration constants.                                        *
00061  *******************************************************************/
00062 
00063 #define VP_EPS  1.0e-11         /* smallest reasonable nonzero number */
00064 #define VP_MAX_VOLUME_DIM 1024  /* maximum length of a voxel scanline */
00065 #define VP_MAX_FIELDS   6       /* maximum number of fields in a voxel */
00066 #define VP_MAX_MATERIAL 6       /* maximum number of materials in a volume */
00067 #define VP_MAX_LIGHTS   6       /* maximum number of lights */
00068 
00069 /* magic numbers for disk files */
00070 #define VP_CVFILE_MAGIC         0x4F4F5F5F /* classified volume file */
00071 #define VP_OCTFILE_MAGIC        0x4F4F6F6F /* min-max octree file */
00072 #define VP_RVFILE_MAGIC         0x4F4F7F7F /* raw volume file */
00073 #define VP_VPCFILE_MAGIC        0x4F4F8F8F /* rendering context dump */
00074 
00075 #define VP_VERSION              "1.1"   /* version string */
00076 #define VP_MAJOR_VERSION        1       /* major version number */
00077 #define VP_MINOR_VERSION        1       /* minor version number */
00078 
00079 /*******************************************************************
00080  * Global constants.                                               *
00081  *******************************************************************/
00082 
00083 /* options for vpGet* and vpSet* */
00084 #define VP_XLEN                 1000    /* x dimension of volume */
00085 #define VP_YLEN                 1001    /* y dimension of volume */
00086 #define VP_ZLEN                 1002    /* z dimension of volume */
00087 #define VP_BYTES_PER_VOXEL      1003    /* size of raw voxel in bytes */
00088 #define VP_VOXEL_FIELD_COUNT    1004    /* number of fields in a voxel */
00089 #define VP_SHADE_FIELD_COUNT    1005    /* number of fields for shading */
00090 #define VP_FIELD_SIZES          1006    /* size of each field */
00091 #define VP_FIELD_OFFSETS        1007    /* byte offsets for each field */
00092 #define VP_FIELD_MAXES          1008    /* max. value for each field */
00093 #define VP_VOXEL_DATA           1009    /* pointer to voxel data */
00094 #define VP_VOXEL_DATA_SIZE      1010    /* size of voxel data in bytes */
00095 #define VP_VOXEL_XSTRIDE        1011    /* voxel data strides */
00096 #define VP_VOXEL_YSTRIDE        1012    /* voxel data strides */
00097 #define VP_VOXEL_ZSTRIDE        1013    /* voxel data strides */
00098 #define VP_MIN_VOXEL_OPACITY    1014    /* thresh. for classification */
00099 #define VP_CLASSIFY_FIELD_COUNT 1015    /* number of fields for classifier */
00100 #define VP_CLASSIFY_FIELDS      1016    /* classification field numbers */
00101 #define VP_CLASSIFY_TABLES      1017    /* classification tables */
00102 #define VP_CLASSIFY_TABLE_SIZES 1018    /* classification table sizes */
00103 #define VP_COLOR_CHANNELS       1019    /* number of color channels */
00104 #define VP_SHADE_FUNC           1020    /* shading callback */
00105 #define VP_GRAY_SHADE_FUNC      1021    /* grayscale shading function */
00106 #define VP_RGB_SHADE_FUNC       1022    /* RGB shading function */
00107 #define VP_SHADE_COLOR_TABLE    1023    /* shading color lookup table */
00108 #define VP_SHADE_COLOR_SIZE     1024    /* size of shading color table */
00109 #define VP_SHADE_WEIGHT_TABLE   1025    /* shading weight lookup table */
00110 #define VP_SHADE_WEIGHT_SIZE    1026    /* size of shading weight table */
00111 #define VP_SHADE_COLOR_FIELD    1027    /* field for color table index */
00112 #define VP_SHADE_WEIGHT_FIELD   1028    /* field for weight table index */
00113 #define VP_LIGHT_BOTH_SIDES     1029    /* use two-sided lighting */
00114 #define VP_REVERSE_SURFACE_SIDES 1030   /* reverse interior and exterior */
00115 #define VP_DEPTH_CUE            1031    /* depth cueing */
00116 #define VP_DEPTH_CUE_FRONT      1032    /* depth cueing front factor */
00117 #define VP_DEPTH_CUE_DENSITY    1034    /* depth cueing density */
00118 #define VP_DEPTH_CUE_TABLE_SIZE 1035    /* # of entries in depth-cue table */
00119 #define VP_DEPTH_CUE_SIZE_HINT  1036    /* hint for # of entries */
00120 #define VP_DEPTH_CUE_QUANTIZATION 1037  /* smallest resolvable depth */
00121 #define VP_CONCAT_MODE          1038    /* VP_CONCAT_LEFT or VP_CONCAT_RIGHT */
00122 #define VP_IMAGE                1039    /* image array */
00123 #define VP_IMAGE_WIDTH          1040    /* image width */
00124 #define VP_IMAGE_HEIGHT         1041    /* image height */
00125 #define VP_IMAGE_SCAN_SIZE      1042    /* bytes per scan in image */
00126 #define VP_MAX_RAY_OPACITY      1043    /* thresh. for early ray termination */
00127 #define VP_VIEW_AXIS            1044    /* principal viewing axis */
00128 #define VP_INTERMEDIATE_WIDTH   1045    /* width of intermediate image */
00129 #define VP_INTERMEDIATE_HEIGHT  1046    /* height of intermediate image */
00130 #define VP_INTERMEDIATE_COLOR   1047    /* color channels in int. image */
00131 #define VP_INT_WIDTH_HINT       1048    /* hint for intermediate image */
00132 #define VP_INT_HEIGHT_HINT      1049    /* hint for intermediate height */
00133 #define VP_VIEW_X_AXIS          1050    /* enable X viewing axis */
00134 #define VP_VIEW_Y_AXIS          1051    /* enable Y viewing axis */
00135 #define VP_VIEW_Z_AXIS          1052    /* enable Z viewing axis */
00136 #define VP_VIEW_X_SIZE          1053    /* size of X view data */
00137 #define VP_VIEW_Y_SIZE          1054    /* size of Y view data */
00138 #define VP_VIEW_Z_SIZE          1055    /* size of Z view data */
00139 #define VP_MMOCTREE_THRESHOLDS  1056    /* thresholds for min-max octree */
00140 #define VP_MMOCTREE_SIZE        1057    /* size of min-max octree */
00141 #define VP_LOG_ALLOC_FUNC       1058    /* function to log allocations */
00142 #define VP_LOG_FREE_FUNC        1059    /* function to log deallocations */
00143 #define VP_STATUS_FUNC          1060    /* function to give progress reports */
00144 #define VP_READ_FUNC            1061    /* function to read from file */
00145 #define VP_WRITE_FUNC           1062    /* function to write to file */
00146 #define VP_MMAP_FUNC            1063    /* function to memory map a file */
00147 #define VP_CLIENT_FUNC          1064    /* client data */
00148 #define VP_MATERIAL_COUNT       1065    /* number of materials */
00149 #define VP_CURRENT_MATRIX       1066    /* current transformation matrix */
00150 #define VP_CLIENT_DATA          1067    /* client data */
00151 #define VP_SHADOW               1068    /* enable shadows */
00152 #define VP_SHADOW_LIGHT         1069    /* light number for shadows */
00153 #define VP_SHADOW_WIDTH_HINT    1070    /* hint for width of shadow buffer */
00154 #define VP_SHADOW_HEIGHT_HINT   1071    /* hint for height of shadow buffer */
00155 #define VP_SHADOW_WIDTH         1072    /* width of shadow image */
00156 #define VP_SHADOW_HEIGHT        1073    /* height of shadow image */
00157 #define VP_SHADOW_COLOR_TABLE   1074    /* shadow color lookup table */
00158 #define VP_SHADOW_COLOR_SIZE    1075    /* size of shadow color table */
00159 #define VP_SHADOW_BIAS          1076    /* shadow bias distance */
00160 #define VP_PIXEL_TYPE           1077    /* image pixel type */
00161 #define VP_CLAMP_SHADE_TABLE    1078    /* clamp shade table entries */
00162 #define VP_COMPOSITE_ORDER      1079    /* slice compositing order */
00163 #define VP_AXIS_OVERRIDE        1080    /* override for best_view_axis */
00164 #define VP_TRACE_SHADOW_K       1081    /* slice number for shadow tracing */
00165 
00166 /* light numbers for vpSetLight */
00167 #define VP_LIGHT0               2000
00168 #define VP_LIGHT1               2001
00169 #define VP_LIGHT2               2002
00170 #define VP_LIGHT3               2003
00171 #define VP_LIGHT4               2004
00172 #define VP_LIGHT5               2005
00173 
00174 /* property codes for vpSetLight */
00175 #define VP_COLOR                2100    /* light color */
00176 #define VP_DIRECTION            2101    /* light direction */
00177 
00178 /* material numbers for vpSetMaterial */
00179 #define VP_MATERIAL0            2200
00180 #define VP_MATERIAL1            2201
00181 #define VP_MATERIAL2            2202
00182 #define VP_MATERIAL3            2203
00183 #define VP_MATERIAL4            2204
00184 #define VP_MATERIAL5            2205
00185 
00186 /* property codes for vpSetMaterial */
00187 #define VP_AMBIENT              2300    /* ambient material coefficients */
00188 #define VP_DIFFUSE              2301    /* diffuse material coefficients */
00189 #define VP_SPECULAR             2302    /* specular material coefficients */
00190 #define VP_SHINYNESS            2303    /* specular exponent */
00191 
00192 
00193 /* projection types for vpWindow and vpWindowPHIGS */
00194 #define VP_PARALLEL             2400    /* parallel projection */
00195 #define VP_PERSPECTIVE          2401    /* perspective projection */
00196 
00197 /* volume type codes for vpExtract */
00198 #define VP_RAW_VOLUME           2500    /* unclassified volume */
00199 #define VP_CLASSIFIED_VOLUME    2501    /* classified volume, optimal view */
00200 #define VP_CLX_VOLUME           2502    /* classified volume, X view */
00201 #define VP_CLY_VOLUME           2503    /* classified volume, Y view */
00202 #define VP_CLZ_VOLUME           2504    /* classified volume, Z view */
00203 
00204 /* matrix concatenation modes for vpSeti(VP_CONCAT_MODE) */
00205 #define VP_CONCAT_RIGHT         2600    /* concatenate matrices on right */
00206 #define VP_CONCAT_LEFT          2601    /* concatenate matrices on left */
00207 
00208 /* surface side codes for vpSetMaterial (these are bit fields) */
00209 #define VP_EXTERIOR             1
00210 #define VP_INTERIOR             2
00211 #define VP_BOTH_SIDES           (VP_EXTERIOR | VP_INTERIOR)
00212 
00213 /* principal axes (used as array indexes) */
00214 #define VP_X_AXIS               0
00215 #define VP_Y_AXIS               1
00216 #define VP_Z_AXIS               2
00217 #define VP_NO_AXIS              -1
00218 
00219 /* transformation matrices (used as array indexes) */
00220 #define VP_MODEL                0   /* modelling transform (object -> world) */
00221 #define VP_VIEW                 1   /* viewing transform (world -> eye) */
00222 #define VP_PROJECT              2   /* projection transform (eye -> clip) */
00223 #define VP_SCREEN               8   /* screen transform (object -> screen) */
00224 
00225 /* special field type codes */
00226 #define VP_SKIP_FIELD           -1      /* ignore a field */
00227 #define VP_OPACITY_FIELD        -2      /* compute opacity */
00228 #define VP_CORRECTED_OPAC_FIELD -3      /* compute opac. corrected for view */
00229 #define VP_COLOR_FIELD          -4      /* compute color */
00230 
00231 /* buffer codes */
00232 #define VP_IMAGE_BUFFER         4000    /* intermediate image buffer */
00233 #define VP_SHADOW_BUFFER        4001    /* shadow buffer */
00234 
00235 /* pixel formats */
00236 #define VP_ALPHA                5000    /* opacity */
00237 #define VP_LUMINANCE            5001    /* grayscale color */
00238 #define VP_LUMINANCEA           5002    /* grayscale color + opacity */
00239 #define VP_RGB                  5003    /* RGB color */
00240 #define VP_RGBA                 5004    /* RGB color + opacity */
00241 #define VP_BGR                  5005    /* RGB color, reverse byte order */
00242 #define VP_ABGR                 5006    /* RGB color + opacity, reverse order*/
00243 
00244 /* voxel fields computed by vpScanlineNormals */
00245 #define VP_NORM_SIZE            2       /* 2 byte normal index */
00246 #define VP_SCALAR_SIZE          1       /* 1 byte scalar value */
00247 #define VP_GRAD_SIZE            1       /* 1 byte gradient magnitude */
00248 
00249 #define VP_NORM_MAX             7923    /* maximum value of a 13 bit normal */
00250 #define VP_SCALAR_MAX           255     /* maximum value of a scalar */
00251 #define VP_GRAD_MAX             221     /* maximum value of a gradient */
00252 
00253 #define VP_OPACITY_MAX          255     /* maximum value of an opacity */
00254 
00255 /* data types */
00256 #define VP_UCHAR                1200    /* unsigned char */
00257 #define VP_USHORT               1201    /* unsigned short */
00258 #define VP_FLOAT                1202    /* float */
00259 
00260 /* filter types */
00261 #define VP_BOX_FILTER           1300    /* box filter */
00262 #define VP_LINEAR_FILTER        1301    /* linear filter (triangle) */
00263 #define VP_GAUSSIAN_FILTER      1302    /* gaussian, sigma defined below */
00264 #define VP_BSPLINE_FILTER       1303    /* cubic bspline filter */
00265 #define VP_MITCHELL_FILTER      1304    /* Mitchell bicubic filter */
00266 
00267 #define VP_GAUSSIAN_SIGMA       0.4
00268 
00269 /*******************************************************************
00270  * Macros.                                                         *
00271  *******************************************************************/
00272 
00273 /* set fields of a vector */
00274 #define vpSetVector3(v, v0, v1, v2)     v[0]=v0; v[1]=v1; v[2]=v2
00275 #define vpSetVector4(v, v0, v1, v2, v3) v[0]=v0; v[1]=v1; v[2]=v2; v[3]=v3
00276 
00277 /* compute an offset to a field in a structure */
00278 #define vpFieldOffset(ptr, field)       ((char *)&(ptr)->field - (char *)(ptr))
00279 
00280 /*******************************************************************
00281  * Data type definitions.                                          *
00282  *******************************************************************/
00283 
00284 typedef unsigned vpResult;              /* result code */
00285 typedef double vpVector3[3];            /* 3 element vector */
00286 typedef double vpVector4[4];            /* 4 element vector */
00287 typedef double vpMatrix3[3][3];         /* 3 by 3 element matrix */
00288 typedef double vpMatrix4[4][4];         /* 4 by 4 element matrix */
00289 
00290 typedef struct _vp_context vpContext;
00291 
00292 /*******************************************************************
00293  * Debugging codes.                                                *
00294  *******************************************************************/
00295 
00296 #define VPDEBUG_VIEW            0       /* view transform calculations */
00297 #define VPDEBUG_RENDER          1       /* high-level rendering stages */
00298 #define VPDEBUG_RBUF            2       /* render buffer allocation */
00299 #define VPDEBUG_OPCCORRECT      3       /* opacity correction */
00300 #define VPDEBUG_DEPTHCUE        4       /* depth cueing */
00301 #define VPDEBUG_PYRAMID         5       /* pyramid construction */
00302 #define VPDEBUG_OCTREE          6       /* octree construction */
00303 #define VPDEBUG_CLSFYOCTREE     7       /* octree classification */
00304 #define VPDEBUG_OCTREERUNS      8       /* runs computed from octree */
00305 #define VPDEBUG_OCTREETRAVERSE  9       /* octree traversal */
00306 #define VPDEBUG_TRANSPOSE       10      /* volume transposing */
00307 #define VPDEBUG_COMPOSITE       11      /* compositing */
00308 #define VPDEBUG_SHADOW          12      /* shadows */
00309 #define VPDEBUG_COUNT           13      /* total number of codes */
00310 
00311 /*******************************************************************
00312  * Timer codes.                                                    *
00313  *******************************************************************/
00314 
00315 #define VPTIMER_SHADE           0       /* compute shading lookup table */
00316 #define VPTIMER_COMPOSITE       1       /* compositing loop */
00317 #define VPTIMER_DEPTHCUE        2       /* depth cueing fixup loop */
00318 #define VPTIMER_WARP            3       /* 2D warp */
00319 #define VPTIMER_TRAVERSE_RUNS   4       /* traverse runs during compositing */
00320 #define VPTIMER_PROCESS_VOXELS  5       /* process voxels during compositing */
00321 #define VPTIMER_ERT             6       /* early ray termination overhead */
00322 #define VPTIMER_CLSFY_OCTREE    7       /* classify octree nodes */
00323 #define VPTIMER_TRAVERSE_OCTREE 8       /* traverse octree nodes */
00324 #define VPTIMER_RENDER          9       /* render */
00325 #define VPTIMER_CLEAR          10       /* clear intermediate image */
00326 #define VPTIMER_COUNT          11       /* total number of codes */
00327 
00328 /*******************************************************************
00329  * Error codes.                                                    *
00330  *******************************************************************/
00331 
00332 #define VP_OK   0                       /* successful return */
00333 #define VPERROR_FIRST           1000
00334 #define VPERROR_LIMIT_EXCEEDED  1000    /* exceeded a built-in limit */
00335 #define VPERROR_SINGULAR        1001    /* singular vector or matrix */
00336 #define VPERROR_IO              1002    /* file I/O error */
00337 #define VPERROR_BAD_SIZE        1003    /* invalid buffer size */
00338 #define VPERROR_BAD_IMAGE       1004    /* invalid image definition */
00339 #define VPERROR_BAD_SHADER      1005    /* invalid shader definition */
00340 #define VPERROR_BAD_CLASSIFIER  1006    /* invalid classifier definition */
00341 #define VPERROR_BAD_VOLUME      1007    /* invalid volume definition */
00342 #define VPERROR_BAD_VOXEL       1008    /* invalid voxel definition */
00343 #define VPERROR_BAD_OPTION      1009    /* invalid option code */
00344 #define VPERROR_BAD_VALUE       1010    /* argument out of range */
00345 #define VPERROR_BAD_FILE        1011    /* file has bad magic number */
00346 #define VPERROR_BAD_SHADOW      1012    /* cannot compute shadow buffer */
00347 #define VPERROR_LAST            1012
00348 
00349 /*******************************************************************
00350  * Global variables.                                               *
00351  *******************************************************************/
00352 
00353 EXTERN char *vpCompilerOptions;
00354 
00355 /*******************************************************************
00356  * Function declarations.                                          *
00357  *******************************************************************/
00358 
00359 /* contexts */
00360 EXTERN vpContext *          vpCreateContext ANSI_ARGS((void));
00361 EXTERN void                 vpDestroyContext ANSI_ARGS((vpContext *vpc));
00362 
00363 /* volumes */
00364 EXTERN vpResult             vpSetVolumeSize ANSI_ARGS((vpContext *vpc,
00365                                 int xlen, int ylen, int zlen));
00366 EXTERN vpResult             vpSetVoxelSize ANSI_ARGS((vpContext *vpc,
00367                                 int bytes_per_voxel, int num_voxel_fields,
00368                                 int num_shade_fields, int num_clsfy_fields));
00369 EXTERN vpResult             vpSetVoxelField ANSI_ARGS((vpContext *vpc,
00370                                 int field_num, int field_size,
00371                                 int field_offset, int field_max));
00372 EXTERN vpResult             vpSetRawVoxels ANSI_ARGS((vpContext *vpc,
00373                                 void *raw_voxels, int raw_voxels_size,
00374                                 int xstride, int ystride, int zstride));
00375 
00376 /* classification */
00377 EXTERN vpResult             vpSetClassifierTable ANSI_ARGS((vpContext *vpc,
00378                                 int param_num, int param_field, float *table,
00379                                 int table_size));
00380 EXTERN vpResult             vpClassifyScalars ANSI_ARGS((vpContext *vpc,
00381                                 unsigned char *scalar_data, int length,
00382                                 int scalar_field, int grad_field,
00383                                 int norm_field));
00384 EXTERN vpResult             vpClassifyVolume ANSI_ARGS((vpContext *vpc));
00385 EXTERN vpResult             vpClassifyScanline ANSI_ARGS((vpContext *vpc,
00386                                 void *voxels));
00387 EXTERN vpResult             vpDestroyClassifiedVolume ANSI_ARGS((
00388                                 vpContext *vpc));
00389 EXTERN vpResult             vpMinMaxOctreeThreshold ANSI_ARGS((vpContext *vpc,
00390                                 int param, int range));
00391 EXTERN vpResult             vpCreateMinMaxOctree ANSI_ARGS((vpContext *vpc,
00392                                 int root_node_size, int base_node_size));
00393 EXTERN vpResult             vpDestroyMinMaxOctree ANSI_ARGS((vpContext *vpc));
00394 EXTERN vpResult             vpOctreeMask ANSI_ARGS((vpContext *vpc,
00395                                 unsigned char *array, int array_size,
00396                                 int max_level));
00397 
00398 /* shading */
00399 EXTERN vpResult             vpSetLookupShader ANSI_ARGS((vpContext *vpc,
00400                                 int color_channels, int num_materials,
00401                                 int color_field, float *color_table,
00402                                 int color_table_size, int weight_field,
00403                                 float *weight_table, int weight_table_size));
00404 EXTERN vpResult             vpSetShadowLookupShader ANSI_ARGS((vpContext *vpc,
00405                                 int color_channels, int num_materials,
00406                                 int color_field, float *color_table,
00407                                 int color_table_size, int weight_field,
00408                                 float *weight_table, int weight_table_size,
00409                                 float *shadow_table, int shadow_table_size));
00410 EXTERN vpResult             vpSetMaterial ANSI_ARGS((vpContext *vpc,
00411                                 int material, int property, int surface_side,
00412                                 double r, double g, double b));
00413 EXTERN vpResult             vpSetLight ANSI_ARGS((vpContext *vpc,
00414                                 int light_num, int property, double n0,
00415                                 double n1, double n2));
00416 EXTERN vpResult             vpSetDepthCueing ANSI_ARGS((vpContext *vpc,
00417                                 double front_factor, double density));
00418 EXTERN int                  vpNormalIndex ANSI_ARGS((double nx, double ny,
00419                                 double nz));
00420 EXTERN vpResult             vpNormal ANSI_ARGS((int n, double *nx, double *ny,
00421                                 double *nz));
00422 EXTERN vpResult             vpScanlineNormals ANSI_ARGS((vpContext *vpc,
00423                                 int length, unsigned char *scalar_data,
00424                                 unsigned char *scalar_minus_y,
00425                                 unsigned char *scalar_plus_y,
00426                                 unsigned char *scalar_minus_z,
00427                                 unsigned char *scalar_plus_z,
00428                                 void *voxel_data, int scalar_field,
00429                                 int grad_field, int norm_field));
00430 EXTERN vpResult             vpVolumeNormals ANSI_ARGS((vpContext *vpc,
00431                                 unsigned char *scalar_data, int length,
00432                                 int scalar_field, int grad_field,
00433                                 int norm_field));
00434 EXTERN vpResult             vpShadeTable ANSI_ARGS((vpContext *vpc));
00435 
00436 /* view */
00437 EXTERN vpResult             vpCurrentMatrix ANSI_ARGS((vpContext *vpc,
00438                                 int option));
00439 EXTERN vpResult             vpIdentityMatrix ANSI_ARGS((vpContext *vpc));
00440 EXTERN vpResult             vpSetMatrix ANSI_ARGS((vpContext *vpc,
00441                                 vpMatrix4 matrix));
00442 EXTERN vpResult             vpMultMatrix ANSI_ARGS((vpContext *vpc,
00443                                 vpMatrix4 matrix));
00444 EXTERN vpResult             vpTranslate ANSI_ARGS((vpContext *vpc,
00445                                 double tx, double ty, double tz));
00446 EXTERN vpResult             vpRotate ANSI_ARGS((vpContext *vpc,
00447                                 int axis, double degrees));
00448 EXTERN vpResult             vpScale ANSI_ARGS((vpContext *vpc,
00449                                 double sx, double sy, double sz));
00450 EXTERN vpResult             vpWindow ANSI_ARGS((vpContext *vpc,
00451                                 int type, double left, double right,
00452                                 double bottom, double top, double near,
00453                                 double far));
00454 EXTERN vpResult             vpWindowPHIGS ANSI_ARGS((vpContext *vpc,
00455                                 vpVector3 vrp, vpVector3 vpn, vpVector3 vup,
00456                                 vpVector3 prp, double viewport_umin,
00457                                 double viewport_umax, double viewport_vmin,
00458                                 double viewport_vmax, double viewport_front,
00459                                 double viewport_back, int projection_type));
00460 
00461 /* images */
00462 EXTERN vpResult             vpSetImage ANSI_ARGS((vpContext *vpc,
00463                                 unsigned char *image, int width, int height,
00464                                 int bytes_per_scan, int pixel_type));
00465 
00466 /* other options */
00467 EXTERN vpResult             vpEnable ANSI_ARGS((vpContext *vpc,
00468                                 int option, int value));
00469 EXTERN vpResult             vpSeti ANSI_ARGS((vpContext *vpc, int option,
00470                                 int value));
00471 EXTERN vpResult             vpSetd ANSI_ARGS((vpContext *vpc, int option,
00472                                 double value));
00473 EXTERN vpResult             vpSetCallback ANSI_ARGS((vpContext *vpc,
00474                                 int option, void *func));
00475 EXTERN vpResult             vpSetClientData ANSI_ARGS((vpContext *vpc,
00476                                 void *client_data));
00477 EXTERN vpResult             vpSetDebug ANSI_ARGS((vpContext *vpc, int flag,
00478                                 int value));
00479 EXTERN vpResult             vpTracePixel ANSI_ARGS((vpContext *vpc,
00480                                 int trace_u, int trace_v));
00481 EXTERN vpResult             vpGetTimer ANSI_ARGS((vpContext *vpc, int option,
00482                                 int *iptr));
00483 EXTERN vpResult             vpClearTimer ANSI_ARGS((vpContext *vpc,
00484                                 int option));
00485 
00486 /* rendering */
00487 EXTERN vpResult             vpRenderClassifiedVolume ANSI_ARGS((
00488                                 vpContext *vpc));
00489 EXTERN vpResult             vpRenderRawVolume ANSI_ARGS((vpContext *vpc));
00490 EXTERN vpResult             vpBruteForceRender ANSI_ARGS((vpContext *vpc));
00491 
00492 /* retrieving state */
00493 EXTERN vpResult             vpGeti ANSI_ARGS((vpContext *vpc, int option,
00494                                 int *iptr));
00495 EXTERN vpResult             vpGetd ANSI_ARGS((vpContext *vpc, int option,
00496                                 double *dptr));
00497 EXTERN vpResult             vpGetp ANSI_ARGS((vpContext *vpc, int option,
00498                                 void **pptr));
00499 EXTERN vpResult             vpGetMatrix ANSI_ARGS((vpContext *vpc,
00500                                 int matrix_code, vpMatrix4 matrix));
00501 EXTERN vpResult             vpGetMaterial ANSI_ARGS((vpContext *vpc,
00502                                 int material, int property, int surface_side,
00503                                 double *r, double *g, double *b));
00504 EXTERN vpResult             vpGetLight ANSI_ARGS((vpContext *vpc,
00505                                 int light_num, int property,
00506                                 double *n0, double *n1, double *n2));
00507 EXTERN vpResult             vpGetImage ANSI_ARGS((vpContext *vpc,
00508                                 void *image, int width, int height,
00509                                 int scan_bytes, int pixel_type,
00510                                 int image_type));
00511 EXTERN vpResult             vpGetError ANSI_ARGS((vpContext *vpc));
00512 EXTERN char *               vpGetErrorString ANSI_ARGS((vpResult code));
00513 
00514 /* linear algebra */
00515 EXTERN void                 vpIdentity3 ANSI_ARGS((vpMatrix3 m));
00516 EXTERN void                 vpIdentity4 ANSI_ARGS((vpMatrix4 m));
00517 EXTERN vpResult             vpNormalize3 ANSI_ARGS((vpVector3 v));
00518 EXTERN void                 vpMatrixVectorMult4 ANSI_ARGS((vpVector4 v2,
00519                                 vpMatrix4 m, vpVector4 v1));
00520 EXTERN void                 vpMatrixMult4 ANSI_ARGS((vpMatrix4 m3,
00521                                 vpMatrix4 m2, vpMatrix4 m1));
00522 EXTERN void                 vpCrossProduct ANSI_ARGS((vpVector3 p,
00523                                 vpVector3 v, vpVector3 w));
00524 EXTERN vpResult             vpSolveSystem4 ANSI_ARGS((vpMatrix4 a, double **b,
00525                                 int m));
00526 
00527 /* file I/O */
00528 EXTERN vpResult             vpStoreClassifiedVolume ANSI_ARGS((vpContext *vpc,
00529                                 int fd));
00530 EXTERN vpResult             vpLoadClassifiedVolume ANSI_ARGS((vpContext *vpc,
00531                                 int fd));
00532 EXTERN vpResult             vpStoreMinMaxOctree ANSI_ARGS((vpContext *vpc,
00533                                 int fd));
00534 EXTERN vpResult             vpLoadMinMaxOctree ANSI_ARGS((vpContext *vpc,
00535                                 int fd));
00536 EXTERN vpResult             vpStoreRawVolume ANSI_ARGS((vpContext *vpc,
00537                                 int fd));
00538 EXTERN vpResult             vpLoadRawVolume ANSI_ARGS((vpContext *vpc,
00539                                 int fd));
00540 EXTERN vpResult             vpStoreContext ANSI_ARGS((vpContext *vpc, int fd));
00541 EXTERN vpResult             vpLoadContext ANSI_ARGS((vpContext *vpc, int fd));
00542 
00543 /* misc. utilities */
00544 EXTERN vpResult             vpExtract ANSI_ARGS((vpContext *vpc,
00545                                 int volume_type, int x0, int y0, int z0,
00546                                 int x1, int y1, int z1, int field, void *dst,
00547                                 int dst_size, int dst_xstride, int dst_ystride,
00548                                 int dst_zstride));
00549 EXTERN vpResult             vpRamp ANSI_ARGS((float *dst, int stride,
00550                                 int num_points, int *ramp_x, float *ramp_y));
00551 EXTERN vpResult             vpTranspose ANSI_ARGS((vpContext *vpc, int kaxis));
00552 EXTERN vpResult             vpSetFilter ANSI_ARGS((vpContext *vpc,
00553                                 int num_taps, int num_phases, float *weights));
00554 EXTERN vpResult             vpResample ANSI_ARGS((vpContext *vpc,
00555                                 int num_dimens, int *src_dimens,
00556                                 int *dst_dimens, int *src_strides,
00557                                 int *dst_strides, int element_type,
00558                                 void *in_array, void *out_array));
00559 EXTERN vpResult             vpResample2D ANSI_ARGS((
00560                                 void *in_array, int in_x, int in_y,
00561                                 void *out_array, int out_x, int out_y,
00562                                 int element_type, int filter_type));
00563 EXTERN vpResult             vpResample3D ANSI_ARGS((
00564                                 void *in_array, int in_x, int in_y, int in_z,
00565                                 void *out_array, int out_x, int out_y,
00566                                 int out_z, int element_type, int filter_type));
00567 EXTERN vpResult             vpBoxFilter ANSI_ARGS((int num_taps,
00568                                 int num_phases, float *weights,
00569                                 int weights_bytes));
00570 EXTERN vpResult             vpLinearFilter ANSI_ARGS((int num_taps,
00571                                 int num_phases, float *weights,
00572                                 int weights_bytes));
00573 EXTERN vpResult             vpBicubicFilter ANSI_ARGS((double b_value,
00574                                 double c_value, int num_taps, int num_phases,
00575                                 float *weights, int weights_bytes));
00576 EXTERN vpResult             vpGaussianFilter ANSI_ARGS((double sigma,
00577                                 int num_taps, int num_phases, float *weights,
00578                                 int weights_bytes));
00579 #endif /* _VOLPACK */
 

Powered by Plone

This site conforms to the following standards: