本文整理汇总了C++中VIPS_DEBUG_MSG函数的典型用法代码示例。如果您正苦于以下问题:C++ VIPS_DEBUG_MSG函数的具体用法?C++ VIPS_DEBUG_MSG怎么用?C++ VIPS_DEBUG_MSG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VIPS_DEBUG_MSG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vips_fits_write_meta
static void *
vips_fits_write_meta( VipsImage *image,
const char *field, GValue *value, void *a )
{
VipsFits *fits = (VipsFits *) a;
int status;
const char *value_str;
status = 0;
/* We want fields which start "fits-".
*/
if( !vips_isprefix( "fits-", field ) )
return( NULL );
/* The value should be a refstring, since we wrote it in fits2vips
* above ^^.
*/
value_str = vips_value_get_ref_string( value, NULL );
VIPS_DEBUG_MSG( "vips_fits_write_meta: setting meta on fits image:\n" );
VIPS_DEBUG_MSG( " value == \"%s\"\n", value_str );
if( fits_write_record( fits->fptr, value_str, &status ) ) {
vips_fits_error( status );
return( a );
}
return( NULL );
}
示例2: vips_exif_set_int
static void
vips_exif_set_int( ExifData *ed,
ExifEntry *entry, unsigned long component, void *data )
{
int value = *((int *) data);
ExifByteOrder bo;
size_t sizeof_component;
size_t offset = component;
if( entry->components <= component ) {
VIPS_DEBUG_MSG( "vips_exif_set_int: too few components\n" );
return;
}
/* Wait until after the component check to make sure we cant get /0.
*/
bo = exif_data_get_byte_order( ed );
sizeof_component = entry->size / entry->components;
offset = component * sizeof_component;
VIPS_DEBUG_MSG( "vips_exif_set_int: %s = %d\n",
vips_exif_entry_get_name( entry ), value );
if( entry->format == EXIF_FORMAT_SHORT )
exif_set_short( entry->data + offset, bo, value );
else if( entry->format == EXIF_FORMAT_SSHORT )
exif_set_sshort( entry->data + offset, bo, value );
else if( entry->format == EXIF_FORMAT_LONG )
exif_set_long( entry->data + offset, bo, value );
else if( entry->format == EXIF_FORMAT_SLONG )
exif_set_slong( entry->data + offset, bo, value );
}
示例3: boxes_renumber
/* Renumber after clustering. We will have removed a lot of hlines ... shuffle
* the rest down, adjust all the vline references.
*/
static void
boxes_renumber( Boxes *boxes )
{
int i, j;
VIPS_DEBUG_MSG( "boxes_renumber: renumbering ...\n" );
/* Loop for all zero-weight hlines.
*/
for( i = 0; i < boxes->n_hline; ) {
if( boxes->hline[i].weight > 0 ) {
i++;
continue;
}
/* We move hlines i + 1 down, so we need to adjust all
* band[] refs to match.
*/
for( j = 0; j < boxes->n_velement; j++ )
if( boxes->velement[j].band > i )
boxes->velement[j].band -= 1;
memmove( boxes->hline + i, boxes->hline + i + 1,
sizeof( HLine ) * (boxes->n_hline - i - 1) );
boxes->n_hline -= 1;
}
VIPS_DEBUG_MSG( "boxes_renumber: ... %d hlines remain\n",
boxes->n_hline );
}
示例4: vips_exif_set_double
/* Does both signed and unsigned rationals from a double*.
*
* Don't change the exit entry if the value currently there is a good
* approximation of the double we are trying to set.
*/
static void
vips_exif_set_double( ExifData *ed,
ExifEntry *entry, unsigned long component, void *data )
{
double value = *((double *) data);
ExifByteOrder bo;
size_t sizeof_component;
size_t offset;
double old_value;
if( entry->components <= component ) {
VIPS_DEBUG_MSG( "vips_exif_set_double: "
"too few components\n" );
return;
}
/* Wait until after the component check to make sure we cant get /0.
*/
bo = exif_data_get_byte_order( ed );
sizeof_component = entry->size / entry->components;
offset = component * sizeof_component;
VIPS_DEBUG_MSG( "vips_exif_set_double: %s = %g\n",
vips_exif_entry_get_name( entry ), value );
if( entry->format == EXIF_FORMAT_RATIONAL ) {
ExifRational rv;
rv = exif_get_rational( entry->data + offset, bo );
old_value = (double) rv.numerator / rv.denominator;
if( VIPS_FABS( old_value - value ) > 0.0001 ) {
vips_exif_double_to_rational( value, &rv );
VIPS_DEBUG_MSG( "vips_exif_set_double: %u / %u\n",
rv.numerator,
rv.denominator );
exif_set_rational( entry->data + offset, bo, rv );
}
}
else if( entry->format == EXIF_FORMAT_SRATIONAL ) {
ExifSRational srv;
srv = exif_get_srational( entry->data + offset, bo );
old_value = (double) srv.numerator / srv.denominator;
if( VIPS_FABS( old_value - value ) > 0.0001 ) {
vips_exif_double_to_srational( value, &srv );
VIPS_DEBUG_MSG( "vips_exif_set_double: %d / %d\n",
srv.numerator, srv.denominator );
exif_set_srational( entry->data + offset, bo, srv );
}
}
}
示例5: vips_tile_find
/* Find existing tile, make a new tile, or if we have a full set of tiles,
* reuse one.
*/
static VipsTile *
vips_tile_find( VipsBlockCache *cache, int x, int y )
{
VipsTile *tile;
VipsTileSearch search;
/* In cache already?
*/
if( (tile = vips_tile_search( cache, x, y )) ) {
VIPS_DEBUG_MSG( "vips_tile_find: tile %d x %d in cache\n",
x, y );
return( tile );
}
/* VipsBlockCache not full?
*/
if( cache->max_tiles == -1 ||
cache->ntiles < cache->max_tiles ) {
VIPS_DEBUG_MSG( "vips_tile_find: making new tile at %d x %d\n",
x, y );
if( !(tile = vips_tile_new( cache, x, y )) )
return( NULL );
return( tile );
}
/* Reuse an old one.
*/
search.oldest = cache->time;
search.topmost = cache->in->Ysize;
search.tile = NULL;
g_hash_table_foreach( cache->tiles, vips_tile_search_recycle, &search );
tile = search.tile;
if( !tile ) {
/* There are no tiles we can reuse -- we have to make another
* for now. They will get culled down again next time around.
*/
if( !(tile = vips_tile_new( cache, x, y )) )
return( NULL );
return( tile );
}
VIPS_DEBUG_MSG( "tilecache: reusing tile %d x %d\n",
tile->pos.left, tile->pos.top );
if( vips_tile_move( tile, x, y ) )
return( NULL );
return( tile );
}
示例6: vips_statistic_scan
static int
vips_statistic_scan( VipsRegion *region,
void *seq, void *a, void *b, gboolean *stop )
{
VipsStatistic *statistic = VIPS_STATISTIC( a );
VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS( statistic );
VipsRect *r = ®ion->valid;
int lsk = IM_REGION_LSKIP( region );
int y;
PEL *p;
VIPS_DEBUG_MSG( "vips_statistic_scan: %d x %d @ %d x %d\n",
r->width, r->height, r->left, r->top );
p = (PEL *) IM_REGION_ADDR( region, r->left, r->top );
for( y = 0; y < r->height; y++ ) {
if( class->scan( statistic,
seq, r->left, r->top + y, p, r->width ) )
return( -1 );
p += lsk;
}
/* If we've requested stop, pass the message on.
*/
if( statistic->stop )
*stop = TRUE;
return( 0 );
}
示例7: vips_sequential_build
static int
vips_sequential_build( VipsObject *object )
{
VipsConversion *conversion = VIPS_CONVERSION( object );
VipsSequential *sequential = (VipsSequential *) object;
VIPS_DEBUG_MSG( "vips_sequential_build\n" );
if( VIPS_OBJECT_CLASS( vips_sequential_parent_class )->build( object ) )
return( -1 );
if( vips_image_pio_input( sequential->in ) )
return( -1 );
if( vips_image_copy_fields( conversion->out, sequential->in ) )
return( -1 );
vips_demand_hint( conversion->out,
VIPS_DEMAND_STYLE_FATSTRIP, sequential->in, NULL );
if( vips_image_generate( conversion->out,
vips_start_one, vips_sequential_generate, vips_stop_one,
sequential->in, sequential ) )
return( -1 );
return( 0 );
}
示例8: vips_operation_finalize
static void
vips_operation_finalize( GObject *gobject )
{
VIPS_DEBUG_MSG( "vips_operation_finalize: %p\n", gobject );
G_OBJECT_CLASS( vips_operation_parent_class )->finalize( gobject );
}
示例9: vips__openslide_isslide
int
vips__openslide_isslide( const char *filename )
{
openslide_t *osr;
const char *vendor;
int ok;
ok = 0;
if( (osr = openslide_open( filename )) ) {
/* Generic tiled tiff images can be opened by openslide as
* well. Only offer to load this file if it's not a generic
* tiff since we want vips_tiffload() to handle these.
*/
vendor = openslide_get_property_value( osr,
OPENSLIDE_PROPERTY_NAME_VENDOR );
if( vendor &&
strcmp( vendor, "generic-tiff" ) != 0 )
ok = 1;
openslide_close( osr );
}
VIPS_DEBUG_MSG( "vips__openslide_isslide: %s - %d\n", filename, ok );
return( ok );
}
示例10: vips__openslide_read_associated
int
vips__openslide_read_associated( const char *filename, VipsImage *out,
const char *associated )
{
ReadSlide *rslide;
VipsImage *raw;
const char *error;
VIPS_DEBUG_MSG( "vips__openslide_read_associated: %s %s\n",
filename, associated );
/* Memory buffer. Get associated directly to this, then copy to out.
*/
raw = vips_image_new_buffer();
vips_object_local( out, raw );
if( !(rslide = readslide_new( filename, raw, 0, associated )) ||
vips_image_write_prepare( raw ) )
return( -1 );
openslide_read_associated_image( rslide->osr, rslide->associated,
(uint32_t *) VIPS_IMAGE_ADDR( raw, 0, 0 ) );
error = openslide_get_error( rslide->osr );
if( error ) {
vips_error( "openslide2vips",
_( "reading associated image: %s" ), error );
return( -1 );
}
if( vips_image_write( raw, out ) )
return( -1 );
return( 0 );
}
示例11: vips_tile_cache_build
static int
vips_tile_cache_build( VipsObject *object )
{
VipsConversion *conversion = VIPS_CONVERSION( object );
VipsTileCache *cache = (VipsTileCache *) object;
VIPS_DEBUG_MSG( "vips_tile_cache_build\n" );
if( VIPS_OBJECT_CLASS( vips_tile_cache_parent_class )->build( object ) )
return( -1 );
if( vips_image_pio_input( cache->in ) )
return( -1 );
if( vips_image_copy_fields( conversion->out, cache->in ) )
return( -1 );
vips_demand_hint( conversion->out,
VIPS_DEMAND_STYLE_SMALLTILE, cache->in, NULL );
if( vips_image_generate( conversion->out,
vips_start_one, vips_tile_cache_gen, vips_stop_one,
cache->in, cache ) )
return( -1 );
return( 0 );
}
示例12: vips_thread_profile_save
static void
vips_thread_profile_save( VipsThreadProfile *profile )
{
g_mutex_lock( vips__global_lock );
VIPS_DEBUG_MSG( "vips_thread_profile_save: %s\n", profile->name );
if( !vips__thread_fp ) {
vips__thread_fp =
vips__file_open_write( "vips-profile.txt", TRUE );
if( !vips__thread_fp ) {
g_mutex_unlock( vips__global_lock );
g_warning( "unable to create profile log" );
return;
}
printf( "recording profile in vips-profile.txt\n" );
}
fprintf( vips__thread_fp, "thread: %s (%p)\n", profile->name, profile );
g_hash_table_foreach( profile->gates,
vips_thread_profile_save_cb, vips__thread_fp );
vips_thread_profile_save_gate( profile->memory, vips__thread_fp );
g_mutex_unlock( vips__global_lock );
}
示例13: vips_sequential_build
static int
vips_sequential_build( VipsObject *object )
{
VipsConversion *conversion = VIPS_CONVERSION( object );
VipsSequential *sequential = (VipsSequential *) object;
VipsImage *t;
VIPS_DEBUG_MSG( "vips_sequential_build\n" );
if( VIPS_OBJECT_CLASS( vips_sequential_parent_class )->build( object ) )
return( -1 );
if( vips_image_pio_input( sequential->in ) )
return( -1 );
if( vips_linecache( sequential->in, &t,
"tile_height", sequential->tile_height,
"access", sequential->access,
NULL ) )
return( -1 );
vips_object_local( object, t );
if( vips_image_pipelinev( conversion->out,
VIPS_DEMAND_STYLE_THINSTRIP, t, NULL ) )
return( -1 );
if( vips_image_generate( conversion->out,
vips_start_one, vips_sequential_generate, vips_stop_one,
t, sequential ) )
return( -1 );
return( 0 );
}
示例14: vips_exif_update
static void
vips_exif_update( ExifData *ed, VipsImage *image )
{
VipsExifRemove ve;
VIPS_DEBUG_MSG( "vips_exif_update: \n" );
/* If this exif came from the image (rather than being an exif block we
* have made afresh), then any fields which are in the block but not on
* the image must have been deliberately removed. Remove them from the
* block as well.
*
* If there are any string-valued fields (eg. comment etc.) which
* exist as libvips metadata tags, we must also remove those from the
* exif block.
*
* libexif does not allow you to change string lengths, you must make
* new tags, so we have to remove ready to re-add.
*/
if( vips_image_get_typeof( image, VIPS_META_EXIF_NAME ) ) {
ve.image = image;
ve.ed = ed;
exif_data_foreach_content( ed,
(ExifDataForeachContentFunc) vips_exif_exif_content,
&ve );
}
/* Walk the image and add any exif- that's set in image metadata.
*/
vips_image_map( image, vips_exif_image_field, ed );
}
示例15: vips_region_build
static int
vips_region_build( VipsObject *object )
{
VipsRegion *region = VIPS_REGION( object );
VipsImage *image = region->im;
VIPS_DEBUG_MSG( "vips_region_build: %p\n", region );
if( VIPS_OBJECT_CLASS( vips_region_parent_class )->build( object ) )
return( -1 );
vips__region_take_ownership( region );
/* We're usually inside the ss lock anyway. But be safe ...
*/
VIPS_GATE_START( "vips_region_build: wait" );
g_mutex_lock( image->sslock );
VIPS_GATE_STOP( "vips_region_build: wait" );
image->regions = g_slist_prepend( image->regions, region );
g_mutex_unlock( image->sslock );
return( 0 );
}