2016-10-15 13:29:14 +02:00
|
|
|
/* Private decls shared by all foreign.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright (C) 1991-2005 The National Gallery
|
|
|
|
|
|
|
|
This library 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.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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 library; 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
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2019-07-08 11:39:44 +02:00
|
|
|
#ifndef VIPS_PFOREIGN_H
|
|
|
|
#define VIPS_PFOREIGN_H
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
2018-07-18 18:09:53 +02:00
|
|
|
/* Slow and horrid version if there's no recent glib.
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_CHECKED_MUL
|
|
|
|
#define g_uint_checked_mul( dest, a, b ) ( \
|
|
|
|
((guint64) a * b) > UINT_MAX ? \
|
|
|
|
(*dest = UINT_MAX, FALSE) : \
|
|
|
|
(*dest = a * b, TRUE) \
|
|
|
|
)
|
|
|
|
#endif /*HAVE_CHECKED_MUL*/
|
|
|
|
|
2021-08-29 19:06:33 +02:00
|
|
|
#define MAX_PNG_TEXT_CHUNKS 20
|
|
|
|
|
2016-10-15 13:29:14 +02:00
|
|
|
void vips__tiff_init( void );
|
|
|
|
|
|
|
|
int vips__tiff_write( VipsImage *in, const char *filename,
|
|
|
|
VipsForeignTiffCompression compression, int Q,
|
2020-02-18 18:37:56 +01:00
|
|
|
VipsForeignTiffPredictor predictor,
|
2020-07-18 15:49:37 +02:00
|
|
|
const char *profile,
|
2016-10-15 13:29:14 +02:00
|
|
|
gboolean tile, int tile_width, int tile_height,
|
|
|
|
gboolean pyramid,
|
2020-06-09 11:23:28 +02:00
|
|
|
int bitdepth,
|
2016-10-15 13:29:14 +02:00
|
|
|
gboolean miniswhite,
|
|
|
|
VipsForeignTiffResunit resunit, double xres, double yres,
|
|
|
|
gboolean bigtiff,
|
|
|
|
gboolean rgbjpeg,
|
|
|
|
gboolean properties,
|
2018-06-13 19:16:03 +02:00
|
|
|
gboolean strip,
|
2019-07-08 11:39:44 +02:00
|
|
|
VipsRegionShrink region_shrink,
|
2020-01-26 19:39:47 +01:00
|
|
|
int level,
|
|
|
|
gboolean lossless,
|
2020-05-13 13:45:28 +02:00
|
|
|
VipsForeignDzDepth depth,
|
2021-05-01 21:08:06 +02:00
|
|
|
gboolean subifd,
|
|
|
|
gboolean premultiply );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
int vips__tiff_write_buf( VipsImage *in,
|
|
|
|
void **obuf, size_t *olen,
|
|
|
|
VipsForeignTiffCompression compression, int Q,
|
|
|
|
VipsForeignTiffPredictor predictor,
|
2020-07-18 15:49:37 +02:00
|
|
|
const char *profile,
|
2016-10-15 13:29:14 +02:00
|
|
|
gboolean tile, int tile_width, int tile_height,
|
|
|
|
gboolean pyramid,
|
2020-06-09 11:23:28 +02:00
|
|
|
int bitdepth,
|
2016-10-15 13:29:14 +02:00
|
|
|
gboolean miniswhite,
|
|
|
|
VipsForeignTiffResunit resunit, double xres, double yres,
|
|
|
|
gboolean bigtiff,
|
|
|
|
gboolean rgbjpeg,
|
2018-06-13 19:16:03 +02:00
|
|
|
gboolean properties, gboolean strip,
|
2019-07-08 11:39:44 +02:00
|
|
|
VipsRegionShrink region_shrink,
|
2020-01-26 19:39:47 +01:00
|
|
|
int level,
|
|
|
|
gboolean lossless,
|
2020-05-13 13:45:28 +02:00
|
|
|
VipsForeignDzDepth depth,
|
2021-05-01 21:08:06 +02:00
|
|
|
gboolean subifd,
|
|
|
|
gboolean premultiply );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2019-12-30 13:48:20 +01:00
|
|
|
gboolean vips__istiff_source( VipsSource *source );
|
|
|
|
gboolean vips__istifftiled_source( VipsSource *source );
|
|
|
|
int vips__tiff_read_header_source( VipsSource *source, VipsImage *out,
|
2020-05-28 13:40:31 +02:00
|
|
|
int page, int n, gboolean autorotate, int subifd );
|
2019-12-30 13:48:20 +01:00
|
|
|
int vips__tiff_read_source( VipsSource *source, VipsImage *out,
|
2020-05-28 13:40:31 +02:00
|
|
|
int page, int n, gboolean autorotate, int subifd );
|
2019-10-16 19:28:46 +02:00
|
|
|
|
2016-10-15 13:29:14 +02:00
|
|
|
extern const char *vips__foreign_tiff_suffs[];
|
|
|
|
|
|
|
|
int vips__isanalyze( const char *filename );
|
|
|
|
int vips__analyze_read_header( const char *filename, VipsImage *out );
|
|
|
|
int vips__analyze_read( const char *filename, VipsImage *out );
|
|
|
|
|
|
|
|
extern const char *vips__foreign_csv_suffs[];
|
|
|
|
|
|
|
|
int vips__csv_read( const char *filename, VipsImage *out,
|
2016-11-12 16:33:35 +01:00
|
|
|
int skip, int lines, const char *whitespace, const char *separator,
|
|
|
|
gboolean fail );
|
2016-10-15 13:29:14 +02:00
|
|
|
int vips__csv_read_header( const char *filename, VipsImage *out,
|
2016-11-12 16:33:35 +01:00
|
|
|
int skip, int lines, const char *whitespace, const char *separator,
|
|
|
|
gboolean fail );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
int vips__csv_write( VipsImage *in, const char *filename,
|
|
|
|
const char *separator );
|
|
|
|
|
|
|
|
int vips__matrix_read_header( const char *filename,
|
|
|
|
int *width, int *height, double *scale, double *offset );
|
|
|
|
int vips__matrix_ismatrix( const char *filename );
|
|
|
|
VipsImage *vips__matrix_read_file( FILE *fp );
|
|
|
|
VipsImage *vips__matrix_read( const char *filename );
|
|
|
|
int vips__matrix_write( VipsImage *in, const char *filename );
|
|
|
|
int vips__matrix_write_file( VipsImage *in, FILE *fp );
|
|
|
|
|
|
|
|
extern const char *vips__foreign_matrix_suffs[];
|
|
|
|
|
|
|
|
int vips__openexr_isexr( const char *filename );
|
|
|
|
gboolean vips__openexr_istiled( const char *filename );
|
|
|
|
int vips__openexr_read_header( const char *filename, VipsImage *out );
|
|
|
|
int vips__openexr_read( const char *filename, VipsImage *out );
|
|
|
|
|
|
|
|
extern const char *vips__fits_suffs[];
|
|
|
|
|
|
|
|
int vips__fits_isfits( const char *filename );
|
|
|
|
int vips__fits_read_header( const char *filename, VipsImage *out );
|
|
|
|
int vips__fits_read( const char *filename, VipsImage *out );
|
|
|
|
|
|
|
|
int vips__fits_write( VipsImage *in, const char *filename );
|
|
|
|
|
|
|
|
int vips__magick_read( const char *filename,
|
2016-11-25 15:46:46 +01:00
|
|
|
VipsImage *out, const char *density, int page, int n );
|
2016-10-15 13:29:14 +02:00
|
|
|
int vips__magick_read_header( const char *filename,
|
2016-11-25 15:46:46 +01:00
|
|
|
VipsImage *out, const char *density, int page, int n );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
int vips__magick_read_buffer( const void *buf, const size_t len,
|
2016-11-25 15:46:46 +01:00
|
|
|
VipsImage *out, const char *density, int page, int n );
|
2016-10-15 13:29:14 +02:00
|
|
|
int vips__magick_read_buffer_header( const void *buf, const size_t len,
|
2016-11-25 15:46:46 +01:00
|
|
|
VipsImage *out, const char *density, int page, int n );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
extern const char *vips__mat_suffs[];
|
|
|
|
|
|
|
|
int vips__mat_load( const char *filename, VipsImage *out );
|
|
|
|
int vips__mat_header( const char *filename, VipsImage *out );
|
|
|
|
int vips__mat_ismat( const char *filename );
|
|
|
|
|
|
|
|
extern const char *vips__ppm_suffs[];
|
|
|
|
|
2019-12-30 15:23:51 +01:00
|
|
|
int vips__ppm_save_target( VipsImage *in, VipsTarget *target,
|
2019-11-13 18:50:02 +01:00
|
|
|
gboolean ascii, gboolean squash );
|
2019-12-29 22:40:21 +01:00
|
|
|
int vips__rad_israd( VipsSource *source );
|
|
|
|
int vips__rad_header( VipsSource *source, VipsImage *out );
|
|
|
|
int vips__rad_load( VipsSource *source, VipsImage *out );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2019-12-29 22:40:21 +01:00
|
|
|
int vips__rad_save( VipsImage *in, VipsTarget *target );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
extern const char *vips__rad_suffs[];
|
|
|
|
|
|
|
|
extern const char *vips__jpeg_suffs[];
|
|
|
|
|
2019-12-30 00:08:33 +01:00
|
|
|
int vips__jpeg_write_target( VipsImage *in, VipsTarget *target,
|
2019-10-11 19:17:42 +02:00
|
|
|
int Q, const char *profile,
|
2016-10-15 13:29:14 +02:00
|
|
|
gboolean optimize_coding, gboolean progressive, gboolean strip,
|
2020-02-18 17:04:29 +01:00
|
|
|
gboolean trellis_quant, gboolean overshoot_deringing,
|
|
|
|
gboolean optimize_scans, int quant_table,
|
2021-01-11 21:40:13 +01:00
|
|
|
VipsForeignSubsample subsample_mode );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2019-12-30 00:08:33 +01:00
|
|
|
int vips__jpeg_read_source( VipsSource *source, VipsImage *out,
|
2019-10-10 21:42:39 +02:00
|
|
|
gboolean header_only, int shrink, int fail, gboolean autorotate );
|
2019-12-30 00:08:33 +01:00
|
|
|
int vips__isjpeg_source( VipsSource *source );
|
2019-10-10 21:42:39 +02:00
|
|
|
|
2019-12-30 13:48:20 +01:00
|
|
|
int vips__png_ispng_source( VipsSource *source );
|
2021-08-29 19:06:33 +02:00
|
|
|
int vips__png_header_source( VipsSource *source, VipsImage *out, gboolean unlimited );
|
2019-12-30 13:48:20 +01:00
|
|
|
int vips__png_read_source( VipsSource *source, VipsImage *out,
|
2021-08-29 19:06:33 +02:00
|
|
|
gboolean fail, gboolean unlimited );
|
2019-12-30 13:48:20 +01:00
|
|
|
gboolean vips__png_isinterlaced_source( VipsSource *source );
|
2019-10-14 19:03:45 +02:00
|
|
|
extern const char *vips__png_suffs[];
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2019-12-30 13:48:20 +01:00
|
|
|
int vips__png_write_target( VipsImage *in, VipsTarget *target,
|
2016-10-15 13:29:14 +02:00
|
|
|
int compress, int interlace, const char *profile,
|
2018-06-19 22:41:40 +02:00
|
|
|
VipsForeignPngFilter filter, gboolean strip,
|
2020-06-25 11:40:43 +02:00
|
|
|
gboolean palette, int Q, double dither,
|
2021-07-30 11:43:42 +02:00
|
|
|
int bitdepth, int effort );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2016-11-07 11:30:55 +01:00
|
|
|
/* Map WEBP metadata names to vips names.
|
|
|
|
*/
|
|
|
|
typedef struct _VipsWebPNames {
|
|
|
|
const char *vips;
|
|
|
|
const char *webp;
|
2018-11-02 10:06:05 +01:00
|
|
|
int flags;
|
2016-11-07 11:30:55 +01:00
|
|
|
} VipsWebPNames;
|
|
|
|
|
|
|
|
extern const VipsWebPNames vips__webp_names[];
|
2016-11-08 13:30:02 +01:00
|
|
|
extern const int vips__n_webp_names;
|
2016-10-15 13:29:14 +02:00
|
|
|
extern const char *vips__webp_suffs[];
|
|
|
|
|
2019-12-30 15:23:51 +01:00
|
|
|
int vips__iswebp_source( VipsSource *source );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2019-12-30 15:23:51 +01:00
|
|
|
int vips__webp_read_header_source( VipsSource *source, VipsImage *out,
|
2019-04-30 19:29:16 +02:00
|
|
|
int page, int n, double scale );
|
2019-12-30 15:23:51 +01:00
|
|
|
int vips__webp_read_source( VipsSource *source, VipsImage *out,
|
2019-04-30 19:29:16 +02:00
|
|
|
int page, int n, double scale );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2019-12-30 15:23:51 +01:00
|
|
|
int vips__webp_write_target( VipsImage *image, VipsTarget *target,
|
2016-10-15 13:29:14 +02:00
|
|
|
int Q, gboolean lossless, VipsForeignWebpPreset preset,
|
|
|
|
gboolean smart_subsample, gboolean near_lossless,
|
2021-07-30 12:07:43 +02:00
|
|
|
int alpha_q, int effort,
|
2018-11-06 18:20:35 +01:00
|
|
|
gboolean min_size, int kmin, int kmax,
|
2020-07-18 15:49:37 +02:00
|
|
|
gboolean strip, const char *profile );
|
2016-10-15 13:29:14 +02:00
|
|
|
|
2018-06-20 16:38:33 +02:00
|
|
|
int vips__quantise_image( VipsImage *in,
|
|
|
|
VipsImage **index_out, VipsImage **palette_out,
|
2021-07-30 11:43:42 +02:00
|
|
|
int colours, int Q, double dither, int effort );
|
2018-06-20 16:38:33 +02:00
|
|
|
|
2021-02-12 16:29:58 +01:00
|
|
|
extern const char *vips_foreign_nifti_suffs[];
|
2018-07-18 18:09:53 +02:00
|
|
|
|
2018-07-13 14:08:23 +02:00
|
|
|
VipsBandFormat vips__foreign_nifti_datatype2BandFmt( int datatype );
|
|
|
|
int vips__foreign_nifti_BandFmt2datatype( VipsBandFormat fmt );
|
2018-07-10 18:16:49 +02:00
|
|
|
|
2018-07-13 14:08:23 +02:00
|
|
|
typedef void *(*VipsNiftiMapFn)( const char *name, GValue *value, glong offset,
|
|
|
|
void *a, void *b );
|
|
|
|
void *vips__foreign_nifti_map( VipsNiftiMapFn fn, void *a, void *b );
|
2018-07-10 18:16:49 +02:00
|
|
|
|
2019-01-29 11:27:00 +01:00
|
|
|
extern const char *vips__heif_suffs[];
|
2020-12-24 16:50:56 +01:00
|
|
|
|
2021-03-19 12:49:07 +01:00
|
|
|
extern const char *vips__jp2k_suffs[];
|
2021-04-26 16:16:20 +02:00
|
|
|
int vips__foreign_load_jp2k_decompress( VipsImage *out,
|
|
|
|
int width, int height, gboolean ycc_to_rgb,
|
|
|
|
void *from, size_t from_length,
|
|
|
|
void *to, size_t to_length );
|
|
|
|
int vips__foreign_load_jp2k_compress( VipsRegion *region,
|
|
|
|
VipsRect *tile, VipsTarget *target,
|
|
|
|
int tile_width, int tile_height,
|
|
|
|
gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q );
|
2021-03-19 12:49:07 +01:00
|
|
|
|
2021-04-03 12:57:11 +02:00
|
|
|
extern const char *vips__jxl_suffs[];
|
|
|
|
|
2016-10-15 13:29:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
2019-07-08 11:39:44 +02:00
|
|
|
#endif /*VIPS_PFOREIGN_H*/
|
2016-10-15 13:29:14 +02:00
|
|
|
|
|
|
|
|