## VipsImage

VipsImage — the VIPS image class

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #include <vips/vips.h>

    #define             VIPS_MAGIC_INTEL
    #define             VIPS_MAGIC_SPARC
    enum                VipsDemandStyle;
    enum                VipsImageType;
    enum                VipsInterpretation;
    enum                VipsBandFormat;
    enum                VipsCoding;
                        VipsProgress;
                        VipsImage;
                        VipsImageClass;
    #define             VIPS_IMAGE_SIZEOF_ELEMENT           (I)
    #define             VIPS_IMAGE_SIZEOF_PEL               (I)
    #define             VIPS_IMAGE_SIZEOF_LINE              (I)
    #define             VIPS_IMAGE_SIZEOF_IMAGE             (I)
    #define             VIPS_IMAGE_N_ELEMENTS               (I)
    #define             VIPS_IMAGE_ADDR                     (I,
                                                             X,
                                                             Y)
    int                 vips_image_written                  (VipsImage *image);
    void                vips_image_invalidate_all           (VipsImage *image);
    void                vips_image_preeval                  (VipsImage *image);
    void                vips_image_eval                     (VipsImage *image,
                                                             int w,
                                                             int h);
    void                vips_image_posteval                 (VipsImage *image);
    void                vips_image_set_progress             (VipsImage *image,
                                                             gboolean progress);
    gboolean            vips_image_get_kill                 (VipsImage *image);
    void                vips_image_set_kill                 (VipsImage *image,
                                                             gboolean kill);
    VipsImage *         vips_image_new                      (void);
    int                 vips_image_new_array                (VipsObject *parent,
                                                             VipsImage **images,
                                                             int n);
    VipsImage *         vips_image_new_mode                 (const char *filename,
                                                             const char *mode);
    VipsImage *         vips_image_new_from_file            (const char *filename);
    VipsImage *         vips_image_new_from_file_raw        (const char *filename,
                                                             int xsize,
                                                             int ysize,
                                                             int bands,
                                                             int offset);
    VipsImage *         vips_image_new_from_memory          (void *buffer,
                                                             int xsize,
                                                             int ysize,
                                                             int bands,
                                                             VipsBandFormat bandfmt);
    void                vips_image_set_delete_on_close      (VipsImage *image,
                                                             gboolean delete_on_close);
    VipsImage *         vips_image_new_disc_temp            (const char *format);
    int                 vips_image_write                    (VipsImage *image,
                                                             const char *filename);
    gboolean            vips_image_isMSBfirst               (VipsImage *image);
    gboolean            vips_image_isfile                   (VipsImage *image);
    gboolean            vips_image_ispartial                (VipsImage *image);
    int                 vips_image_write_line               (VipsImage *image,
                                                             int ypos,
                                                             PEL *linebuffer);
    int                 vips_image_wio_input                (VipsImage *image);
    int                 vips_image_wio_output               (VipsImage *image);
    int                 vips_image_inplace                  (VipsImage *image);
    int                 vips_image_pio_input                (VipsImage *image);
    int                 vips_image_pio_output               (VipsImage *image);
    gboolean            vips_band_format_isint              (VipsBandFormat format);
    gboolean            vips_band_format_isuint             (VipsBandFormat format);
    gboolean            vips_band_format_isfloat            (VipsBandFormat format);
    gboolean            vips_band_format_iscomplex          (VipsBandFormat format);

## Object Hierarchy

      GEnum
       +----VipsDemandStyle

      GEnum
       +----VipsImageType

      GEnum
       +----VipsInterpretation

      GEnum
       +----VipsBandFormat

      GEnum
       +----VipsCoding

      GObject
       +----VipsObject
             +----VipsImage

## Properties

      "bands"                    gint                  : Read / Write
      "demand"                   VipsDemandStyle       : Read / Write
      "filename"                 gchar*                : Read / Write
      "foreign-buffer"           gpointer              : Read / Write
      "format"                   VipsBandFormat        : Read / Write
      "height"                   gint                  : Read / Write
      "kill"                     gboolean              : Read / Write
      "mode"                     gchar*                : Read / Write
      "sizeof-header"            gint                  : Read / Write
      "width"                    gint                  : Read / Write

## Signals

      "eval"                                           : Run Last
      "invalidate"                                     : Action
      "posteval"                                       : Run Last
      "preeval"                                        : Run Last
      "written"                                        : Action

## Description

The image class and associated types and macros.

`vips_image_wio_input()` and friends indicate the image IO style you intend to use, transforming the underlying VipsImage structure if necessary.

## Details

### VIPS_MAGIC_INTEL

    #define VIPS_MAGIC_INTEL (0xb6a6f208U)

The first four bytes of a VIPS file in Intel byte ordering.

### VIPS_MAGIC_SPARC

    #define VIPS_MAGIC_SPARC (0x08f2a6b6U)

The first four bytes of a VIPS file in SPARC byte ordering.

### enum VipsDemandStyle

    typedef enum {
    	VIPS_DEMAND_STYLE_SMALLTILE,
    	VIPS_DEMAND_STYLE_FATSTRIP,
    	VIPS_DEMAND_STYLE_THINSTRIP,
    	VIPS_DEMAND_STYLE_ANY
    } VipsDemandStyle;

See `vips_demand_hint()`. Operations can hint to the VIPS image IO system about the kind of demand geometry they prefer.

These demand styles are given below in order of increasing restrictiveness. When demanding output from a pipeline, `vips_image_generate()` will use the most restrictive of the styles requested by the operations in the pipeline.

VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output strips the width of the image and a few pels high. This is option suitable for point-to-point operations, such as those in the arithmetic package.

This option is only efficient for cases where each output pel depends upon the pel in the corresponding position in the input image.

VIPS_DEMAND_STYLE_FATSTRIP --- This operation would like to output strips the width of the image and as high as possible. This option is suitable for area operations which do not violently transform coordinates, such as `im_conv()`.

VIPS_DEMAND_STYLE_SMALLTILE --- This is the most general demand format. Output is demanded in small (around 100x100 pel) sections. This style works reasonably efficiently, even for bizzare operations like 45 degree rotate.

VIPS_DEMAND_STYLE_ANY --- This image is not being demand-read from a disc file (even indirectly) so any demand style is OK. It's used for things like `im_black()` where the pixels are calculated.

See also: `vips_demand_hint()`.

`VIPS_DEMAND_STYLE_SMALLTILE` | demand in small (typically 64x64 pixel) tiles
`VIPS_DEMAND_STYLE_FATSTRIP` | demand in fat (typically 10 pixel high) strips
`VIPS_DEMAND_STYLE_THINSTRIP` | demand in thin (typically 1 pixel high) strips
`VIPS_DEMAND_STYLE_ANY` | demand geometry does not matter

### enum VipsImageType

    typedef enum {
    	VIPS_IMAGE_NONE,		/* no type set */
    	VIPS_IMAGE_SETBUF,		/* malloced memory array */
    	VIPS_IMAGE_SETBUF_FOREIGN, /* memory array, don't free on close */
    	VIPS_IMAGE_OPENIN,		/* input from fd with a window */
    	VIPS_IMAGE_MMAPIN,		/* memory mapped input file */
    	VIPS_IMAGE_MMAPINRW,		/* memory mapped read/write file */
    	VIPS_IMAGE_OPENOUT,		/* output to fd */
    	VIPS_IMAGE_PARTIAL		/* partial image */
    } VipsImageType;

### enum VipsInterpretation

    typedef enum {
    	VIPS_INTERPRETATION_MULTIBAND = 0,
    	VIPS_INTERPRETATION_B_W = 1,
    	VIPS_INTERPRETATION_HISTOGRAM = 10,
    	VIPS_INTERPRETATION_FOURIER = 24,
    	VIPS_INTERPRETATION_XYZ = 12,
    	VIPS_INTERPRETATION_LAB = 13,
    	VIPS_INTERPRETATION_CMYK = 15,
    	VIPS_INTERPRETATION_LABQ = 16,
    	VIPS_INTERPRETATION_RGB = 17,
    	VIPS_INTERPRETATION_UCS = 18,
    	VIPS_INTERPRETATION_LCH = 19,
    	VIPS_INTERPRETATION_LABS = 21,
    	VIPS_INTERPRETATION_sRGB = 22,
    	VIPS_INTERPRETATION_YXY = 23,
    	VIPS_INTERPRETATION_RGB16 = 25,
    	VIPS_INTERPRETATION_GREY16 = 26
    } VipsInterpretation;

How the values in an image should be interpreted. For example, a three-band float image of type VIPS_TYPE_LAB should have its pixels interpreted as coordinates in CIE Lab space.

These values are set by operations as hints to user-interfaces built on top of VIPS to help them show images to the user in a meaningful way. Operations do not use these values to decide their action.

The gaps in the numbering are historical and must be maintained. Allocate new numbers from the end.

`VIPS_INTERPRETATION_MULTIBAND` |
`VIPS_INTERPRETATION_B_W` |
`VIPS_INTERPRETATION_HISTOGRAM` |
`VIPS_INTERPRETATION_FOURIER` |
`VIPS_INTERPRETATION_XYZ` |
`VIPS_INTERPRETATION_LAB` |
`VIPS_INTERPRETATION_CMYK` |
`VIPS_INTERPRETATION_LABQ` |
`VIPS_INTERPRETATION_RGB` |
`VIPS_INTERPRETATION_UCS` |
`VIPS_INTERPRETATION_LCH` |
`VIPS_INTERPRETATION_LABS` |
`VIPS_INTERPRETATION_sRGB` |
`VIPS_INTERPRETATION_YXY` |
`VIPS_INTERPRETATION_RGB16` |
`VIPS_INTERPRETATION_GREY16` |

### enum VipsBandFormat

    typedef enum {
    	VIPS_FORMAT_NOTSET = -1,
    	VIPS_FORMAT_UCHAR = 0,
    	VIPS_FORMAT_CHAR = 1,
    	VIPS_FORMAT_USHORT = 2,
    	VIPS_FORMAT_SHORT = 3,
    	VIPS_FORMAT_UINT = 4,
    	VIPS_FORMAT_INT = 5,
    	VIPS_FORMAT_FLOAT = 6,
    	VIPS_FORMAT_COMPLEX = 7,
    	VIPS_FORMAT_DOUBLE = 8,
    	VIPS_FORMAT_DPCOMPLEX = 9,
    	VIPS_FORMAT_LAST = 10
    } VipsBandFormat;

The format used for each band element.

Each corresponnds to a native C type for the current machine. For example, VIPS_FORMAT_USHORT is unsigned short.

`VIPS_FORMAT_NOTSET` | invalid setting
`VIPS_FORMAT_UCHAR` | unsigned char format
`VIPS_FORMAT_CHAR` | char format
`VIPS_FORMAT_USHORT` | unsigned short format
`VIPS_FORMAT_SHORT` | short format
`VIPS_FORMAT_UINT` | unsigned int format
`VIPS_FORMAT_INT` | int format
`VIPS_FORMAT_FLOAT` | float format
`VIPS_FORMAT_COMPLEX` | complex (two floats) format
`VIPS_FORMAT_DOUBLE` | double float format
`VIPS_FORMAT_DPCOMPLEX` | double complex (two double) format
`VIPS_FORMAT_LAST` |

### enum VipsCoding

    typedef enum {
    	VIPS_CODING_NONE = 0,
    	VIPS_CODING_LABQ = 2,
    	VIPS_CODING_RAD = 6
    } VipsCoding;

How pixels are coded.

Normally, pixels are uncoded and can be manipulated as you would expect. However some file formats code pixels for compression, and sometimes it's useful to be able to manipulate images in the coded format.

The gaps in the numbering are historical and must be maintained. Allocate new numbers from the end.

`VIPS_CODING_NONE` | pixels are not coded
`VIPS_CODING_LABQ` | pixels encode 3 float CIELAB values as 4 uchar
`VIPS_CODING_RAD` | pixels encode 3 float RGB as 4 uchar (Radiance coding)

### VipsProgress

    typedef struct {
    	int run;		/* Time we have been running */
    	int eta;		/* Estimated seconds of computation left */
    	gint64 tpels;		/* Number of pels we expect to calculate */
    	gint64 npels;		/* Number of pels calculated so far */
    	int percent;		/* Percent complete */
    	GTimer *start;		/* Start time */
    } VipsProgress;

