From: <sha...@us...> - 2007-06-28 13:13:41
|
Revision: 2183 http://hugin.svn.sourceforge.net/hugin/?rev=2183&view=rev Author: shahid_du Date: 2007-06-28 06:13:37 -0700 (Thu, 28 Jun 2007) Log Message: ----------- Moved all vips sources to vips directory. Modified Paths: -------------- libpanorama/trunk/src/CMakeLists.txt libpanorama/trunk/src/vips/CMakeLists.txt Added Paths: ----------- libpanorama/trunk/src/vips/ChangeLog libpanorama/trunk/src/vips/README libpanorama/trunk/src/vips/interpolation.c libpanorama/trunk/src/vips/interpolation.h libpanorama/trunk/src/vips/plug.c libpanorama/trunk/src/vips/resample.c libpanorama/trunk/src/vips/resample.h libpanorama/trunk/src/vips/transform.c libpanorama/trunk/src/vips/transform.h libpanorama/trunk/src/vips/transmap.c Removed Paths: ------------- libpanorama/trunk/src/transmap/ libpanorama/trunk/src/vips/plugResample/ libpanorama/trunk/src/vips/plugTransform/ Modified: libpanorama/trunk/src/CMakeLists.txt =================================================================== --- libpanorama/trunk/src/CMakeLists.txt 2007-06-28 12:00:04 UTC (rev 2182) +++ libpanorama/trunk/src/CMakeLists.txt 2007-06-28 13:13:37 UTC (rev 2183) @@ -2,4 +2,4 @@ add_subdirectory(parser) add_subdirectory(panotools-wrappers) add_subdirectory(vips) -add_subdirectory(transmap) +#add_subdirectory(transmap) Modified: libpanorama/trunk/src/vips/CMakeLists.txt =================================================================== --- libpanorama/trunk/src/vips/CMakeLists.txt 2007-06-28 12:00:04 UTC (rev 2182) +++ libpanorama/trunk/src/vips/CMakeLists.txt 2007-06-28 13:13:37 UTC (rev 2183) @@ -1,3 +1,60 @@ #include_directories( ${CMAKE_SOURCE_DIR}/src/vips ) -add_subdirectory(plugTransform) -add_subdirectory(plugResample) +#add_subdirectory(plugTransform) +#add_subdirectory(plugResample) + +# build a shared library (vips plugin) +ADD_LIBRARY(transform SHARED plug.c transform.c resample.c interpolation.c) +SET_TARGET_PROPERTIES(transform PROPERTIES SUFFIX ".plg") + +# set special compiler flags. +SET_TARGET_PROPERTIES(transform PROPERTIES COMPILE_FLAGS "${VIPS_CFLAGS_OTHER_STRING}") + +# set special linker flags +SET_TARGET_PROPERTIES(transform PROPERTIES LINK_FLAGS "${VIPS_LDFLAGS_OTHER_STRING}") + +#link to the library +TARGET_LINK_LIBRARIES(transform panoparser pano13 panotoolswrapper ${VIPS_LIBRARIES}) + +INSTALL(TARGETS transform LIBRARY DESTINATION lib) + + + +# build a shared library (vips plugin) +#ADD_LIBRARY(resample SHARED plug.c resample.c interpolation.c) +# rename library to .plg +#SET_TARGET_PROPERTIES(resample PROPERTIES SUFFIX ".plg") + +# set special compiler flags. +#SET_TARGET_PROPERTIES(resample PROPERTIES COMPILE_FLAGS "${VIPS_CFLAGS_OTHER_STRING}") + +# set special linker flags +#SET_TARGET_PROPERTIES(resample PROPERTIES LINK_FLAGS "${VIPS_LDFLAGS_OTHER_STRING}") + + +#link to the library (this might not be necessary). +#TARGET_LINK_LIBRARIES(resample panoparser pano13 panotoolswrapper) + +#INSTALL(TARGETS resample LIBRARY DESTINATION lib) + + +# set include and library directories +link_directories( ${VIPS_LIBRARY_DIRS} ) +include_directories( ${VIPS_INCLUDE_DIRS} ) + +#for testing you probably need some test app too +ADD_EXECUTABLE(testTmap transmap.c resample.c transform.c interpolation.c) + +# set special compiler flags. +SET_TARGET_PROPERTIES(testTmap PROPERTIES COMPILE_FLAGS "${VIPS_CFLAGS_OTHER_STRING}") + +# set special linker flags +SET_TARGET_PROPERTIES(testTmap PROPERTIES LINK_FLAGS "${VIPS_LDFLAGS_OTHER_STRING}") + +#link to the library +TARGET_LINK_LIBRARIES(testTmap panoparser pano13 panotoolswrapper ${VIPS_LIBRARIES}) + + +#add an install target here +#INSTALL_FILES(...) +#INSTALL_PROGRAMS(...) +#INSTALL_TARGET(...) Copied: libpanorama/trunk/src/vips/ChangeLog (from rev 2182, libpanorama/trunk/src/panotools-wrappers/ChangeLog) =================================================================== --- libpanorama/trunk/src/vips/ChangeLog (rev 0) +++ libpanorama/trunk/src/vips/ChangeLog 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,46 @@ +2007-06-28 Shahid <sha...@gm...> + + * Moved all sources in the vips directory, merged changelog and modified CMakeLists.txt accordingly. + +2007-06-28 Shahid <sha...@gm...> + + * Fixed some plugin description bug. + +2007-06-28 Shahid <sha...@gm...> + + * Fixed some bug in transmap. + +2007-06-28 Shahid <sha...@gm...> + + * interpolation.h, interpolation.c : Added bilinear interpolation + +2007-06-27 Pablo d'Angelo <pab...@we...> + + * CMakeLists.txt: use correct compiler and linker flags for VIPS. + +2007-06-27 Pablo d'Angelo <pab...@we...> + + * CMakeLists.txt: use correct compiler and linker flags for VIPS, + install final library with .plg suffix + +2007-06-27 Shahid <sha...@gm...> + + * transmap.c transform.c transform.h resample.c resample.h: First commit of test file to glue trasnformation and resampling together + +2007-06-24 Shahid <sha...@gm...> + + * Changed the plugin style from WIO to PIO. + +2007-06-20 Shahid <sha...@gm...> + + * Reduced plugin input from four to two - removed the unnecessary size inputs. Also deleted some unnecessary source lines. + +2007-06-20 Shahid <sha...@gm...> + + * plug.c, resample.c, resample.h, CMakeLists.txt, ChangeLog, README: First commit. Implementation of a simple vips plugin to build image fro source image and coordinate image. + +2007-06-14 Shahid <sha...@gm...> + + * plug.c, transform.c, transform.h, transform_image_build.c, CMakeLists.txt, ChangeLog, README: First commit. Implementation of a simple vips plugin to build transform image. + + Copied: libpanorama/trunk/src/vips/README (from rev 2182, libpanorama/trunk/src/panotools-wrappers/README) =================================================================== --- libpanorama/trunk/src/vips/README (rev 0) +++ libpanorama/trunk/src/vips/README 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1 @@ +To be added soon! Copied: libpanorama/trunk/src/vips/interpolation.c (from rev 2182, libpanorama/trunk/src/transmap/interpolation.c) =================================================================== --- libpanorama/trunk/src/vips/interpolation.c (rev 0) +++ libpanorama/trunk/src/vips/interpolation.c 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,53 @@ +#include "stdio.h" +#include "stdlib.h" +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#include <assert.h> + +#include "interpolation.h" + +/*#define linearInterpolation( d0, p0, d1, p1, r ) \ + r = ( p0 * d0 + p1 * d1 );*/ + +unsigned char linearInterpolation(double d0, double p0, double d1, double p1) +{ + return ((unsigned char) ( p0 * d0 + p1 * d1 )); +} + +void billinearInterpolation(unsigned char *q, REGION *reg, double px, double py, const int ps) +{ + int p00x = (int) px; + int p00y = (int) py; + double xdis = px - p00x; + double ydis = py - p00y; + + //printf("px= %f, py = %f, xdis = %f, ydis = %f\n", px, py, xdis, ydis); + int p01x = p00x + 1; + int p01y = p00y; + + int p10x = p00x; + int p10y = p00y + 1; + + int p11x = p01x; + int p11y = p10y; + + unsigned char *p00 = (unsigned char *) IM_REGION_ADDR (reg, p00x, p00y); + unsigned char *p01 = (unsigned char *) IM_REGION_ADDR (reg, p01x, p01y); + unsigned char *p10 = (unsigned char *) IM_REGION_ADDR (reg, p10x, p10y); + unsigned char *p11 = (unsigned char *) IM_REGION_ADDR (reg, p11x, p11y); + + int i; + for(i = 0; i < ps; i++) + { + unsigned char a0, a1; + //printf("00= %d\t01= %d\t10= %d\t11= %d\n", p00[i], p01[i], p10[i], p11[i]); + /*linearInterpolation(1-xdis, p00[i], xdis, p01[i], a0); + linearInterpolation(1-xdis, p10[i], xdis, p11[i], a1); + linearInterpolation(1-ydis, a0, ydis, a1, q[i]);*/ + a0 = linearInterpolation(1-xdis, p00[i], xdis, p01[i]); + a1 = linearInterpolation(1-xdis, p10[i], xdis, p11[i]); + q[i] = linearInterpolation(1-ydis, a0, ydis, a1); + //printf("i = %d, a0 = %d, a1 = %d, q[i] = %d\n", i, a0, a1, q[i]); + } +} Copied: libpanorama/trunk/src/vips/interpolation.h (from rev 2182, libpanorama/trunk/src/transmap/interpolation.h) =================================================================== --- libpanorama/trunk/src/vips/interpolation.h (rev 0) +++ libpanorama/trunk/src/vips/interpolation.h 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,9 @@ +#ifndef __INTERPOLATION_H__ +#define __INTERPOLATION_H__ + +#include <vips/vips.h> + +void billinearInterpolation(unsigned char *q, REGION *reg, double px, double py, const int ps); + + +#endif Copied: libpanorama/trunk/src/vips/plug.c (from rev 2182, libpanorama/trunk/src/vips/plugTransform/plug.c) =================================================================== --- libpanorama/trunk/src/vips/plug.c (rev 0) +++ libpanorama/trunk/src/vips/plug.c 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,105 @@ +#include <stdio.h> + +#include <vips/vips.h> + +#include "transform.h" +#include "resample.h" + +static int +transform_image_build_vec( im_object *argv ) +{ + IMAGE *out = argv[0]; + char *transformFile = argv[1]; + int *imgNr = argv[2]; + + /*int width, height; + pt_transform *trn;*/ + + /*width and height will be loaded from pt_script */ + /*if( !(trn = transform_new_from_file( transform, &width, &height, 0 )) ) { + im_error( "transform_image_build", + _( "unable to build transform" ) ); + return( -1 ); + } + + if( im_add_close_callback( out, + (im_callback_fn) transform_destroy, trn, NULL ) ) { + transform_destroy( trn ); + return( -1 ); + } + + if( transform_image_build( out, trn, width, height ) ) + return( -1 );*/ + + if( transform_image( out, transformFile, *imgNr) ) + return( -1 ); + + return( 0 ); +} + +static im_arg_desc transform_image_build_arg_types[] = { + IM_OUTPUT_IMAGE( "out" ), + IM_INPUT_STRING( "transform" ), + IM_INPUT_INT( "image Number" ) +}; + +static im_function transform_image_build_desc = { + "transform_image_build", /* Name */ + "build a transform image", /* Description */ + IM_FN_PIO, /* Flags */ + transform_image_build_vec, /* Dispatch function */ + IM_NUMBER( transform_image_build_arg_types ),/* Size of arg list */ + transform_image_build_arg_types /* Arg list */ +}; + + + +static int +output_resample_image_vec( im_object *argv ) +{ + char *imageOut = argv[2]; + + IMAGE *out; + + if (!(out = im_open (imageOut, "w")) || + output_resample_image (argv[0], argv[1], out)) + error_exit ("unable to run operation"); + + im_close (out); + + return 0; +} + +static im_arg_desc output_resample_image_arg_types[] = { + IM_INPUT_IMAGE( "coordinate" ), + IM_INPUT_IMAGE( "source" ), + IM_INPUT_STRING( "output" ) +}; + +static im_function output_resample_image_desc = { + "output_resample_image", /* Name */ + "output resample image", /* Description */ + IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ + output_resample_image_vec, /* Dispatch function */ + IM_NUMBER( output_resample_image_arg_types ),/* Size of arg list */ + output_resample_image_arg_types /* Arg list */ +}; + + + + +static im_function *function_list[] = { + &transform_image_build_desc, + &output_resample_image_desc +}; + + + +/* Define the package_table symbol. This is what VIPS looks for when loading + * the plugin. + */ +G_MODULE_EXPORT im_package package_table = { + "transform", /* Package name */ + IM_NUMBER( function_list ), /* Function list */ + function_list +}; Copied: libpanorama/trunk/src/vips/resample.c (from rev 2182, libpanorama/trunk/src/transmap/resample.c) =================================================================== --- libpanorama/trunk/src/vips/resample.c (rev 0) +++ libpanorama/trunk/src/vips/resample.c 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,172 @@ +#include "stdio.h" +#include "stdlib.h" +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#include <assert.h> + +#include "resample.h" +#include "interpolation.h" + + +int findBoundary(REGION *or, Rect *out, IMAGE *im) +{ + /*printf("in FB\n");*/ + Rect *in = &or->valid; + int le = in->left; + int to = in->top; + int ri = IM_RECT_RIGHT( in ); + int bo = IM_RECT_BOTTOM( in ); + + int x, y, pxi, pyi; + int xmax = -1, xmin = 30000, ymax = -1, ymin = 30000; + + /*printf("FB:left = %d\twidth = %d\ttop = %d\theight = %d\n", in->left, in->width, in->top, + in->height);*/ + for( y = to; y < bo; y++ ) + { + double *p = (double *) IM_REGION_ADDR (or, le, y); + + for( x = le; x < ri; x++ ) + { + double px = p[0]; + double py = p[1]; + + p += 2; + pxi = (int)px; + pyi = (int)py; + + if (pxi < im->Xsize && pxi >= 0 && pyi < im->Ysize && pyi >= 0) + { + if(pxi > xmax) + xmax = pxi; + if(pyi > ymax) + ymax = pyi; + if(pxi < xmin) + xmin = pxi; + if(pyi < ymin) + ymin = pyi; + } + /*else + printf("out of bound: px = %f, pxi = %d, py = %f, pyi = %d\n", px, pxi, py, pyi);*/ + } + } + + if(xmax == -1 || ymax == -1 || xmin == 60000 || ymin == 60000) + { + out->top = 0; + out->left = 0; + out->height = 0; + out->width = 0; + } + else + { + out->top = ymin; + out->left = xmin; + out->height = ymax - ymin; + out->width = xmax - xmin; + } + /*printf("FB:left = %d\twidth = %d\ttop = %d\theight = %d\n", out->left, out->width, out->top, + out->height);*/ + return 0; +} + + +static int +output_resample_image_gen( REGION *or, REGION **ir, IMAGE **vec ) +{ + Rect *r = &or->valid; + Rect inRect; + + int le = r->left; + int to = r->top; + int ri = IM_RECT_RIGHT( r ); + int bo = IM_RECT_BOTTOM( r ); + + if(im_prepare(ir[0], r)) + { + return -1; + } + + findBoundary(ir[0], &inRect, vec[1]); + + if((inRect.width != 0 && inRect.height != 0)) + if( (im_prepare(ir[1], &inRect))) + { + return -1; + } + + int x, y; + + /*printf("GEN: b4 main loop\n");*/ + for( y = to; y < bo; y++ ) + { + double *p = (double *) IM_REGION_ADDR (ir[0], le, y); + const int ps = IM_IMAGE_SIZEOF_PEL (vec[1]); + unsigned char *q = (unsigned char *) IM_REGION_ADDR (or, le, y); + + for( x = le; x < ri; x++ ) + { + double px = p[0]; + double py = p[1]; + + p += 2; + + if (px < vec[1]->Xsize && px >= 0 && py < vec[1]->Ysize && py >= 0) + //memcpy (q, IM_REGION_ADDR (ir[1], (int) px, (int) py), ps); + billinearInterpolation(q, ir[1], px, py, ps); + else + memset (q, 0, ps); + + q += ps; + } + } + + return( 0 ); +} + + + +int +output_resample_image (IMAGE * coordinate, IMAGE * in, IMAGE * out) +{ + /*printf("starting output resample image ....\n");*/ + IMAGE **vec; + if (im_piocheck (coordinate, out)) + return -1; + if (im_pincheck (in)) + return -1; + /*printf("after checking IO\n");*/ + + if (coordinate->Coding != IM_CODING_NONE || + coordinate->Bands != 2 || coordinate->BandFmt != IM_BANDFMT_DOUBLE) + { + im_error ("output_resample_image", "bad coordinate image"); + return -1; + } + + if (in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_UCHAR) + { + im_error ("output_resample_image", "bad input image"); + return -1; + } + + if (im_cp_desc (out, in)) + return -1; + + out->Xsize = coordinate->Xsize; + out->Ysize = coordinate->Ysize; + /*printf("b4 calling demand\n");*/ + if( im_demand_hint( out, IM_SMALLTILE, coordinate, in, NULL ) ) + return( -1 ); + if( !(vec = im_allocate_input_array( out, coordinate, in, NULL )) ) + return( -1 ); + + /*printf("b4 calling generate function\n");*/ + if( im_generate( out, + im_start_many, output_resample_image_gen, im_stop_many, vec, NULL ) ) + return( -1 ); + + return 0; +} + Copied: libpanorama/trunk/src/vips/resample.h (from rev 2182, libpanorama/trunk/src/transmap/resample.h) =================================================================== --- libpanorama/trunk/src/vips/resample.h (rev 0) +++ libpanorama/trunk/src/vips/resample.h 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,9 @@ +#ifndef __RESAMPLE_H__ +#define __RESAMPLE_H__ + +#include <vips/vips.h> + +int output_resample_image( IMAGE *coordinate, IMAGE *in, IMAGE *out); + + +#endif Copied: libpanorama/trunk/src/vips/transform.c (from rev 2182, libpanorama/trunk/src/transmap/transform.c) =================================================================== --- libpanorama/trunk/src/vips/transform.c (rev 0) +++ libpanorama/trunk/src/vips/transform.c 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,139 @@ +#include "stdio.h" +#include "stdlib.h" +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#include <assert.h> + +#include <parser/tparser.h> +#include <vips/vips.h> +#include "transform.h" + +#define DEBUG + +pt_transform * +transform_new_from_file( char *transform , int *width, int *height, int imgNr ) +{ + pt_script *script = NULL; + script = panoScriptParse(transform, FALSE); + if (script == NULL) { + printf("Parsing error\n"); + return NULL; + } else { + /*panoScriptDump(script); + + printf("\n\n===============================\n\n");*/ + pt_transform * trn = panoTransformCreate(script,imgNr); + /*Transform *trn; + + if( !(trn = malloc( sizeof( Transform )) ) ) + return( NULL ); + trn->stuff = 42;*/ + +#ifdef DEBUG + printf( "transform_new_from_file: \"%s\" (%p)\n", transform, trn ); +#endif /*DEBUG*/ + + *width = script->pano.width; + *height = script->pano.height; + /*hope after this step pt_script is of no use, so we can dispose it*/ + panoParserDispose(&script); + return( trn ); + } +} + +int +transform_destroy( pt_transform *trn ) +{ +#ifdef DEBUG + printf( "transform_destroy: %p\n", trn ); +#endif /*DEBUG*/ + + /*I think panoTransformDispose will take care of freeing the memory */ + panoTransformDispose(&trn); + /*free( trn );*/ + + return( 0 ); +} + +static int transform_image_build_gen( REGION *or, void *dummy, pt_transform *trn ) +{ + Rect *r = &or->valid; + int le = r->left; + int to = r->top; + int ri = IM_RECT_RIGHT( r ); + int bo = IM_RECT_BOTTOM( r ); + + int x, y; + + for( y = to; y < bo; y++ ) { + double *q = (double *) IM_REGION_ADDR( or, le, y ); + + for( x = le; x < ri; x++ ) { + double xp, yp; + + /*transform_coordinates( trn, x, y, &xp, &yp );*/ + panoTransformInverse(trn, x,y, &xp,&yp); + /*printf("%f, %f ", xs, ys);*/ + + q[0] = xp; + q[1] = yp; + /*printf("xp = %f, yp = %f\n", xp, yp);*/ + q += 2; + } + } + + return( 0 ); +} + +/* Make a two band image ... band 0 is x coordinates, band 1 is y + * coordinates. + */ +int transform_image_build( IMAGE *out, + pt_transform *trn, const int xsize, const int ysize ) +{ + if( xsize <= 0 || ysize <= 0 ) { + im_error( "im_transform_image_build", _( "bad size" ) ); + return( -1 ); + } + if( im_poutcheck( out ) ) + return( -1 ); + + im_initdesc( out, xsize, ysize, 2, IM_BBITS_DOUBLE, IM_BANDFMT_DOUBLE, + IM_CODING_NONE, IM_TYPE_MULTIBAND, 1.0, 1.0, 0, 0 ); + + if( im_demand_hint( out, IM_ANY, NULL ) ) + return( -1 ); + + if( im_generate( out, + NULL, transform_image_build_gen, NULL, trn, NULL ) ) + return( -1 ); + + return( 0 ); +} + + +int transform_image(IMAGE *out, char *transformFile, int imgNr) +{ + int width, height; + pt_transform *trn; + + /*width and height will be loaded from pt_script */ + if( !(trn = transform_new_from_file( transformFile, &width, &height, imgNr )) ) { + im_error( "transform_image_build", + _( "unable to build transform" ) ); + return( -1 ); + } + + if( im_add_close_callback( out, + (im_callback_fn) transform_destroy, trn, NULL ) ) { + transform_destroy( trn ); + return( -1 ); + } + + if( transform_image_build( out, trn, width, height ) ) + return( -1 ); + + return( 0 ); + +} Copied: libpanorama/trunk/src/vips/transform.h (from rev 2182, libpanorama/trunk/src/transmap/transform.h) =================================================================== --- libpanorama/trunk/src/vips/transform.h (rev 0) +++ libpanorama/trunk/src/vips/transform.h 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,15 @@ +/* i18n placeholder. + */ +#include "panotools-wrappers/pttransform.h" +#include <vips/vips.h> + +#define _(S) (S) + +/*Changed the signature to load width and height from pt_script, also the dummy transform structure +is no longer needed, I use pt_transform everywhere instead*/ +int transform_image_build( IMAGE *out, pt_transform *trn, const int xsize, const int ysize ); +int transform_image(IMAGE *out, char *transformFile, int imgNr); +pt_transform *transform_new_from_file( char *transform , int *width, int *height, int imgNr); +int transform_destroy( pt_transform *trn ); + + Copied: libpanorama/trunk/src/vips/transmap.c (from rev 2182, libpanorama/trunk/src/transmap/transmap.c) =================================================================== --- libpanorama/trunk/src/vips/transmap.c (rev 0) +++ libpanorama/trunk/src/vips/transmap.c 2007-06-28 13:13:37 UTC (rev 2183) @@ -0,0 +1,61 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#include <assert.h> + +#include <vips/vips.h> +#include <parser/tparser.h> +#include "transform.h" +#include "resample.h" + +int main(int argc, char *argv[]) +{ + if (argc != 2) + { + printf("Usage: %s script-file-name\n", argv[0]); + exit(1); + } + + pt_script *script = NULL; + script = panoScriptParse(argv[1], FALSE); + if (script == NULL) + { + printf("Parsing error\n"); + exit(1); + } + else + { + int imageCount = panoScriptGetInputImagesCount(script); + int i; + for(i = 0; i< imageCount; i++) + { + char outputImage[100]; + sprintf(outputImage, "%s%d.tif", "out", i); + IMAGE *out, *coordImage, *input; + out = im_open (outputImage, "w"); + coordImage = im_open_local(out, "coordImage", "p"); + + if( transform_image( coordImage, argv[1], i) ) + { + printf("transform image error\n"); + exit(1); + } + + printf("transformation done\n"); + pt_script_image * inputImg = panoScriptGetInputImage(script, i); + + if (!(input = im_open_local (out, inputImg->name, "r")) || + output_resample_image (coordImage, input, out)) + error_exit ("unable to run operation\n"); + + printf("resampling done\n"); + printf("saving %s ....\n", outputImage); + im_close(out); + } + } + + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |