better object rewind
added a vips_object_rewind() to allow rebuild, though it's not quite working yet, see TODO
This commit is contained in:
parent
834630e562
commit
e180c9ec52
18
TODO
18
TODO
@ -1,8 +1,20 @@
|
||||
- debug.c can go?
|
||||
- rewind is not removing arg instance flags
|
||||
|
||||
make sanity a method on object
|
||||
VIPS-WARNING **: object.c:567: VipsImage can only assign 'nickname' once
|
||||
|
||||
tools/others/sines.c and friends can go
|
||||
VipsArgumentInstance *argument_instance =
|
||||
vips__argument_get_instance( argument_class, object );
|
||||
|
||||
how do we find and junk these?
|
||||
|
||||
vips_object_dispose_argument(
|
||||
|
||||
runs, but perhaps does not trash instance storage? where is this released?
|
||||
|
||||
|
||||
|
||||
|
||||
- tools/others/sines.c and friends can go
|
||||
|
||||
|
||||
- why not rename VipsBandFormat as VipsFormat? cf. VipsCoding,
|
||||
|
@ -292,6 +292,8 @@ void vips_object_local_cb( VipsObject *vobject, GObject *gobject );
|
||||
void vips_object_print_all( void );
|
||||
void vips_object_sanity_all( void );
|
||||
|
||||
void vips_object_rewind( VipsObject *object );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /*__cplusplus*/
|
||||
|
@ -235,7 +235,7 @@ im_incheck( IMAGE *im )
|
||||
/* Free any resources the image holds and reset to a base
|
||||
* state.
|
||||
*/
|
||||
g_object_run_dispose( G_OBJECT( im ) );
|
||||
vips_object_rewind( VIPS_OBJECT( im ) );
|
||||
|
||||
/* And reopen .. recurse to get a mmaped image.
|
||||
*/
|
||||
@ -456,7 +456,7 @@ im_pincheck( IMAGE *im )
|
||||
/* Free any resources the image holds and reset to a base
|
||||
* state.
|
||||
*/
|
||||
g_object_run_dispose( G_OBJECT( im ) );
|
||||
vips_object_rewind( VIPS_OBJECT( im ) );
|
||||
|
||||
g_object_set( im,
|
||||
"mode", "r",
|
||||
|
@ -1244,3 +1244,18 @@ vips_object_sanity_all( void )
|
||||
{
|
||||
vips_object_map( (VSListMap2Fn) vips_object_sanity_all_cb, NULL, NULL );
|
||||
}
|
||||
|
||||
/* On a rewind, we dispose the old contents of the object and
|
||||
* reconstruct. This is used in things like im_pincheck() where a "w"
|
||||
* image has to be rewound and become a "p" image.
|
||||
*/
|
||||
void
|
||||
vips_object_rewind( VipsObject *object )
|
||||
{
|
||||
g_object_run_dispose( G_OBJECT( object ) );
|
||||
|
||||
object->constructed = FALSE;
|
||||
object->preclose = FALSE;
|
||||
object->close = FALSE;
|
||||
object->postclose = FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user