A structure available to eval callbacks giving information on evaluation progress. See "eval".

int `run`; | Time we have been running
int `eta`; | Estimated seconds of computation left
gint64 `tpels`; | Number of pels we expect to calculate
gint64 `npels`; | Number of pels calculated so far
int `percent`; | Percent complete
GTimer *`start`; | Start time

### VipsImage

    typedef struct _VipsImage VipsImage;

An image. These can represent an image on disc, a memory buffer, an image in the process of being written to disc or a partially evaluated image in memory.

### VipsImageClass

    typedef struct {
    	VipsObjectClass parent_class;

    	/* Signals we emit.
    	 */

    	/* Evaluation is starting.
    	 */
    	void (*preeval)( VipsImage *image, VipsProgress *progress );

    	/* Evaluation progress.
    	 */
    	void (*eval)( VipsImage *image, VipsProgress *progress );

    	/* Evaluation is ending.
    	 */
    	void (*posteval)( VipsImage *image, VipsProgress *progress );

    	/* An image has been written to.
    	 * Used by eg. vips_image_new_mode("x.jpg", "w") to do the
    	 * final write to jpeg.
    	 * Set *result to non-zero to indicate an error on write.
    	 */
    	void (*written)( VipsImage *image, int *result );

    	/* An image has been modified in some way and all caches
    	 * need dropping.
    	 */
    	void (*invalidate)( VipsImage *image );
    } VipsImageClass;

### VIPS_IMAGE_SIZEOF_ELEMENT()

    #define             VIPS_IMAGE_SIZEOF_ELEMENT( I )

`I` : | a VipsImage
Returns : | `sizeof()` a band element.

### VIPS_IMAGE_SIZEOF_PEL()

    #define             VIPS_IMAGE_SIZEOF_PEL( I )

`I` : | a VipsImage
Returns : | `sizeof()` a pixel.

### VIPS_IMAGE_SIZEOF_LINE()

    #define             VIPS_IMAGE_SIZEOF_LINE( I )

`I` : | a VipsImage
Returns : | `sizeof()` a scanline of pixels.

### VIPS_IMAGE_SIZEOF_IMAGE()

    #define             VIPS_IMAGE_SIZEOF_IMAGE( I )

### VIPS_IMAGE_N_ELEMENTS()

    #define             VIPS_IMAGE_N_ELEMENTS( I )

`I` : | a VipsImage
Returns : | The number of band elements in a scanline.

### VIPS_IMAGE_ADDR()

    #define             VIPS_IMAGE_ADDR( I, X, Y )

This macro returns a pointer to a pixel in an image. It only works for images which are fully available in memory, so memory buffers and small mapped images only.

If VIPS_DEBUG is defined, you get a version that checks bounds for you.

See also: `VIPS_REGION_ADDR()`.

`I` : | a VipsImage
`X` : | x coordinate
`Y` : | y coordinate
Returns : | The address of pixel (x,y) in the image.

### vips_image_written ()

    int                 vips_image_written                  (VipsImage *image);

### vips_image_invalidate_all ()

    void                vips_image_invalidate_all           (VipsImage *image);

Invalidate all pixel caches on an `image` and any derived images. The "invalidate" callback is triggered for all invalidated images.

`image` : | VipsImage to invalidate

### vips_image_preeval ()

    void                vips_image_preeval                  (VipsImage *image);

### vips_image_eval ()

    void                vips_image_eval                     (VipsImage *image,
                                                             int w,
                                                             int h);

### vips_image_posteval ()

    void                vips_image_posteval                 (VipsImage *image);

### vips_image_set_progress ()

    void                vips_image_set_progress             (VipsImage *image,
                                                             gboolean progress);

vips signals evaluation progress via the "preeval", "eval" and "posteval" signals. Progress is signalled on the most-downstream image for which `vips_image_set_progress()` was called.

`image` : | image to signal progress on
`progress` : | turn progress reporting on or off

### vips_image_get_kill ()

    gboolean            vips_image_get_kill                 (VipsImage *image);

