This commit is contained in:
John Cupitt 2009-10-23 08:18:39 +00:00
parent ab15d8f8ee
commit 80201ef701
4 changed files with 34 additions and 91 deletions

View File

@ -17,11 +17,11 @@ pkginclude_HEADERS = \
almostdeprecated.h \
proto.h \
image.h \
vips \
rect.h \
region.h \
generate.h \
memory.h \
r_access.h \
struct.h \
private.h \
semaphore.h \

View File

@ -1,88 +0,0 @@
/* r_access.h
*
* 2006-09-21 tcv
* random access to images and regions
*
* 12/5/09
* - add casts to IM__VALUE_FROM_ARRAY() to remove confusion about the type of the result
*/
#ifndef IM_R_ACCESS_H
#define IM_R_ACCESS_H
#include <vips/vips.h>
/** ARRAY MEMBER MACROS **/
/* these are local */
#define IM__TYPE_FROM_ARRAY(type,vptr,i) ( ((type*) (vptr))[i] )
#define IM__CHAR_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( gint8, (vptr), (i) )
#define IM__UCHAR_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( guint8, (vptr), (i) )
#define IM__SHORT_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( gint16, (vptr), (i) )
#define IM__USHORT_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( guint16, (vptr), (i) )
#define IM__INT_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( gint32, (vptr), (i) )
#define IM__UINT_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( guint32, (vptr), (i) )
#define IM__FLOAT_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( float, (vptr), (i) )
#define IM__DOUBLE_FROM_ARRAY(vptr,i) IM__TYPE_FROM_ARRAY( double, (vptr), (i) )
#define IM__VALUE_FROM_ARRAY(band_fmt,vptr,i) ( \
( IM_BANDFMT_DOUBLE == (band_fmt) ) ? (double) IM__DOUBLE_FROM_ARRAY( (vptr), (i) ) \
: ( IM_BANDFMT_FLOAT == (band_fmt) ) ? (double) IM__FLOAT_FROM_ARRAY( (vptr), (i) ) \
: ( IM_BANDFMT_INT == (band_fmt) ) ? (double) IM__INT_FROM_ARRAY( (vptr), (i) ) \
: ( IM_BANDFMT_UINT == (band_fmt) ) ? (double) IM__UINT_FROM_ARRAY( (vptr), (i) ) \
: ( IM_BANDFMT_SHORT == (band_fmt) ) ? (double) IM__SHORT_FROM_ARRAY( (vptr), (i) ) \
: ( IM_BANDFMT_USHORT == (band_fmt) ) ? (double) IM__USHORT_FROM_ARRAY( (vptr), (i) ) \
: ( IM_BANDFMT_CHAR == (band_fmt) ) ? (double) IM__CHAR_FROM_ARRAY( (vptr), (i) ) \
: (double) IM__UCHAR_FROM_ARRAY( (vptr), (i) ) )
#define IM__ARRAY_ASSIGNMENT(band_fmt,vptr,i,val) ( \
( IM_BANDFMT_DOUBLE == (band_fmt) ) ? ( IM__DOUBLE_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM_BANDFMT_FLOAT == (band_fmt) ) ? ( IM__FLOAT_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM_BANDFMT_INT == (band_fmt) ) ? ( IM__INT_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM_BANDFMT_UINT == (band_fmt) ) ? ( IM__UINT_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM_BANDFMT_SHORT == (band_fmt) ) ? ( IM__SHORT_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM_BANDFMT_USHORT == (band_fmt) ) ? ( IM__USHORT_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM_BANDFMT_CHAR == (band_fmt) ) ? ( IM__CHAR_FROM_ARRAY( (vptr), (i) )= (val) ) \
: ( IM__UCHAR_FROM_ARRAY( (vptr), (i) )= (val) ) )
#define IM__ARRAY_INCREMENT(band_fmt,vptr,i,val) ( \
( IM_BANDFMT_DOUBLE == (band_fmt) ) ? ( IM__DOUBLE_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM_BANDFMT_FLOAT == (band_fmt) ) ? ( IM__FLOAT_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM_BANDFMT_INT == (band_fmt) ) ? ( IM__INT_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM_BANDFMT_UINT == (band_fmt) ) ? ( IM__UINT_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM_BANDFMT_SHORT == (band_fmt) ) ? ( IM__SHORT_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM_BANDFMT_USHORT == (band_fmt) ) ? ( IM__USHORT_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM_BANDFMT_CHAR == (band_fmt) ) ? ( IM__CHAR_FROM_ARRAY( (vptr), (i) )+= (val) ) \
: ( IM__UCHAR_FROM_ARRAY( (vptr), (i) )+= (val) ) )
/** IMAGE MEMBER MACROS **/
/* export these */
#define IM_IMAGE_VALUE(im,x,y,band) IM__VALUE_FROM_ARRAY( (im)-> BandFmt, \
IM_IMAGE_ADDR( (im), (x), (y) ), (band) )
#define IM_IMAGE_ASSIGNMENT(im,x,y,band,val) IM__ARRAY_ASSIGNMENT( (im)-> BandFmt, \
IM_IMAGE_ADDR( (im), (x), (y) ), (band), (val) )
#define IM_IMAGE_INCREMENT(im,x,y,band,val) IM__ARRAY_INCREMENT( (im)-> BandFmt, \
IM_IMAGE_ADDR( (im), (x), (y) ), (band), (val) )
/** REGION MEMBER MACROS **/
/* export these */
#define IM_REGION_VALUE(reg,x,y,band) IM__VALUE_FROM_ARRAY( (reg)-> im-> BandFmt, \
IM_REGION_ADDR( (reg), (x), (y) ), (band) )
#define IM_REGION_ASSIGNMENT(reg,x,y,band,val) IM__ARRAY_ASSIGNMENT( (reg)-> im-> BandFmt, \
IM_REGION_ADDR( (reg), (x), (y) ), (band), (val) )
#define IM_REGION_INCREMENT(reg,x,y,band,val) IM__ARRAY_INCREMENT( (reg)-> im-> BandFmt, \
IM_REGION_ADDR( (reg), (x), (y) ), (band), (val) )
#endif /* IM_R_ACCESS_H */

32
libvips/include/vips/vips Normal file
View File

@ -0,0 +1,32 @@
// Include file to get all VIPS C++ bindings
// Programs should include <vipsCC/vips>, but for compatibility we allow
// <vips/vips> as well, hence this file
/*
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
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#include <vipsCC/vips>

View File

@ -79,9 +79,8 @@
* fields (see <link linkend="libvips-image">image</link>), then search for
* a metadata field of that name (see
* <link linkend="libvips-meta">meta</link>).
* If no field of that name is found, it sets an error and returns -1.
* Use im_header_get_typeof() to test for the
* existance and GType
* existance and #GType
* of a header field.
*
* See <link linkend="libvips-meta">meta</link>