This commit is contained in:
John Cupitt 2009-10-22 08:14:38 +00:00
parent a93662b8c8
commit 7689f0bc60
7 changed files with 30 additions and 89 deletions

View File

@ -91,8 +91,6 @@ int im_cp_desc_array( IMAGE *out, IMAGE *in[] );
int im_setupout( IMAGE * );
int im_writeline( int, IMAGE *, PEL * );
int im_bits_of_fmt( VipsBandFmt fmt );
int im_unmapfile( IMAGE * );
void im_initdesc( IMAGE *,
int, int, int, int, int, int, int, float, float,

View File

@ -252,6 +252,8 @@ int im_amiMSBfirst( void );
IMAGE *im__open_temp( void );
int im_bits_of_fmt( VipsBandFmt fmt );
#ifdef __cplusplus
}
#endif /*__cplusplus*/

View File

@ -1,64 +0,0 @@
/* Return number of bits of band format or -1 on error.
*
* 02/06/05 JF
* - original code
* 12/1/06
* - use a table
*/
/*
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <vips/vips.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
static const int bits[] = {
IM_BBITS_BYTE,
IM_BBITS_BYTE,
IM_BBITS_SHORT,
IM_BBITS_SHORT,
IM_BBITS_INT,
IM_BBITS_INT,
IM_BBITS_FLOAT,
IM_BBITS_COMPLEX,
IM_BBITS_DOUBLE,
IM_BBITS_DPCOMPLEX
};
/* Return number of pel bits for band format, or -1 on error.
*/
int
im_bits_of_fmt( VipsBandFmt fmt )
{
return( fmt < 0 || fmt > IM_BANDFMT_DPCOMPLEX ?
im_error( "im_bits_of_fmt",
_( "unsupported band format: %d" ), fmt ),
-1 :
bits[fmt] );
}

View File

@ -1,11 +1,4 @@
/* @(#) Guess a value for install prefix. Pass in argv[0] (or NULL) as a clue,
* @(#) plus the name of the controlling environment variable (eg. VIPSHOME).
* @(#)
* @(#) const char *
* @(#) im_guess_prefix( const char *argv0, const char *env_name )
* @(#)
* @(#) Don't free the string you get back (treat as result of g_getenv()).
* @(#) The function returns NULL on error.
/* guess the install prefix
*
* Written on: 5/2/01
* Modified on:

View File

@ -1,14 +1,4 @@
/* @(#) Appends one line of history consisting of a buffer of data,
* @(#) time, history and CR in history section of the image descriptor
* @(#) The history variable list must be declared properly
* @(#) by the calling function
* @(#)
* @(#) int im_histlin(variable_list)
* @(#) (variable_list) is (imagedescriptor, format, arg1, arg2, ...)
* @(#) format, arg1, arg2, ... are the same as in printf
* @(#)
* @(#) Returns either 0 (success) or -1 (fail)
* @(#)
/* history handling
*
* Copyright: Nicos Dessipris
* Written on: 16/01/1990

View File

@ -1,7 +1,4 @@
/* @(#) Initialise the IMAGE to impossible startup values. Install the
* @(#) filename.
* @(#)
* @(#) IMAGE *im_init( char *filename )
/* create an IMAGE
*
* Copyright: Nicos Dessipris & Kirk Martinez, 1990
* Written on: 13/02/1990

View File

@ -1515,3 +1515,28 @@ im__open_temp( void )
return( disc );
}
static const int bits[] = {
IM_BBITS_BYTE,
IM_BBITS_BYTE,
IM_BBITS_SHORT,
IM_BBITS_SHORT,
IM_BBITS_INT,
IM_BBITS_INT,
IM_BBITS_FLOAT,
IM_BBITS_COMPLEX,
IM_BBITS_DOUBLE,
IM_BBITS_DPCOMPLEX
};
/* Return number of pel bits for band format, or -1 on error.
*/
int
im_bits_of_fmt( VipsBandFmt fmt )
{
return( fmt < 0 || fmt > IM_BANDFMT_DPCOMPLEX ?
im_error( "im_bits_of_fmt",
_( "unsupported band format: %d" ), fmt ),
-1 :
bits[fmt] );
}