### vips_image_set_kill ()

    void                vips_image_set_kill                 (VipsImage *image,
                                                             gboolean kill);

### vips_image_new ()

    VipsImage *         vips_image_new                      (void);

`vips_image_new()` creates a "glue" descriptor you can use to join two image processing operations together.

It is the equivalent of vips_image_new_mode("xxx", "p").

Returns : | the new VipsImage, or `NULL` on error.

### vips_image_new_array ()

    int                 vips_image_new_array                (VipsObject *parent,
                                                             VipsImage **images,
                                                             int n);

Just like `vips_image_new()`, but opens an array of "p" images. Handy for creating a set of temporary images for a function.

Example:

    VipsImage *t[5];

    if( vips_image_new_array( out, t, 5 ) ||
      vips_add( a, b, t[0] ) ||
      vips_invert( t[0], t[1] ) ||
      vips_add( t[1], t[0], t[2] ) ||
      vips_costra( t[2], out ) )
      return( -1 );

See also: `vips_image_new()`, `vips_object_local()`.

`parent` : | images unref when this object unrefs
`OUT` : | array to fill with VipsImage *
`N` : | array size
Returns : | 0 on sucess, or -1 on error

### vips_image_new_mode ()

    VipsImage *         vips_image_new_mode                 (const char *filename,
                                                             const char *mode);

`vips_image_new_mode()` examines the mode string and creates an appropriate VipsImage.

- "t" creates a temporary memory buffer image.

- "p" creates a "glue" descriptor you can use to join operations, see also `vips_image_new()`.

- "r" opens the named file for reading. If the file is not in the native VIPS format for your machine, `vips_image_new_mode()` automatically converts the file for you in memory.

  For some large files (eg. TIFF) this may not be what you want, it can fill memory very quickly. Instead, you can either use "rd" mode (see below), or you can use the lower-level API and control the loading process yourself. See VipsBandFormat.

  `vips_image_new_mode()` can read files in most formats.

  Note that "r" mode works in at least two stages. It should return quickly and let you check header fields. It will only actually read in pixels when you first access them.

- "rd" opens the named file for reading. If the uncompressed image is larger than a threshold and the file format does not support random access, rather than uncompressing to memory, `vips_image_new_mode()` will uncompress to a temporary disc file. This file will be automatically deleted when the IMAGE is closed.

  See `im_system_image()` for an explanation of how VIPS selects a location for the temporary file.

  The disc threshold can be set with the "--vips-disc-threshold" command-line argument, or the IM_DISC_THRESHOLD environment variable. The value is a simple integer, but can take a unit postfix of "k", "m" or "g" to indicate kilobytes, megabytes or gigabytes.

  For example:

              vips --vips-disc-threshold "500m" im_copy fred.tif fred.v

  will copy via disc if "fred.tif" is more than 500 Mbytes uncompressed. The default threshold is 100MB.

- "w" opens the named file for writing. It looks at the file name suffix to determine the type to write -- for example:

              vips_image_new_mode( "fred.tif", "w" )

  will write in TIFF format.

- "rw" opens the named file for reading and writing. This will only work for VIPS files in a format native to your machine. It is only for paintbox-type applications.

`filename` : | file to open
`mode` : | mode to open with
Returns : | the new VipsImage, or `NULL` on error.

### vips_image_new_from_file ()

    VipsImage *         vips_image_new_from_file            (const char *filename);

`vips_image_new_from_file()` opens `filename` for reading. See `vips_image_new_mode()` for details.

See also: `vips_image_new_mode()`.

`filename` : | file to open
Returns : | the new VipsImage, or `NULL` on error.

### vips_image_new_from_file_raw ()

    VipsImage *         vips_image_new_from_file_raw        (const char *filename,
                                                             int xsize,
                                                             int ysize,
                                                             int bands,
                                                             int offset);

This function maps the named file and returns a VipsImage you can use to read it.

It returns an 8-bit image with `bands` bands. If the image is not 8-bit, use `im_copy_set()` to transform the descriptor after loading it.

See also: `im_copy_set()`, `im_raw2vips()`, `vips_image_new_from_file()`.

