bump version to 7.40
and rename header and edvips as vipsheader and vipsedit remove mergeup and find_mosaic
This commit is contained in:
parent
6ad65fbb68
commit
da77b68d3e
@ -1,3 +1,7 @@
|
|||||||
|
23/6/14 started 7.40.0
|
||||||
|
- version bump
|
||||||
|
- renamed "header" as "vipsheader" and "edvips" as "vipsedit"
|
||||||
|
|
||||||
21/1/14 started 7.39.0
|
21/1/14 started 7.39.0
|
||||||
- auto-decode for (almost) all operations, see vips_image_decode()
|
- auto-decode for (almost) all operations, see vips_image_decode()
|
||||||
- background render thread cleans up and quits neatly
|
- background render thread cleans up and quits neatly
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# also update the version number in the m4 macros below
|
# also update the version number in the m4 macros below
|
||||||
|
|
||||||
AC_INIT([vips], [7.39.0], [vipsip@jiscmail.ac.uk])
|
AC_INIT([vips], [7.40.0], [vipsip@jiscmail.ac.uk])
|
||||||
# required for gobject-introspection
|
# required for gobject-introspection
|
||||||
AC_PREREQ(2.62)
|
AC_PREREQ(2.62)
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||||||
|
|
||||||
# user-visible library versioning
|
# user-visible library versioning
|
||||||
m4_define([vips_major_version], [7])
|
m4_define([vips_major_version], [7])
|
||||||
m4_define([vips_minor_version], [39])
|
m4_define([vips_minor_version], [40])
|
||||||
m4_define([vips_micro_version], [0])
|
m4_define([vips_micro_version], [0])
|
||||||
m4_define([vips_version],
|
m4_define([vips_version],
|
||||||
[vips_major_version.vips_minor_version.vips_micro_version])
|
[vips_major_version.vips_minor_version.vips_micro_version])
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
\fancyhead[LE,RO]{\leftmark} % left-even, right-odd
|
\fancyhead[LE,RO]{\leftmark} % left-even, right-odd
|
||||||
\fancyhead[RE,LO]{VIPS Manual} % right-even, left-odd
|
\fancyhead[RE,LO]{VIPS Manual} % right-even, left-odd
|
||||||
\fancyfoot[LE,RO]{\thepage} % left-even, right-odd
|
\fancyfoot[LE,RO]{\thepage} % left-even, right-odd
|
||||||
\fancyfoot[RE,LO]{January 2014}
|
\fancyfoot[RE,LO]{June 2014}
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
@ -27,14 +27,14 @@
|
|||||||
\begin{center}
|
\begin{center}
|
||||||
\huge
|
\huge
|
||||||
VIPS Manual\\
|
VIPS Manual\\
|
||||||
\large Version 7.38\\
|
\large Version 7.40\\
|
||||||
\vspace{0.5in}
|
\vspace{0.5in}
|
||||||
\large
|
\large
|
||||||
John Cupitt,
|
John Cupitt,
|
||||||
Kirk Martinez\\
|
Kirk Martinez\\
|
||||||
\end{center}
|
\end{center}
|
||||||
|
|
||||||
VIPS is currently (v. 7.38, June 2014) in an API transition. The API as
|
VIPS is currently (v. 7.40, June 2014) in an API transition. The API as
|
||||||
documented in 7.24 is still complete and supported and is the one you should
|
documented in 7.24 is still complete and supported and is the one you should
|
||||||
use. The 8.0 API is not yet done and may still change before completion.
|
use. The 8.0 API is not yet done and may still change before completion.
|
||||||
|
|
||||||
|
@ -192,14 +192,12 @@ vips_hough_circle_vote( VipsHough *hough, VipsImage *accumulator, int x, int y )
|
|||||||
{
|
{
|
||||||
VipsHoughCircle *hough_circle = (VipsHoughCircle *) hough;
|
VipsHoughCircle *hough_circle = (VipsHoughCircle *) hough;
|
||||||
int min_radius = hough_circle->min_radius;
|
int min_radius = hough_circle->min_radius;
|
||||||
int max_radius = hough_circle->max_radius;
|
|
||||||
int range = max_radius - min_radius;
|
|
||||||
int cx = x / hough_circle->scale;
|
int cx = x / hough_circle->scale;
|
||||||
int cy = y / hough_circle->scale;
|
int cy = y / hough_circle->scale;
|
||||||
|
|
||||||
int rb;
|
int rb;
|
||||||
|
|
||||||
g_assert( range >= 0 );
|
g_assert( hough_circle->max_radius - min_radius >= 0 );
|
||||||
|
|
||||||
for( rb = 0; rb < hough_circle->bands; rb++ ) {
|
for( rb = 0; rb < hough_circle->bands; rb++ ) {
|
||||||
/* r needs to be in scaled down image space.
|
/* r needs to be in scaled down image space.
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
bin_PROGRAMS = \
|
bin_PROGRAMS = \
|
||||||
find_mosaic \
|
|
||||||
mergeup \
|
|
||||||
vips \
|
vips \
|
||||||
edvips \
|
vipsedit \
|
||||||
vipsthumbnail \
|
vipsthumbnail \
|
||||||
header
|
vipsheader
|
||||||
|
|
||||||
vips_SOURCES = vips.c
|
vips_SOURCES = vips.c
|
||||||
edvips_SOURCES = edvips.c
|
vipsedit_SOURCES = vipsedit.c
|
||||||
header_SOURCES = header.c
|
vipsheader_SOURCES = vipsheader.c
|
||||||
vipsthumbnail_SOURCES = vipsthumbnail.c
|
vipsthumbnail_SOURCES = vipsthumbnail.c
|
||||||
find_mosaic_SOURCES = find_mosaic.c
|
|
||||||
mergeup_SOURCES = mergeup.c
|
|
||||||
|
|
||||||
AM_CPPFLAGS = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@
|
AM_CPPFLAGS = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@
|
||||||
AM_LDFLAGS = @LDFLAGS@
|
AM_LDFLAGS = @LDFLAGS@
|
||||||
@ -27,11 +23,11 @@ bin_SCRIPTS = \
|
|||||||
batch_rubber_sheet \
|
batch_rubber_sheet \
|
||||||
batch_crop \
|
batch_crop \
|
||||||
vipsprofile \
|
vipsprofile \
|
||||||
vips-7.39
|
vips-7.40
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
vipsprofile \
|
vipsprofile \
|
||||||
vips-7.39 \
|
vips-7.40 \
|
||||||
light_correct.in \
|
light_correct.in \
|
||||||
shrink_width.in \
|
shrink_width.in \
|
||||||
batch_image_convert.in \
|
batch_image_convert.in \
|
||||||
|
@ -1,447 +0,0 @@
|
|||||||
/* Join together images.
|
|
||||||
*
|
|
||||||
* find_mosaic x y file_name <root>.0x0.v <root>.0x1.v ...
|
|
||||||
*
|
|
||||||
* Where the image has been take with patches named as
|
|
||||||
*
|
|
||||||
* . .
|
|
||||||
* . .
|
|
||||||
* <root>.0x1.v <root>.1x1.v ..
|
|
||||||
* <root>.0x0.v <root>.1x0.v ..
|
|
||||||
*
|
|
||||||
* Uses im__find_lroverlap and im__find_tboverlap routines to make <root>.v.
|
|
||||||
*
|
|
||||||
* It stores the tie points between patches in a data_file.
|
|
||||||
*
|
|
||||||
* It uses partials on all IO by including tbmerge / lrmerge programs.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Copyright (C) Feb./1995, Ahmed. Abbood
|
|
||||||
* National Gallery. London
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
This file is part of VIPS.
|
|
||||||
|
|
||||||
VIPS is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
02110-1301 USA
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif /*HAVE_CONFIG_H*/
|
|
||||||
#include <vips/intl.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include <vips/vips.h>
|
|
||||||
|
|
||||||
#define NUM_FILES 1000
|
|
||||||
#define MAXPOINTS 60
|
|
||||||
int xoverlap;
|
|
||||||
int yoverlap;
|
|
||||||
|
|
||||||
extern int im_lrmerge();
|
|
||||||
extern int im_merge_analysis();
|
|
||||||
extern int im__find_lroverlap();
|
|
||||||
extern int im__find_tboverlap();
|
|
||||||
static int file_ptr = 0;
|
|
||||||
static IMAGE *in[ NUM_FILES ];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Strategy: build a tree describing the sequence of joins we want. Walk the
|
|
||||||
* tree assigning temporary file names, compile the tree into a linear
|
|
||||||
* sequence of join commands.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Decoded file name info.
|
|
||||||
*/
|
|
||||||
static char *file_root = NULL;
|
|
||||||
static char *output_file = NULL;
|
|
||||||
static int width = 0; /* Number of frames across */
|
|
||||||
static int height = 0; /* Number of frames down */
|
|
||||||
|
|
||||||
static int file_list[ NUM_FILES ];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Find the root name of a file name. Return new, shorter, string.
|
|
||||||
*/
|
|
||||||
static char *
|
|
||||||
find_root( name )
|
|
||||||
char *name;
|
|
||||||
{ char *out = strdup( name );
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
/* Chop off '.v'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( NULL );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
/* Chop off nxn.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( NULL );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
return( out );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the x position of a file name (extract n from <root>.nxm.v).
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
find_x( char *name )
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
char *p;
|
|
||||||
char *out;
|
|
||||||
|
|
||||||
out = strdup( name );
|
|
||||||
|
|
||||||
/* Chop off '.v'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
/* Find '.nxm'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read out x posn.
|
|
||||||
*/
|
|
||||||
if( sscanf( p, ".%dx%*d", &n ) != 1 ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
free( out );
|
|
||||||
|
|
||||||
return( n );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the y position of a file name (extract m from <root>.nxm.v).
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
find_y( char *name )
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
char *p;
|
|
||||||
char *out;
|
|
||||||
|
|
||||||
out = strdup( name );
|
|
||||||
|
|
||||||
/* Chop off '.v'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
/* Find '.nxm'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read out y posn.
|
|
||||||
*/
|
|
||||||
if( sscanf( p, ".%*dx%d", &m ) != 1 ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
free( out );
|
|
||||||
|
|
||||||
return( m );
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
mosaic_analysis(int width, int height,IMAGE **inp, IMAGE *out,
|
|
||||||
int xoff, int yoff, int *vxdisp, int *vydisp,int *hxdisp, int *hydisp) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int i, j, dx, dy, curr_im, fx, fy;
|
|
||||||
int halfcorsize, halfareasize;
|
|
||||||
int mincorsize, minareasize;
|
|
||||||
int prev_row, curr_row, curr_disp_x, curr_disp_y;
|
|
||||||
double scale1, angle1, dx1, dy1;
|
|
||||||
|
|
||||||
|
|
||||||
curr_im = -1;
|
|
||||||
curr_disp_x = -1;
|
|
||||||
curr_disp_y = -1;
|
|
||||||
dy = -1;
|
|
||||||
for(i=0; i<=height; i++){
|
|
||||||
for(j=0; j<=width; j++){
|
|
||||||
++curr_im;
|
|
||||||
halfcorsize = 5;
|
|
||||||
halfareasize = 14;
|
|
||||||
dx = xoff - inp[curr_im]->Xsize;
|
|
||||||
dy = yoff - inp[curr_im]->Ysize;
|
|
||||||
|
|
||||||
if( ( j < width ) && ( width > 0 ) ){
|
|
||||||
if( dx < 0 ){
|
|
||||||
mincorsize = (int)(inp[curr_im]->Xsize + dx - 1)/6;
|
|
||||||
minareasize = (int)(inp[curr_im]->Xsize + dx
|
|
||||||
- 3*halfcorsize -1)/2 - mincorsize;
|
|
||||||
if(mincorsize > halfcorsize)
|
|
||||||
mincorsize = halfcorsize;
|
|
||||||
if( minareasize > 0 ){
|
|
||||||
if( minareasize < halfareasize ){
|
|
||||||
if( minareasize >
|
|
||||||
(int)(halfcorsize +(int)(halfcorsize/2 + 1))){
|
|
||||||
halfareasize = minareasize;
|
|
||||||
}
|
|
||||||
else if(mincorsize > 2){
|
|
||||||
halfcorsize=mincorsize;
|
|
||||||
halfareasize=(int)(mincorsize+mincorsize/2 +1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ( inp[curr_im]->Xsize < xoff ) || ( inp[curr_im+1]->Xsize < xoff ) ||
|
|
||||||
( inp[curr_im]->Ysize < yoff ) || ( inp[curr_im+1]->Ysize < yoff) ){
|
|
||||||
++curr_disp_x;
|
|
||||||
hxdisp[curr_disp_x] = 0;
|
|
||||||
hydisp[curr_disp_x] = 0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if ( im__find_lroverlap(inp[curr_im], inp[curr_im+1],
|
|
||||||
out, 0,
|
|
||||||
(int)(inp[curr_im]->Xsize -xoff/2),
|
|
||||||
(int)(inp[curr_im]->Ysize /2),
|
|
||||||
(int)(xoff/2), (int)(inp[curr_im+1]->Ysize /2),
|
|
||||||
halfcorsize, halfareasize , &fx, &fy,
|
|
||||||
&scale1, &angle1, &dx1, &dy1 ) == -1 )
|
|
||||||
error_exit("Unable to im__find_lroverlap");
|
|
||||||
|
|
||||||
++curr_disp_x;
|
|
||||||
hxdisp[curr_disp_x] = inp[curr_im]->Xsize - xoff + fx;
|
|
||||||
hydisp[curr_disp_x] = fy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( ( i < height ) && ( height > 0 ) ){
|
|
||||||
curr_row = curr_im+1+(int)(width/2);
|
|
||||||
prev_row = curr_im - width+(int)(width/2);
|
|
||||||
halfcorsize = 5;
|
|
||||||
halfareasize = 14;
|
|
||||||
|
|
||||||
if( dy < 0){
|
|
||||||
mincorsize = (int)(inp[prev_row]->Ysize + dy - 1)/6;
|
|
||||||
minareasize = (int)(inp[prev_row]->Ysize + dy
|
|
||||||
- 3*halfcorsize -1)/2 - mincorsize;
|
|
||||||
if(mincorsize > halfcorsize)
|
|
||||||
mincorsize = halfcorsize;
|
|
||||||
if( minareasize > 0 ){
|
|
||||||
if( minareasize < halfareasize ){
|
|
||||||
if( minareasize >
|
|
||||||
(int)(halfcorsize +(int)(halfcorsize/2 + 1))){
|
|
||||||
halfareasize = minareasize;
|
|
||||||
}
|
|
||||||
else if(mincorsize > 2){
|
|
||||||
halfcorsize=mincorsize;
|
|
||||||
halfareasize=(int)(mincorsize+mincorsize/2 +1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( ( inp[curr_row]->Xsize < xoff ) || ( inp[prev_row]->Xsize < xoff ) ||
|
|
||||||
( inp[curr_row]->Ysize < yoff ) || ( inp[prev_row]->Ysize < yoff ) ){
|
|
||||||
++curr_disp_y;
|
|
||||||
vxdisp[curr_disp_y] = 0;
|
|
||||||
vydisp[curr_disp_y] = 0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if ( im__find_tboverlap(inp[prev_row], inp[curr_row],
|
|
||||||
out, 0,
|
|
||||||
(int)(inp[prev_row]->Xsize/2 ),
|
|
||||||
(int)(inp[prev_row]->Ysize - yoff/2 ),
|
|
||||||
(int)(inp[curr_row]->Xsize/2 ), (int)(yoff/2),
|
|
||||||
halfcorsize, halfareasize, &fx, &fy,
|
|
||||||
&scale1, &angle1, &dx1, &dy1 ) == -1 )
|
|
||||||
error_exit("Unable to im__find_tboverlap");
|
|
||||||
|
|
||||||
|
|
||||||
++curr_disp_y;
|
|
||||||
vxdisp[curr_disp_y] = fx;
|
|
||||||
vydisp[curr_disp_y] = inp[prev_row]->Ysize - yoff + fy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return ( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main( argc, argv )
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
|
||||||
int i, n, j, k;
|
|
||||||
char name[ 1000 ];
|
|
||||||
FILE *fp;
|
|
||||||
char *r;
|
|
||||||
IMAGE *out;
|
|
||||||
int vxdisp[NUM_FILES + 1] ;
|
|
||||||
int vydisp[NUM_FILES + 1] ;
|
|
||||||
int hxdisp[NUM_FILES + 1] ;
|
|
||||||
int hydisp[NUM_FILES + 1] ;
|
|
||||||
|
|
||||||
if( im_init_world( argv[0] ) )
|
|
||||||
error_exit( "unable to start VIPS" );
|
|
||||||
textdomain( GETTEXT_PACKAGE );
|
|
||||||
setlocale( LC_ALL, "" );
|
|
||||||
|
|
||||||
/* Too many?
|
|
||||||
*/
|
|
||||||
if( argc > NUM_FILES + 1 )
|
|
||||||
error_exit( "Too many files to merge" );
|
|
||||||
for(i=0; i< NUM_FILES; i++)
|
|
||||||
file_list[i] = 0;
|
|
||||||
/* Too few?
|
|
||||||
*/
|
|
||||||
if( argc == 1 )
|
|
||||||
error_exit( "usage: xoverlap yoverlap file_name "
|
|
||||||
"<root>.0x0.v <root>.0x1.v ..." );
|
|
||||||
xoverlap = atoi(argv[1]);
|
|
||||||
yoverlap = atoi(argv[2]);
|
|
||||||
fp = fopen( argv[3] , "w" );
|
|
||||||
|
|
||||||
for( i = 4; i < argc; i++ ){
|
|
||||||
/* Find/check root.
|
|
||||||
*/
|
|
||||||
if( !file_root ) {
|
|
||||||
file_root = find_root( argv[i] );
|
|
||||||
if( !file_root )
|
|
||||||
error_exit( "error at file_root" );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if( !(r = find_root( argv[i] )) )
|
|
||||||
error_exit( "Error in reading parameters" );
|
|
||||||
if( strcmp( r, file_root ) != 0 )
|
|
||||||
error_exit( "Not all roots identical!" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read out position.
|
|
||||||
*/
|
|
||||||
if( (n = find_x( argv[i] )) < 0 )
|
|
||||||
error_exit( "Error in reading file name" );
|
|
||||||
if( n > width - 1 )
|
|
||||||
width = n;
|
|
||||||
if( (n = find_y( argv[i] )) < 0 )
|
|
||||||
error_exit( "Error in reading file name" );
|
|
||||||
if( n > height - 1 )
|
|
||||||
height = n;
|
|
||||||
|
|
||||||
file_list[n] +=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make output name. and store them in an array.
|
|
||||||
*/
|
|
||||||
if( !(out = im_open( "tmp.v", "t" )) )
|
|
||||||
error_exit("unable to open file for output");
|
|
||||||
|
|
||||||
file_ptr =0;
|
|
||||||
for(i=height; i>=0; i--)
|
|
||||||
for(j=0; j<file_list[i]; j++){
|
|
||||||
im_snprintf( name, 1024, "%s.%dx%d.v", file_root,j,i );
|
|
||||||
output_file = strdup( name );
|
|
||||||
if( !(in[file_ptr] = im_open( output_file, "r" )) )
|
|
||||||
error_exit("unable to open %s for input",output_file);
|
|
||||||
++file_ptr;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
mosaic_analysis(width,height,in,out,xoverlap,yoverlap,vxdisp,vydisp,hxdisp,hydisp);
|
|
||||||
k = 0;
|
|
||||||
for( i=0; i<height; i++ ){
|
|
||||||
for( j=0; j<width; j++ ){
|
|
||||||
fprintf(fp,"%d %d ", hxdisp[k] , hydisp[k] );
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
fprintf(fp,"\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
for( i=0; i<height; i++ )
|
|
||||||
fprintf(fp,"%d %d\n", vxdisp[i] , vydisp[i] );
|
|
||||||
|
|
||||||
|
|
||||||
for(i=0; i<file_ptr; i++)
|
|
||||||
if( im_close(in[i]) == -1)
|
|
||||||
error_exit("unable to close partial file");
|
|
||||||
if( im_close(out) == -1)
|
|
||||||
error_exit("unable to close\n ");
|
|
||||||
fclose( fp );
|
|
||||||
|
|
||||||
vips_shutdown();
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
569
tools/mergeup.c
569
tools/mergeup.c
@ -1,569 +0,0 @@
|
|||||||
/* Join together images
|
|
||||||
*
|
|
||||||
* mergeup x y file_name output_dir <root>.0x0.v <root>.0x1.v ...
|
|
||||||
*
|
|
||||||
* Where the image has been take with patches named as
|
|
||||||
*
|
|
||||||
* . .
|
|
||||||
* . .
|
|
||||||
* <root>.0x1.v <root>.1x1.v ..
|
|
||||||
* <root>.0x0.v <root>.1x0.v ..
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Tries to generate optimal join sequence. Does not require any intermidiate
|
|
||||||
* files for temporary storage.
|
|
||||||
* It uses partials on all IO by including tbmerge / lrmerge programs.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Copyright (C) Feb./1995, Ahmed. Abbood
|
|
||||||
* National Gallery. London
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
This file is part of VIPS.
|
|
||||||
|
|
||||||
VIPS is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
02110-1301 USA
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif /*HAVE_CONFIG_H*/
|
|
||||||
#include <vips/intl.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include <vips/vips.h>
|
|
||||||
|
|
||||||
#define NUM_FILES 1000
|
|
||||||
#define MAXPOINTS 60
|
|
||||||
|
|
||||||
static int xoverlap;
|
|
||||||
static int yoverlap;
|
|
||||||
|
|
||||||
static int file_ptr = 0;
|
|
||||||
static IMAGE *in[ NUM_FILES ];
|
|
||||||
|
|
||||||
/* Strategy: build a tree describing the sequence of joins we want. Walk the
|
|
||||||
* tree assigning temporary file names, compile the tree into a linear
|
|
||||||
* sequence of join commands.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Decoded file name info.
|
|
||||||
*/
|
|
||||||
static char *file_root = NULL;
|
|
||||||
static char *output_file = NULL;
|
|
||||||
static int width = 0; /* Number of frames across */
|
|
||||||
static int height = 0; /* Number of frames down */
|
|
||||||
|
|
||||||
static int file_list[ NUM_FILES ];
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
im_phmerge( Rect *larea, Rect *rarea, Rect *outarea )
|
|
||||||
{
|
|
||||||
|
|
||||||
Rect overlap;
|
|
||||||
|
|
||||||
|
|
||||||
/* Compute overlap.
|
|
||||||
*/
|
|
||||||
im_rect_intersectrect( larea, rarea, &overlap );
|
|
||||||
|
|
||||||
outarea->width = rarea->left + rarea->width;
|
|
||||||
outarea->height = overlap.height;
|
|
||||||
outarea->top = overlap.top;
|
|
||||||
outarea->left = larea->left;
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
im_pvmerge( Rect *tarea, Rect *barea, Rect *outarea )
|
|
||||||
{
|
|
||||||
|
|
||||||
Rect overlap;
|
|
||||||
|
|
||||||
|
|
||||||
/* Compute overlap.
|
|
||||||
*/
|
|
||||||
im_rect_intersectrect( tarea, barea, &overlap );
|
|
||||||
|
|
||||||
outarea->width = overlap.width;
|
|
||||||
outarea->height = barea->top + barea->height ;
|
|
||||||
outarea->left = overlap.left;
|
|
||||||
outarea->top = tarea->top;
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
merge_analysis(int width,int height,IMAGE **in,int xoff,
|
|
||||||
int yoff,int *vxdisp,int *vydisp,int *hxdisp,
|
|
||||||
int *hydisp,Rect *hrect,Rect *vrect)
|
|
||||||
{
|
|
||||||
int i,j;
|
|
||||||
int curr_im,offset;
|
|
||||||
int curr_x, curr_y;
|
|
||||||
Rect larea, rarea, barea;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
curr_im = -1;
|
|
||||||
curr_x = -1;
|
|
||||||
curr_y = -1;
|
|
||||||
for(i=0; i<=height; i++){
|
|
||||||
for(j=0; j<=width; j++){
|
|
||||||
++curr_im;
|
|
||||||
if( width == 0 ){
|
|
||||||
++curr_x;
|
|
||||||
hrect[curr_x].width = in[curr_im]->Xsize;
|
|
||||||
hrect[curr_x].height= in[curr_im]->Ysize;
|
|
||||||
hrect[curr_x].top = 0;
|
|
||||||
hrect[curr_x].left = 0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if( j == 0){
|
|
||||||
++curr_x;
|
|
||||||
|
|
||||||
/* Area occupied by left image.
|
|
||||||
*/
|
|
||||||
larea.left = 0;
|
|
||||||
larea.top = 0;
|
|
||||||
larea.height = in[curr_im]->Ysize;
|
|
||||||
larea.width = in[curr_im]->Xsize;
|
|
||||||
/* Area occupied by right image.
|
|
||||||
*/
|
|
||||||
if( in[curr_im]->Xsize < xoff )
|
|
||||||
offset = 0;
|
|
||||||
else
|
|
||||||
offset =xoff;
|
|
||||||
rarea.left = in[curr_im]->Xsize - (offset + hxdisp[curr_x]) ;
|
|
||||||
rarea.top = hydisp[curr_x];
|
|
||||||
rarea.width = in[curr_im+1]->Xsize;
|
|
||||||
rarea.height = in[curr_im+1]->Ysize;
|
|
||||||
im_phmerge( &larea, &rarea, &hrect[curr_x] );
|
|
||||||
}
|
|
||||||
else if( j < width ){
|
|
||||||
++curr_x;
|
|
||||||
|
|
||||||
/* Area occupied by right image.
|
|
||||||
*/
|
|
||||||
if( in[curr_im+1]->Xsize < xoff )
|
|
||||||
offset = 0;
|
|
||||||
else
|
|
||||||
offset =xoff;
|
|
||||||
|
|
||||||
rarea.left = hrect[curr_x -1].width - (offset + hxdisp[curr_x]) ;
|
|
||||||
rarea.top = hydisp[curr_x];
|
|
||||||
rarea.width = in[curr_im+1]->Xsize;
|
|
||||||
rarea.height = in[curr_im+1]->Ysize;
|
|
||||||
im_phmerge( &hrect[curr_x -1], &rarea, &hrect[curr_x] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( i > 0 ){
|
|
||||||
++curr_y;
|
|
||||||
|
|
||||||
/* Area occupied by bottom image in output.
|
|
||||||
*/
|
|
||||||
barea.left = vxdisp[curr_y];
|
|
||||||
barea.width = hrect[curr_x].width;
|
|
||||||
barea.height = hrect[curr_x].height;
|
|
||||||
if( in[curr_x - width]->Ysize < yoff )
|
|
||||||
offset = 0;
|
|
||||||
else
|
|
||||||
offset = yoff;
|
|
||||||
if( i == 1){
|
|
||||||
barea.top = hrect[curr_x - width].height - offset - vydisp[curr_y] ;
|
|
||||||
im_pvmerge( &hrect[curr_x - width], &barea, &vrect[curr_y] );
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
barea.top = vrect[curr_y - 1].height - yoff - vydisp[curr_y] ;
|
|
||||||
im_pvmerge( &vrect[curr_y -1], &barea, &vrect[curr_y] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the root name of a file name. Return new, shorter, string.
|
|
||||||
*/
|
|
||||||
static char *
|
|
||||||
find_root( name )
|
|
||||||
char *name;
|
|
||||||
{ char *out = strdup( name );
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
/* Chop off '.v'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( NULL );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
/* Chop off nxn.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( NULL );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
return( out );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the x position of a file name (extract n from <root>.nxm.v).
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
find_x( char *name )
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
char *p;
|
|
||||||
char *out;
|
|
||||||
|
|
||||||
out = strdup( name );
|
|
||||||
|
|
||||||
/* Chop off '.v'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
/* Find '.nxm'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read out x posn.
|
|
||||||
*/
|
|
||||||
if( sscanf( p, ".%dx%*d", &n ) != 1 ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
free( out );
|
|
||||||
|
|
||||||
return( n );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the y position of a file name (extract m from <root>.nxm.v).
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
find_y( char *name )
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
char *p;
|
|
||||||
char *out;
|
|
||||||
|
|
||||||
out = strdup( name );
|
|
||||||
|
|
||||||
/* Chop off '.v'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
*p = '\0';
|
|
||||||
|
|
||||||
/* Find '.nxm'.
|
|
||||||
*/
|
|
||||||
if( !(p = strrchr( out, '.' )) ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read out y posn.
|
|
||||||
*/
|
|
||||||
if( sscanf( p, ".%*dx%d", &m ) != 1 ) {
|
|
||||||
im_error( "find_mosaic",
|
|
||||||
_( "bad file name format '%s'" ), name );
|
|
||||||
free( out );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
free( out );
|
|
||||||
|
|
||||||
return( m );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Join two frames left-right. Have to open them and find their sizes.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
join_leftright(IMAGE *left, IMAGE *right, IMAGE *out, int dx, int dy )
|
|
||||||
{
|
|
||||||
|
|
||||||
if (im_lrmerge(left, right, out, dx, dy, 20) == -1)
|
|
||||||
return( -1 );
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Join two frames up-down. Have to open them and find their sizes.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
join_updown( IMAGE *top, IMAGE *bottom, IMAGE *out, int dx, int dy )
|
|
||||||
{
|
|
||||||
if (im_tbmerge(top, bottom, out, dx, dy, 20) == -1)
|
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
merge_up( int width, int height, IMAGE **inp, IMAGE *outp, int xoff, int yoff,
|
|
||||||
int *hxdisp, int *hydisp, Rect *vrect )
|
|
||||||
{
|
|
||||||
int dx,dy,first_row;
|
|
||||||
int i, j, partial_no, in_no;
|
|
||||||
IMAGE **p_img;
|
|
||||||
char name[29];
|
|
||||||
int v_no, h_no;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
p_img = (IMAGE **) malloc(1 + 3 * width * height * sizeof(IMAGE *));
|
|
||||||
if( p_img == NULL ){
|
|
||||||
im_error( "mergeup", "%s", _( "allocation failure in mergeup") );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
partial_no = 0;
|
|
||||||
v_no = 0;
|
|
||||||
h_no = 0;
|
|
||||||
in_no = 0;
|
|
||||||
first_row = 0;
|
|
||||||
|
|
||||||
if( (width == 0 ) && (height == 0 ) ){
|
|
||||||
im_error( "mergeup", "%s", _( "Need more than one image") );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for(i=0; i<=height; i++){
|
|
||||||
for(j=0; j<=width; j++){
|
|
||||||
p_img[partial_no] = inp[in_no];
|
|
||||||
++partial_no;
|
|
||||||
if( j != 0 ){
|
|
||||||
im_snprintf( name, 29, "partial_img.%d.v",partial_no );
|
|
||||||
if( !( p_img[partial_no] = im_open( name, "p" )) ){
|
|
||||||
free(p_img);
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
++partial_no;
|
|
||||||
dy = hydisp[h_no ] ;
|
|
||||||
dx = -p_img[partial_no-3]->Xsize + hxdisp[h_no] + xoff ;
|
|
||||||
|
|
||||||
if( (height == 0) && ( j == width) )
|
|
||||||
join_leftright( p_img[partial_no-3],
|
|
||||||
p_img[partial_no-2],outp,dx,dy );
|
|
||||||
else
|
|
||||||
join_leftright( p_img[partial_no-3],
|
|
||||||
p_img[partial_no-2],p_img[partial_no-1],dx,dy );
|
|
||||||
++h_no;
|
|
||||||
}
|
|
||||||
++in_no;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( first_row == 0)
|
|
||||||
first_row = partial_no - 1;
|
|
||||||
|
|
||||||
if( ( i > 0 ) || ( height == 0) ){
|
|
||||||
if( i < height ){
|
|
||||||
im_snprintf( name, 29, "partial_img.%d.v", partial_no );
|
|
||||||
if( !( p_img[partial_no] = im_open( name, "p" )) ){
|
|
||||||
free(p_img);
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
++partial_no;
|
|
||||||
|
|
||||||
dy = -( vrect[v_no].height - p_img[partial_no-2]->Ysize );
|
|
||||||
dx = vrect[v_no].left ;
|
|
||||||
|
|
||||||
++v_no;
|
|
||||||
join_updown( p_img[first_row],
|
|
||||||
p_img[partial_no-2], p_img[partial_no-1],dx,dy );
|
|
||||||
first_row = partial_no-1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
dy = -( vrect[v_no].height - p_img[partial_no-1]->Ysize );
|
|
||||||
dx = vrect[v_no].left ;
|
|
||||||
|
|
||||||
join_updown( p_img[first_row], p_img[partial_no-1],outp,dx,dy );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main( argc, argv )
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
|
||||||
int i, n, j, k;
|
|
||||||
char name[ 1000 ];
|
|
||||||
FILE *fp;
|
|
||||||
char *r;
|
|
||||||
IMAGE *out;
|
|
||||||
int vxdisp[NUM_FILES + 1] ;
|
|
||||||
int vydisp[NUM_FILES + 1] ;
|
|
||||||
int hxdisp[NUM_FILES + 1] ;
|
|
||||||
int hydisp[NUM_FILES + 1] ;
|
|
||||||
Rect hrect[NUM_FILES];
|
|
||||||
Rect vrect[NUM_FILES];
|
|
||||||
|
|
||||||
if( im_init_world( argv[0] ) )
|
|
||||||
error_exit( "unable to start VIPS" );
|
|
||||||
textdomain( GETTEXT_PACKAGE );
|
|
||||||
setlocale( LC_ALL, "" );
|
|
||||||
|
|
||||||
/* Too many?
|
|
||||||
*/
|
|
||||||
if( argc > NUM_FILES + 1 )
|
|
||||||
error_exit( "Too many files to merge" );
|
|
||||||
for(i=0; i< NUM_FILES; i++)
|
|
||||||
file_list[i] = 0;
|
|
||||||
/* Too few?
|
|
||||||
*/
|
|
||||||
if( argc == 1 )
|
|
||||||
error_exit( "usage: xoverlap yoverlap file_name output_dir "
|
|
||||||
"<root>.0x0.v <root>.0x1.v ..." );
|
|
||||||
xoverlap = atoi(argv[1]);
|
|
||||||
yoverlap = atoi(argv[2]);
|
|
||||||
fp = fopen( argv[3] , "r" );
|
|
||||||
|
|
||||||
for( i = 5; i < argc; i++ ){
|
|
||||||
/* Find/check root.
|
|
||||||
*/
|
|
||||||
if( !file_root ) {
|
|
||||||
file_root = find_root( argv[i] );
|
|
||||||
if( !file_root )
|
|
||||||
error_exit( "error at file_root" );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if( !(r = find_root( argv[i] )) )
|
|
||||||
error_exit( "Error in reading parameters" );
|
|
||||||
if( strcmp( r, file_root ) != 0 )
|
|
||||||
error_exit( "Not all roots identical!" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read out position.
|
|
||||||
*/
|
|
||||||
if( (n = find_x( argv[i] )) < 0 )
|
|
||||||
error_exit( "Error in reading file name" );
|
|
||||||
if( n > width - 1 )
|
|
||||||
width = n;
|
|
||||||
if( (n = find_y( argv[i] )) < 0 )
|
|
||||||
error_exit( "Error in reading file name" );
|
|
||||||
if( n > height - 1 )
|
|
||||||
height = n;
|
|
||||||
|
|
||||||
file_list[n] +=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make output name. and store them in an array.
|
|
||||||
*/
|
|
||||||
im_snprintf( name, 1000, "%s/paint.hr.v", argv[4] );
|
|
||||||
if( !(out = im_open( name, "w" )) )
|
|
||||||
error_exit("unable to open file for output");
|
|
||||||
|
|
||||||
file_ptr =0;
|
|
||||||
for(i=height; i>=0; i--)
|
|
||||||
for(j=0; j<file_list[i]; j++){
|
|
||||||
im_snprintf( name, 1000, "%s.%dx%d.v", file_root,j,i );
|
|
||||||
output_file = strdup( name );
|
|
||||||
if( !(in[file_ptr] = im_open( output_file, "r" )) )
|
|
||||||
error_exit("unable to open %s for input",output_file);
|
|
||||||
++file_ptr;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
k = 0;
|
|
||||||
for( i=0; i<height; i++ ){
|
|
||||||
for( j=0; j<width; j++ ){
|
|
||||||
if(fscanf(fp,"%d %d ", &hxdisp[k] , &hydisp[k])!=2)
|
|
||||||
error_exit("argh");
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
if(fscanf(fp,"\n")!=0)
|
|
||||||
error_exit("argh3");
|
|
||||||
}
|
|
||||||
|
|
||||||
for( i=0; i<height; i++ )
|
|
||||||
if(fscanf(fp,"%d %d\n", &vxdisp[i] , &vydisp[i])!=2)
|
|
||||||
error_exit("argh2");
|
|
||||||
|
|
||||||
merge_analysis(width,height,in,xoverlap,yoverlap,vxdisp,vydisp,hxdisp,hydisp,hrect,vrect);
|
|
||||||
merge_up( width, height, in, out, xoverlap, yoverlap, hxdisp, hydisp, vrect );
|
|
||||||
|
|
||||||
for(i=0; i<file_ptr; i++)
|
|
||||||
if( im_close(in[i]) == -1)
|
|
||||||
error_exit("unable to close partial file");
|
|
||||||
if( im_close(out) == -1)
|
|
||||||
error_exit("unable to close\n ");
|
|
||||||
|
|
||||||
vips_shutdown();
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
228
tools/vipsedit
Executable file
228
tools/vipsedit
Executable file
@ -0,0 +1,228 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# vipsedit - temporary wrapper script for .libs/vipsedit
|
||||||
|
# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
|
||||||
|
#
|
||||||
|
# The vipsedit program cannot be directly executed until all the libtool
|
||||||
|
# libraries that it depends on are installed.
|
||||||
|
#
|
||||||
|
# This wrapper script should never be moved out of the build directory.
|
||||||
|
# If it is, it will not operate correctly.
|
||||||
|
|
||||||
|
# Sed substitution that helps us do robust quoting. It backslashifies
|
||||||
|
# metacharacters that are still active within double-quoted strings.
|
||||||
|
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
|
||||||
|
|
||||||
|
# Be Bourne compatible
|
||||||
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||||
|
emulate sh
|
||||||
|
NULLCMD=:
|
||||||
|
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
||||||
|
# is contrary to our usage. Disable this feature.
|
||||||
|
alias -g '${1+"$@"}'='"$@"'
|
||||||
|
setopt NO_GLOB_SUBST
|
||||||
|
else
|
||||||
|
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
|
||||||
|
fi
|
||||||
|
BIN_SH=xpg4; export BIN_SH # for Tru64
|
||||||
|
DUALCASE=1; export DUALCASE # for MKS sh
|
||||||
|
|
||||||
|
# The HP-UX ksh and POSIX shell print the target directory to stdout
|
||||||
|
# if CDPATH is set.
|
||||||
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||||
|
|
||||||
|
relink_command="(cd /home/john/GIT/libvips/tools; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=/home/john/packages/gems/lib:/home/john/vips/lib:/usr/local/lib:; export LD_LIBRARY_PATH; PATH=/home/john/packages/gems/bin:/home/john/vips/bin:/usr/local/bin:/home/john/.gem/ruby/1.9/bin:/home/john/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games; export PATH; gcc -std=gnu99 -g -Wall -o \$progdir/\$file vipsedit.o -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/x86_64-linux-gnu -I/usr/include/pango-1.0 -I/usr/include/orc-0.4 -I/usr/include/openslide -I/usr/include/libxml2 -I/usr/include/libpng12 -I/usr/include/libgsf-1 -I/usr/include/libexif -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/include/freetype2 -I/usr/include/OpenEXR -I/usr/include/ImageMagick -Wl,--export-dynamic -pthread -pthread ../libvips/.libs/libvips.so /usr/lib/x86_64-linux-gnu/libMagickWand.so /usr/lib/x86_64-linux-gnu/libMagickCore.so -lpng12 /usr/lib/x86_64-linux-gnu/libtiff.so -ljpeg -lgmodule-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig /usr/lib/x86_64-linux-gnu/libfreetype.so -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 -lfftw3 -lorc-0.4 -llcms2 /usr/lib/x86_64-linux-gnu/libIlmImf.so -lImath -lHalf -lIex -lIlmThread -lopenslide -lcfitsio -lpthread -lwebp -lmatio -lhdf5 -lz -lexif -lm -lstdc++ -fopenmp -pthread -Wl,-rpath -Wl,/home/john/GIT/libvips/libvips/.libs -Wl,-rpath -Wl,/home/john/vips/lib)"
|
||||||
|
|
||||||
|
# This environment variable determines our operation mode.
|
||||||
|
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
|
||||||
|
# install mode needs the following variables:
|
||||||
|
generated_by_libtool_version='2.4.2'
|
||||||
|
notinst_deplibs=' ../libvips/libvips.la'
|
||||||
|
else
|
||||||
|
# When we are sourced in execute mode, $file and $ECHO are already set.
|
||||||
|
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
||||||
|
file="$0"
|
||||||
|
|
||||||
|
# A function that is used when there is no print builtin or printf.
|
||||||
|
func_fallback_echo ()
|
||||||
|
{
|
||||||
|
eval 'cat <<_LTECHO_EOF
|
||||||
|
$1
|
||||||
|
_LTECHO_EOF'
|
||||||
|
}
|
||||||
|
ECHO="printf %s\\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Very basic option parsing. These options are (a) specific to
|
||||||
|
# the libtool wrapper, (b) are identical between the wrapper
|
||||||
|
# /script/ and the wrapper /executable/ which is used only on
|
||||||
|
# windows platforms, and (c) all begin with the string --lt-
|
||||||
|
# (application programs are unlikely to have options which match
|
||||||
|
# this pattern).
|
||||||
|
#
|
||||||
|
# There are only two supported options: --lt-debug and
|
||||||
|
# --lt-dump-script. There is, deliberately, no --lt-help.
|
||||||
|
#
|
||||||
|
# The first argument to this parsing function should be the
|
||||||
|
# script's ../libtool value, followed by no.
|
||||||
|
lt_option_debug=
|
||||||
|
func_parse_lt_options ()
|
||||||
|
{
|
||||||
|
lt_script_arg0=$0
|
||||||
|
shift
|
||||||
|
for lt_opt
|
||||||
|
do
|
||||||
|
case "$lt_opt" in
|
||||||
|
--lt-debug) lt_option_debug=1 ;;
|
||||||
|
--lt-dump-script)
|
||||||
|
lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
|
||||||
|
test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
|
||||||
|
lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'`
|
||||||
|
cat "$lt_dump_D/$lt_dump_F"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--lt-*)
|
||||||
|
$ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Print the debug banner immediately:
|
||||||
|
if test -n "$lt_option_debug"; then
|
||||||
|
echo "vipsedit:vipsedit:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1" 1>&2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Used when --lt-debug. Prints its arguments to stdout
|
||||||
|
# (redirection is the responsibility of the caller)
|
||||||
|
func_lt_dump_args ()
|
||||||
|
{
|
||||||
|
lt_dump_args_N=1;
|
||||||
|
for lt_arg
|
||||||
|
do
|
||||||
|
$ECHO "vipsedit:vipsedit:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg"
|
||||||
|
lt_dump_args_N=`expr $lt_dump_args_N + 1`
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Core function for launching the target application
|
||||||
|
func_exec_program_core ()
|
||||||
|
{
|
||||||
|
|
||||||
|
if test -n "$lt_option_debug"; then
|
||||||
|
$ECHO "vipsedit:vipsedit:${LINENO}: newargv[0]: $progdir/$program" 1>&2
|
||||||
|
func_lt_dump_args ${1+"$@"} 1>&2
|
||||||
|
fi
|
||||||
|
exec "$progdir/$program" ${1+"$@"}
|
||||||
|
|
||||||
|
$ECHO "$0: cannot exec $program $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# A function to encapsulate launching the target application
|
||||||
|
# Strips options in the --lt-* namespace from $@ and
|
||||||
|
# launches target application with the remaining arguments.
|
||||||
|
func_exec_program ()
|
||||||
|
{
|
||||||
|
case " $* " in
|
||||||
|
*\ --lt-*)
|
||||||
|
for lt_wr_arg
|
||||||
|
do
|
||||||
|
case $lt_wr_arg in
|
||||||
|
--lt-*) ;;
|
||||||
|
*) set x "$@" "$lt_wr_arg"; shift;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done ;;
|
||||||
|
esac
|
||||||
|
func_exec_program_core ${1+"$@"}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
func_parse_lt_options "$0" ${1+"$@"}
|
||||||
|
|
||||||
|
# Find the directory that this script lives in.
|
||||||
|
thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
|
||||||
|
test "x$thisdir" = "x$file" && thisdir=.
|
||||||
|
|
||||||
|
# Follow symbolic links until we get to the real thisdir.
|
||||||
|
file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
|
||||||
|
while test -n "$file"; do
|
||||||
|
destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
|
||||||
|
|
||||||
|
# If there was a directory component, then change thisdir.
|
||||||
|
if test "x$destdir" != "x$file"; then
|
||||||
|
case "$destdir" in
|
||||||
|
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
|
||||||
|
*) thisdir="$thisdir/$destdir" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
file=`$ECHO "$file" | /bin/sed 's%^.*/%%'`
|
||||||
|
file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
|
||||||
|
done
|
||||||
|
|
||||||
|
# Usually 'no', except on cygwin/mingw when embedded into
|
||||||
|
# the cwrapper.
|
||||||
|
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
|
||||||
|
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
|
||||||
|
# special case for '.'
|
||||||
|
if test "$thisdir" = "."; then
|
||||||
|
thisdir=`pwd`
|
||||||
|
fi
|
||||||
|
# remove .libs from thisdir
|
||||||
|
case "$thisdir" in
|
||||||
|
*[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;;
|
||||||
|
.libs ) thisdir=. ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try to get the absolute directory name.
|
||||||
|
absdir=`cd "$thisdir" && pwd`
|
||||||
|
test -n "$absdir" && thisdir="$absdir"
|
||||||
|
|
||||||
|
program=lt-'vipsedit'
|
||||||
|
progdir="$thisdir/.libs"
|
||||||
|
|
||||||
|
if test ! -f "$progdir/$program" ||
|
||||||
|
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
|
||||||
|
test "X$file" != "X$progdir/$program"; }; then
|
||||||
|
|
||||||
|
file="$$-$program"
|
||||||
|
|
||||||
|
if test ! -d "$progdir"; then
|
||||||
|
mkdir "$progdir"
|
||||||
|
else
|
||||||
|
rm -f "$progdir/$file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# relink executable if necessary
|
||||||
|
if test -n "$relink_command"; then
|
||||||
|
if relink_command_output=`eval $relink_command 2>&1`; then :
|
||||||
|
else
|
||||||
|
printf %s\n "$relink_command_output" >&2
|
||||||
|
rm -f "$progdir/$file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
|
||||||
|
{ rm -f "$progdir/$program";
|
||||||
|
mv -f "$progdir/$file" "$progdir/$program"; }
|
||||||
|
rm -f "$progdir/$file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f "$progdir/$program"; then
|
||||||
|
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
||||||
|
# Run the actual program with our arguments.
|
||||||
|
func_exec_program ${1+"$@"}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# The program doesn't exist.
|
||||||
|
$ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
|
||||||
|
$ECHO "This script is just a wrapper for $program." 1>&2
|
||||||
|
$ECHO "See the libtool documentation for more information." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
@ -136,7 +136,7 @@ main( int argc, char **argv )
|
|||||||
setlocale( LC_ALL, "" );
|
setlocale( LC_ALL, "" );
|
||||||
|
|
||||||
context = g_option_context_new(
|
context = g_option_context_new(
|
||||||
_( "vipsfile - edit vipsfile header" ) );
|
_( "vipsedit - edit vips file header" ) );
|
||||||
g_option_context_add_main_entries( context, entries, GETTEXT_PACKAGE );
|
g_option_context_add_main_entries( context, entries, GETTEXT_PACKAGE );
|
||||||
g_option_context_add_group( context, im_get_option_group() );
|
g_option_context_add_group( context, im_get_option_group() );
|
||||||
if( !g_option_context_parse( context, &argc, &argv, &error ) ) {
|
if( !g_option_context_parse( context, &argc, &argv, &error ) ) {
|
||||||
@ -148,7 +148,7 @@ main( int argc, char **argv )
|
|||||||
exit( -1 );
|
exit( -1 );
|
||||||
}
|
}
|
||||||
if( argc != 2 ) {
|
if( argc != 2 ) {
|
||||||
fprintf( stderr, _( "usage: %s [OPTION...] vipsfile\n" ),
|
fprintf( stderr, _( "usage: %s [OPTION...] vips-file\n" ),
|
||||||
g_get_prgname() );
|
g_get_prgname() );
|
||||||
exit( -1 );
|
exit( -1 );
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ main( int argc, char **argv )
|
|||||||
error_exit( "%s", _( "could not get ext data" ) );
|
error_exit( "%s", _( "could not get ext data" ) );
|
||||||
|
|
||||||
/* Strip trailing whitespace ... we can get stray \n at the
|
/* Strip trailing whitespace ... we can get stray \n at the
|
||||||
* end, eg. "echo | edvips --setext fred.v".
|
* end, eg. "echo | editvips --setext fred.v".
|
||||||
*/
|
*/
|
||||||
while( size > 0 && isspace( xml[size - 1] ) )
|
while( size > 0 && isspace( xml[size - 1] ) )
|
||||||
size -= 1;
|
size -= 1;
|
228
tools/vipsheader
Executable file
228
tools/vipsheader
Executable file
@ -0,0 +1,228 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# vipsheader - temporary wrapper script for .libs/vipsheader
|
||||||
|
# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
|
||||||
|
#
|
||||||
|
# The vipsheader program cannot be directly executed until all the libtool
|
||||||
|
# libraries that it depends on are installed.
|
||||||
|
#
|
||||||
|
# This wrapper script should never be moved out of the build directory.
|
||||||
|
# If it is, it will not operate correctly.
|
||||||
|
|
||||||
|
# Sed substitution that helps us do robust quoting. It backslashifies
|
||||||
|
# metacharacters that are still active within double-quoted strings.
|
||||||
|
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
|
||||||
|
|
||||||
|
# Be Bourne compatible
|
||||||
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||||
|
emulate sh
|
||||||
|
NULLCMD=:
|
||||||
|
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
||||||
|
# is contrary to our usage. Disable this feature.
|
||||||
|
alias -g '${1+"$@"}'='"$@"'
|
||||||
|
setopt NO_GLOB_SUBST
|
||||||
|
else
|
||||||
|
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
|
||||||
|
fi
|
||||||
|
BIN_SH=xpg4; export BIN_SH # for Tru64
|
||||||
|
DUALCASE=1; export DUALCASE # for MKS sh
|
||||||
|
|
||||||
|
# The HP-UX ksh and POSIX shell print the target directory to stdout
|
||||||
|
# if CDPATH is set.
|
||||||
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||||
|
|
||||||
|
relink_command="(cd /home/john/GIT/libvips/tools; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=/home/john/packages/gems/lib:/home/john/vips/lib:/usr/local/lib:; export LD_LIBRARY_PATH; PATH=/home/john/packages/gems/bin:/home/john/vips/bin:/usr/local/bin:/home/john/.gem/ruby/1.9/bin:/home/john/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games; export PATH; gcc -std=gnu99 -g -Wall -o \$progdir/\$file vipsheader.o -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/x86_64-linux-gnu -I/usr/include/pango-1.0 -I/usr/include/orc-0.4 -I/usr/include/openslide -I/usr/include/libxml2 -I/usr/include/libpng12 -I/usr/include/libgsf-1 -I/usr/include/libexif -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/include/freetype2 -I/usr/include/OpenEXR -I/usr/include/ImageMagick -Wl,--export-dynamic -pthread -pthread ../libvips/.libs/libvips.so /usr/lib/x86_64-linux-gnu/libMagickWand.so /usr/lib/x86_64-linux-gnu/libMagickCore.so -lpng12 /usr/lib/x86_64-linux-gnu/libtiff.so -ljpeg -lgmodule-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig /usr/lib/x86_64-linux-gnu/libfreetype.so -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 -lfftw3 -lorc-0.4 -llcms2 /usr/lib/x86_64-linux-gnu/libIlmImf.so -lImath -lHalf -lIex -lIlmThread -lopenslide -lcfitsio -lpthread -lwebp -lmatio -lhdf5 -lz -lexif -lm -lstdc++ -fopenmp -pthread -Wl,-rpath -Wl,/home/john/GIT/libvips/libvips/.libs -Wl,-rpath -Wl,/home/john/vips/lib)"
|
||||||
|
|
||||||
|
# This environment variable determines our operation mode.
|
||||||
|
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
|
||||||
|
# install mode needs the following variables:
|
||||||
|
generated_by_libtool_version='2.4.2'
|
||||||
|
notinst_deplibs=' ../libvips/libvips.la'
|
||||||
|
else
|
||||||
|
# When we are sourced in execute mode, $file and $ECHO are already set.
|
||||||
|
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
||||||
|
file="$0"
|
||||||
|
|
||||||
|
# A function that is used when there is no print builtin or printf.
|
||||||
|
func_fallback_echo ()
|
||||||
|
{
|
||||||
|
eval 'cat <<_LTECHO_EOF
|
||||||
|
$1
|
||||||
|
_LTECHO_EOF'
|
||||||
|
}
|
||||||
|
ECHO="printf %s\\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Very basic option parsing. These options are (a) specific to
|
||||||
|
# the libtool wrapper, (b) are identical between the wrapper
|
||||||
|
# /script/ and the wrapper /executable/ which is used only on
|
||||||
|
# windows platforms, and (c) all begin with the string --lt-
|
||||||
|
# (application programs are unlikely to have options which match
|
||||||
|
# this pattern).
|
||||||
|
#
|
||||||
|
# There are only two supported options: --lt-debug and
|
||||||
|
# --lt-dump-script. There is, deliberately, no --lt-help.
|
||||||
|
#
|
||||||
|
# The first argument to this parsing function should be the
|
||||||
|
# script's ../libtool value, followed by no.
|
||||||
|
lt_option_debug=
|
||||||
|
func_parse_lt_options ()
|
||||||
|
{
|
||||||
|
lt_script_arg0=$0
|
||||||
|
shift
|
||||||
|
for lt_opt
|
||||||
|
do
|
||||||
|
case "$lt_opt" in
|
||||||
|
--lt-debug) lt_option_debug=1 ;;
|
||||||
|
--lt-dump-script)
|
||||||
|
lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
|
||||||
|
test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
|
||||||
|
lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'`
|
||||||
|
cat "$lt_dump_D/$lt_dump_F"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--lt-*)
|
||||||
|
$ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Print the debug banner immediately:
|
||||||
|
if test -n "$lt_option_debug"; then
|
||||||
|
echo "vipsheader:vipsheader:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1" 1>&2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Used when --lt-debug. Prints its arguments to stdout
|
||||||
|
# (redirection is the responsibility of the caller)
|
||||||
|
func_lt_dump_args ()
|
||||||
|
{
|
||||||
|
lt_dump_args_N=1;
|
||||||
|
for lt_arg
|
||||||
|
do
|
||||||
|
$ECHO "vipsheader:vipsheader:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg"
|
||||||
|
lt_dump_args_N=`expr $lt_dump_args_N + 1`
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Core function for launching the target application
|
||||||
|
func_exec_program_core ()
|
||||||
|
{
|
||||||
|
|
||||||
|
if test -n "$lt_option_debug"; then
|
||||||
|
$ECHO "vipsheader:vipsheader:${LINENO}: newargv[0]: $progdir/$program" 1>&2
|
||||||
|
func_lt_dump_args ${1+"$@"} 1>&2
|
||||||
|
fi
|
||||||
|
exec "$progdir/$program" ${1+"$@"}
|
||||||
|
|
||||||
|
$ECHO "$0: cannot exec $program $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# A function to encapsulate launching the target application
|
||||||
|
# Strips options in the --lt-* namespace from $@ and
|
||||||
|
# launches target application with the remaining arguments.
|
||||||
|
func_exec_program ()
|
||||||
|
{
|
||||||
|
case " $* " in
|
||||||
|
*\ --lt-*)
|
||||||
|
for lt_wr_arg
|
||||||
|
do
|
||||||
|
case $lt_wr_arg in
|
||||||
|
--lt-*) ;;
|
||||||
|
*) set x "$@" "$lt_wr_arg"; shift;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done ;;
|
||||||
|
esac
|
||||||
|
func_exec_program_core ${1+"$@"}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
func_parse_lt_options "$0" ${1+"$@"}
|
||||||
|
|
||||||
|
# Find the directory that this script lives in.
|
||||||
|
thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
|
||||||
|
test "x$thisdir" = "x$file" && thisdir=.
|
||||||
|
|
||||||
|
# Follow symbolic links until we get to the real thisdir.
|
||||||
|
file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
|
||||||
|
while test -n "$file"; do
|
||||||
|
destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
|
||||||
|
|
||||||
|
# If there was a directory component, then change thisdir.
|
||||||
|
if test "x$destdir" != "x$file"; then
|
||||||
|
case "$destdir" in
|
||||||
|
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
|
||||||
|
*) thisdir="$thisdir/$destdir" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
file=`$ECHO "$file" | /bin/sed 's%^.*/%%'`
|
||||||
|
file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
|
||||||
|
done
|
||||||
|
|
||||||
|
# Usually 'no', except on cygwin/mingw when embedded into
|
||||||
|
# the cwrapper.
|
||||||
|
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
|
||||||
|
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
|
||||||
|
# special case for '.'
|
||||||
|
if test "$thisdir" = "."; then
|
||||||
|
thisdir=`pwd`
|
||||||
|
fi
|
||||||
|
# remove .libs from thisdir
|
||||||
|
case "$thisdir" in
|
||||||
|
*[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;;
|
||||||
|
.libs ) thisdir=. ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try to get the absolute directory name.
|
||||||
|
absdir=`cd "$thisdir" && pwd`
|
||||||
|
test -n "$absdir" && thisdir="$absdir"
|
||||||
|
|
||||||
|
program=lt-'vipsheader'
|
||||||
|
progdir="$thisdir/.libs"
|
||||||
|
|
||||||
|
if test ! -f "$progdir/$program" ||
|
||||||
|
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
|
||||||
|
test "X$file" != "X$progdir/$program"; }; then
|
||||||
|
|
||||||
|
file="$$-$program"
|
||||||
|
|
||||||
|
if test ! -d "$progdir"; then
|
||||||
|
mkdir "$progdir"
|
||||||
|
else
|
||||||
|
rm -f "$progdir/$file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# relink executable if necessary
|
||||||
|
if test -n "$relink_command"; then
|
||||||
|
if relink_command_output=`eval $relink_command 2>&1`; then :
|
||||||
|
else
|
||||||
|
printf %s\n "$relink_command_output" >&2
|
||||||
|
rm -f "$progdir/$file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
|
||||||
|
{ rm -f "$progdir/$program";
|
||||||
|
mv -f "$progdir/$file" "$progdir/$program"; }
|
||||||
|
rm -f "$progdir/$file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f "$progdir/$program"; then
|
||||||
|
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
||||||
|
# Run the actual program with our arguments.
|
||||||
|
func_exec_program ${1+"$@"}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# The program doesn't exist.
|
||||||
|
$ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
|
||||||
|
$ECHO "This script is just a wrapper for $program." 1>&2
|
||||||
|
$ECHO "See the libtool documentation for more information." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user