added vips_image_get_data()

something to get the pixel data pointer
This commit is contained in:
John Cupitt 2011-05-01 11:32:59 +01:00
parent ec56a691dc
commit daf915fafb
4 changed files with 23 additions and 6 deletions

View File

@ -53,6 +53,7 @@
- tiff reader can do 1, 2, 4, 8 bit palette images
- tiff palette read can do mono images
- im_bufjpeg2vips() has a "header_only" parameter
- added vips_image_get_data()
30/11/10 started 7.24.0
- bump for new stable

View File

@ -1053,12 +1053,6 @@ im_bufjpeg2vips( void *buf, size_t len, IMAGE *out, gboolean header_only )
return( result );
}
int
jpeg2vips_header( const char *name, IMAGE *out )
{
return( jpeg2vips( name, out, TRUE ) );
}
static int
isjpeg( const char *filename )
{

View File

@ -84,6 +84,7 @@ int vips_image_get_xoffset( VipsImage *image );
int vips_image_get_yoffset( VipsImage *image );
const char *vips_image_get_filename( VipsImage *image );
const char *vips_image_get_mode( VipsImage *image );
void *vips_image_get_data( VipsImage *image );;
void vips_image_init_fields( VipsImage *image,
int xsize, int ysize, int bands,

View File

@ -414,6 +414,27 @@ vips_image_get_mode( VipsImage *image )
return( image->mode );
}
/**
* vips_image_get_data:
* @image: image to get data for
*
* Return a pointer to the image's pixel data, if possible. This can involve
* allocating large amounts of memory and performing a long computation. Image
* pixels are laid out in band-packed rows.
*
* See also: vips_image_wio_input().
*
* Returns: a pointer to pixel data, if possible.
*/
void *
vips_image_get_data( VipsImage *image )
{
if( vips_image_wio_input( image ) )
return( NULL );
return( image->data );
}
/**
* vips_image_init_fields:
* @image: image to init