`filename` : | filename to open
`xsize` : | image width
`ysize` : | image height
`bands` : | image bands (or bytes per pixel)
`offset` : | bytes to skip at start of file
Returns : | the new VipsImage, or `NULL` on error.

### vips_image_new_from_memory ()

    VipsImage *         vips_image_new_from_memory          (void *buffer,
                                                             int xsize,
                                                             int ysize,
                                                             int bands,
                                                             VipsBandFormat bandfmt);

This function wraps an IMAGE around a memory buffer. VIPS does not take responsibility for the area of memory, it's up to you to make sure it's freed when the image is closed. See for example "close".

See also: `im_binfile()`, `im_raw2vips()`, `vips_image_new()`.

`buffer` : | start of memory area
`xsize` : | image width
`ysize` : | image height
`bands` : | image bands (or bytes per pixel)
`bandfmt` : | image format
Returns : | the new VipsImage, or `NULL` on error.

### vips_image_set_delete_on_close ()

    void                vips_image_set_delete_on_close      (VipsImage *image,
                                                             gboolean delete_on_close);

Sets the delete_on_close flag for the image. If this flag is set, when `image` is finalized the filename held in `image->filename` at the time of this call is unlinked.

This function is clearly extremely dangerous, use with great caution.

See also: `vips__temp_name()`, `vips_image_new_disc_temp()`.

`image` : | image to set
`delete_on_close` : | format of file

### vips_image_new_disc_temp ()

    VipsImage *         vips_image_new_disc_temp            (const char *format);

Make a "w" disc VipsImage which will be automatically unlinked when it is destroyed. `format` is something like "`s`.v" for a vips file.

The file is created in the temporary directory, see `vips__temp_name()`.

See also: `vips__temp_name()`.

`format` : | format of file
Returns : | the new VipsImage, or `NULL` on error.

### vips_image_write ()

    int                 vips_image_write                    (VipsImage *image,
                                                             const char *filename);

A convenience function to write a VipsImage to a file.

`image` : | image to write
`filename` : | write to this file
Returns : | 0 on success, or -1 on error.

### vips_image_isMSBfirst ()

    gboolean            vips_image_isMSBfirst               (VipsImage *image);

Return `TRUE` if `image` is in most-significant- byte first form. This is the byte order used on the SPARC architecture and others.

`image` : | image to test

### vips_image_isfile ()

    gboolean            vips_image_isfile                   (VipsImage *image);

Return `TRUE` if `image` represents a file on disc in some way.

`image` : | image to test

### vips_image_ispartial ()

    gboolean            vips_image_ispartial                (VipsImage *image);

Return `TRUE` if `im` represents a partial image (a delayed calculation).

`image` : | image to test

### vips_image_write_line ()

    int                 vips_image_write_line               (VipsImage *image,
                                                             int ypos,
                                                             PEL *linebuffer);

Write a line of pixels to an image. This function must be called repeatedly with `ypos` increasing from 0 to `YSize` - `linebuffer` must be `VIPS_IMAGE_SIZEOF_LINE()` bytes long.

See also: `vips_image_generate()`.

`image` : | image to write to
`ypos` : | vertical position of scan-line to write
`linebuffer` : | scanline of pixels
Returns : | 0 on success, or -1 on error.

### vips_image_wio_input ()

    int                 vips_image_wio_input                (VipsImage *image);

Check that an image is readable via the `VIPS_IMAGE_ADDR()` macro, that is, that the entire image is in memory and all pixels can be read with `VIPS_IMAGE_ADDR()`.

If it isn't, try to transform it so that `VIPS_IMAGE_ADDR()` can work.

See also: `vips_image_wio_output()`, `vips_image_pio_input()`, `vips_image_inplace()`, `VIPS_IMAGE_ADDR()`.

`image` : | image to transform
Returns : | 0 on succeess, or -1 on error.

### vips_image_wio_output ()

    int                 vips_image_wio_output               (VipsImage *image);

Check that an image is writeable by `vips_image_write_line()`. If it isn't, try to transform it so that `vips_image_write_line()` can work.

See also: `vips_image_wio_input()`.

`image` : | image to check
Returns : | 0 on succeess, or -1 on error.

