2016-10-20 13:41:32 +02:00
|
|
|
/* image header funcs
|
2009-10-01 20:05:55 +02:00
|
|
|
*
|
|
|
|
* 20/9/09
|
|
|
|
* - from proto.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
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
|
2013-03-07 06:40:19 +01:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
02110-1301 USA
|
2009-10-01 20:05:55 +02:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2011-03-28 18:18:06 +02:00
|
|
|
#ifndef VIPS_HEADER_H
|
|
|
|
#define VIPS_HEADER_H
|
2009-10-01 20:05:55 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
2011-03-27 23:03:38 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_EXIF_NAME:
|
|
|
|
*
|
|
|
|
* The name that JPEG read and write operations use for the image's EXIF data.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_EXIF_NAME "exif-data"
|
|
|
|
|
2011-10-12 12:45:27 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_XMP_NAME:
|
|
|
|
*
|
2015-09-29 19:02:30 +02:00
|
|
|
* The name that read and write operations use for the image's XMP data.
|
2011-10-12 12:45:27 +02:00
|
|
|
*/
|
|
|
|
#define VIPS_META_XMP_NAME "xmp-data"
|
|
|
|
|
2012-11-21 22:33:50 +01:00
|
|
|
/**
|
2017-12-31 11:23:27 +01:00
|
|
|
* VIPS_META_IPTC_NAME:
|
2012-11-21 22:33:50 +01:00
|
|
|
*
|
2017-12-31 11:23:27 +01:00
|
|
|
* The name that read and write operations use for the image's IPTC data.
|
2012-11-21 22:33:50 +01:00
|
|
|
*/
|
2017-12-31 11:23:27 +01:00
|
|
|
#define VIPS_META_IPTC_NAME "iptc-data"
|
2012-11-21 22:33:50 +01:00
|
|
|
|
2015-09-29 19:02:30 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_PHOTOSHOP_NAME:
|
|
|
|
*
|
|
|
|
* The name that TIFF read and write operations use for the image's
|
|
|
|
* TIFFTAG_PHOTOSHOP data.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_PHOTOSHOP_NAME "photoshop-data"
|
|
|
|
|
2011-03-27 23:03:38 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_ICC_NAME:
|
|
|
|
*
|
|
|
|
* The name we use to attach an ICC profile. The file read and write
|
|
|
|
* operations for TIFF, JPEG, PNG and others use this item of metadata to
|
|
|
|
* attach and save ICC profiles. The profile is updated by the
|
|
|
|
* vips_icc_transform() operations.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_ICC_NAME "icc-profile-data"
|
|
|
|
|
2015-12-21 14:53:33 +01:00
|
|
|
/**
|
|
|
|
* VIPS_META_IMAGEDESCRIPTION:
|
|
|
|
*
|
|
|
|
* The IMAGEDESCRIPTION tag. Often has useful metadata.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_IMAGEDESCRIPTION "image-description"
|
|
|
|
|
2011-03-27 23:03:38 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_RESOLUTION_UNIT:
|
|
|
|
*
|
|
|
|
* The JPEG and TIFF read and write operations use this to record the
|
|
|
|
* file's preferred unit for resolution.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_RESOLUTION_UNIT "resolution-unit"
|
|
|
|
|
2013-02-27 13:51:26 +01:00
|
|
|
/**
|
|
|
|
* VIPS_META_LOADER:
|
|
|
|
*
|
|
|
|
* Record the name of the original loader here. Handy for hinting file formats
|
|
|
|
* and for debugging.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_LOADER "vips-loader"
|
|
|
|
|
2017-03-03 15:34:22 +01:00
|
|
|
/**
|
|
|
|
* VIPS_META_SEQUENTIAL:
|
|
|
|
*
|
|
|
|
* Images loaded via vips_sequential() have this int field defined. Some
|
|
|
|
* operations (eg. vips_shrinkv()) add extra caches if they see it on their
|
|
|
|
* input.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_SEQUENTIAL "vips-sequential"
|
|
|
|
|
2016-05-26 15:58:04 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_ORIENTATION:
|
|
|
|
*
|
|
|
|
* The orientation tag for this image. An int from 1 - 8 using the standard
|
|
|
|
* exif/tiff meanings.
|
2016-05-28 12:17:17 +02:00
|
|
|
*
|
|
|
|
* * 1 - The 0th row represents the visual top of the image, and the 0th column
|
|
|
|
* represents the visual left-hand side.
|
|
|
|
* * 2 - The 0th row represents the visual top of the image, and the 0th column
|
|
|
|
* represents the visual right-hand side.
|
|
|
|
* * 3 - The 0th row represents the visual bottom of the image, and the 0th
|
|
|
|
* column represents the visual right-hand side.
|
|
|
|
* * 4 - The 0th row represents the visual bottom of the image, and the 0th
|
|
|
|
* column represents the visual left-hand side.
|
|
|
|
* * 5 - The 0th row represents the visual left-hand side of the image, and the
|
|
|
|
* 0th column represents the visual top.
|
|
|
|
* * 6 - The 0th row represents the visual right-hand side of the image, and the
|
|
|
|
* 0th column represents the visual top.
|
|
|
|
* * 7 - The 0th row represents the visual right-hand side of the image, and the
|
|
|
|
* 0th column represents the visual bottom.
|
|
|
|
* * 8 - The 0th row represents the visual left-hand side of the image, and the
|
|
|
|
* 0th column represents the visual bottom.
|
2016-05-26 15:58:04 +02:00
|
|
|
*/
|
|
|
|
#define VIPS_META_ORIENTATION "orientation"
|
|
|
|
|
2016-11-23 18:20:04 +01:00
|
|
|
/**
|
|
|
|
* VIPS_META_PAGE_HEIGHT:
|
|
|
|
*
|
|
|
|
* If set, the height of each page when this image was loaded. If you save an
|
|
|
|
* image with "page-height" set to a format that supports multiple pages, such
|
|
|
|
* as tiff, the image will be saved as a series of pages.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_PAGE_HEIGHT "page-height"
|
|
|
|
|
2018-04-26 09:55:31 +02:00
|
|
|
/**
|
|
|
|
* VIPS_META_N_PAGES:
|
|
|
|
*
|
|
|
|
* If set, the number of pages in the original file.
|
|
|
|
*/
|
|
|
|
#define VIPS_META_N_PAGES "n-pages"
|
|
|
|
|
2011-12-09 10:42:39 +01:00
|
|
|
guint64 vips_format_sizeof( VipsBandFormat format );
|
2016-07-30 11:51:54 +02:00
|
|
|
guint64 vips_format_sizeof_unsafe( VipsBandFormat format );
|
2011-03-23 15:25:34 +01:00
|
|
|
|
2011-08-26 11:15:39 +02:00
|
|
|
int vips_image_get_width( const VipsImage *image );
|
|
|
|
int vips_image_get_height( const VipsImage *image );
|
|
|
|
int vips_image_get_bands( const VipsImage *image );
|
|
|
|
VipsBandFormat vips_image_get_format( const VipsImage *image );
|
2016-03-01 12:31:54 +01:00
|
|
|
VipsBandFormat vips_image_guess_format( const VipsImage *image );
|
2011-08-26 11:15:39 +02:00
|
|
|
VipsCoding vips_image_get_coding( const VipsImage *image );
|
|
|
|
VipsInterpretation vips_image_get_interpretation( const VipsImage *image );
|
2012-11-01 14:16:54 +01:00
|
|
|
VipsInterpretation vips_image_guess_interpretation( const VipsImage *image );
|
2011-08-26 11:15:39 +02:00
|
|
|
double vips_image_get_xres( const VipsImage *image );
|
|
|
|
double vips_image_get_yres( const VipsImage *image );
|
|
|
|
int vips_image_get_xoffset( const VipsImage *image );
|
|
|
|
int vips_image_get_yoffset( const VipsImage *image );
|
|
|
|
const char *vips_image_get_filename( const VipsImage *image );
|
|
|
|
const char *vips_image_get_mode( const VipsImage *image );
|
2014-09-03 15:32:55 +02:00
|
|
|
double vips_image_get_scale( const VipsImage *image );
|
|
|
|
double vips_image_get_offset( const VipsImage *image );
|
|
|
|
const void *vips_image_get_data( VipsImage *image );
|
2011-03-23 15:25:34 +01:00
|
|
|
|
|
|
|
void vips_image_init_fields( VipsImage *image,
|
|
|
|
int xsize, int ysize, int bands,
|
|
|
|
VipsBandFormat format, VipsCoding coding,
|
|
|
|
VipsInterpretation interpretation,
|
2012-03-02 13:54:50 +01:00
|
|
|
double xres, double yres );
|
2011-03-23 15:25:34 +01:00
|
|
|
|
2016-10-20 13:41:32 +02:00
|
|
|
void vips_image_set( VipsImage *image, const char *name, GValue *value );
|
2013-07-02 13:08:46 +02:00
|
|
|
int vips_image_get( const VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, GValue *value_copy );
|
2013-07-02 13:08:46 +02:00
|
|
|
int vips_image_get_as_string( const VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, char **out );
|
|
|
|
GType vips_image_get_typeof( const VipsImage *image, const char *name );
|
|
|
|
gboolean vips_image_remove( VipsImage *image, const char *name );
|
2011-03-23 15:25:34 +01:00
|
|
|
typedef void *(*VipsImageMapFn)( VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, GValue *value, void *a );
|
2011-06-21 23:37:53 +02:00
|
|
|
void *vips_image_map( VipsImage *image, VipsImageMapFn fn, void *a );
|
2016-11-12 17:37:13 +01:00
|
|
|
gchar **vips_image_get_fields( VipsImage *image );
|
2011-03-22 23:01:37 +01:00
|
|
|
|
2011-09-21 15:50:32 +02:00
|
|
|
void vips_image_set_area( VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, VipsCallbackFn free_fn, void *data );
|
2013-07-02 13:08:46 +02:00
|
|
|
int vips_image_get_area( const VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, void **data );
|
|
|
|
void vips_image_set_blob( VipsImage *image, const char *name,
|
2011-03-27 23:03:38 +02:00
|
|
|
VipsCallbackFn free_fn, void *data, size_t length );
|
2016-10-20 13:41:32 +02:00
|
|
|
int vips_image_get_blob( const VipsImage *image, const char *name,
|
2011-03-27 23:03:38 +02:00
|
|
|
void **data, size_t *length );
|
|
|
|
|
2016-10-20 13:41:32 +02:00
|
|
|
int vips_image_get_int( const VipsImage *image, const char *name, int *out );
|
|
|
|
void vips_image_set_int( VipsImage *image, const char *name, int i );
|
2013-07-02 13:08:46 +02:00
|
|
|
int vips_image_get_double( const VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, double *out );
|
|
|
|
void vips_image_set_double( VipsImage *image, const char *name, double d );
|
2013-07-02 13:08:46 +02:00
|
|
|
int vips_image_get_string( const VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, const char **out );
|
2011-09-21 15:50:32 +02:00
|
|
|
void vips_image_set_string( VipsImage *image,
|
2016-10-20 13:41:32 +02:00
|
|
|
const char *name, const char *str );
|
2016-11-22 19:04:58 +01:00
|
|
|
void vips_image_print_field( const VipsImage *image, const char *field );
|
2011-03-27 23:03:38 +02:00
|
|
|
|
2011-03-22 23:01:37 +01:00
|
|
|
int vips_image_history_printf( VipsImage *image, const char *format, ... )
|
2009-10-03 16:15:24 +02:00
|
|
|
__attribute__((format(printf, 2, 3)));
|
2011-03-22 23:01:37 +01:00
|
|
|
int vips_image_history_args( VipsImage *image,
|
|
|
|
const char *name, int argc, char *argv[] );
|
|
|
|
const char *vips_image_get_history( VipsImage *image );
|
2009-10-03 16:15:24 +02:00
|
|
|
|
2009-10-01 20:05:55 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
2011-03-28 18:18:06 +02:00
|
|
|
#endif /*VIPS_HEADER_H*/
|