### vips_image_inplace ()

    int                 vips_image_inplace                  (VipsImage *image);

Gets `image` ready for an in-place operation, such as `im_insertplace()`. Operations like this both read and write with `VIPS_IMAGE_ADDR()`.

See also: `im_insertplace()`, `vips_image_wio_input()`.

`image` : | image to make read-write
Returns : | 0 on succeess, or -1 on error.

### vips_image_pio_input ()

    int                 vips_image_pio_input                (VipsImage *image);

Check that an image is readable with `vips_region_prepare()` and friends. If it isn't, try to transform the image so that `vips_region_prepare()` can work.

See also: `vips_image_pio_output()`, `vips_region_prepare()`.

`image` : | image to check
Returns : | 0 on succeess, or -1 on error.

### vips_image_pio_output ()

    int                 vips_image_pio_output               (VipsImage *image);

Check that an image is writeable with `vips_image_generate()`. If it isn't, try to transform the image so that `vips_image_generate()` can work.

See also: `vips_image_pio_input()`.

`image` : | image to check
Returns : | 0 on succeess, or -1 on error.

### vips_band_format_isint ()

    gboolean            vips_band_format_isint              (VipsBandFormat format);

Return `TRUE` if `format` is one of the integer types.

`format` : | format to test

### vips_band_format_isuint ()

    gboolean            vips_band_format_isuint             (VipsBandFormat format);

Return `TRUE` if `format` is one of the unsigned integer types.

`format` : | format to test

### vips_band_format_isfloat ()

    gboolean            vips_band_format_isfloat            (VipsBandFormat format);

Return `TRUE` if `format` is one of the float types.

`format` : | format to test

### vips_band_format_iscomplex ()

    gboolean            vips_band_format_iscomplex          (VipsBandFormat format);

Return `TRUE` if `fmt` is one of the complex types.

`format` : | format to test

## Property Details

### The `"bands"` property

      "bands"                    gint                  : Read / Write

Number of bands in image.

Allowed values: [0,1000000]

Default value: 0

### The `"demand"` property

      "demand"                   VipsDemandStyle       : Read / Write

Preferred demand style for this image.

Default value: VIPS_DEMAND_STYLE_SMALLTILE

### The `"filename"` property

      "filename"                 gchar*                : Read / Write

Image filename.

Default value: NULL

### The `"foreign-buffer"` property

      "foreign-buffer"           gpointer              : Read / Write

Pointer to foreign pixels.

### The `"format"` property

      "format"                   VipsBandFormat        : Read / Write

Pixel format in image.

Default value: VIPS_FORMAT_UCHAR

### The `"height"` property

      "height"                   gint                  : Read / Write

Image height in pixels.

Allowed values: [0,1000000]

Default value: 0

### The `"kill"` property

      "kill"                     gboolean              : Read / Write

Block evaluation on this image.

Default value: FALSE

### The `"mode"` property

      "mode"                     gchar*                : Read / Write

Open mode.

Default value: "p"

### The `"sizeof-header"` property

      "sizeof-header"            gint                  : Read / Write

Offset in bytes from start of file.

Allowed values: [0,1000000]

Default value: 64

### The `"width"` property

      "width"                    gint                  : Read / Write

Image width in pixels.

Allowed values: [0,1000000]

Default value: 0

## Signal Details

### The `"eval"` signal

    void                user_function                      (VipsImage *vipsimage,
                                                            gpointer   arg1,
                                                            gpointer   user_data)      : Run Last

### The `"invalidate"` signal

    void                user_function                      (VipsImage *vipsimage,
                                                            gpointer   user_data)      : Action

### The `"posteval"` signal

    void                user_function                      (VipsImage *vipsimage,
                                                            gpointer   arg1,
                                                            gpointer   user_data)      : Run Last

### The `"preeval"` signal

    void                user_function                      (VipsImage *vipsimage,
                                                            gpointer   arg1,
                                                            gpointer   user_data)      : Run Last

### The `"written"` signal

    void                user_function                      (VipsImage *vipsimage,
                                                            gpointer   arg1,
                                                            gpointer   user_data)      : Action

## See Also

region