gifsave: use cgif namespaced API (#2422)
See https://github.com/dloebl/cgif/pull/18
This commit is contained in:
parent
307d24eea7
commit
4d079f1691
@ -99,9 +99,9 @@ vips_foreign_save_cgif_build( VipsObject *object )
|
|||||||
uint8_t * restrict paletteRgba;
|
uint8_t * restrict paletteRgba;
|
||||||
uint8_t * restrict paletteRgb;
|
uint8_t * restrict paletteRgb;
|
||||||
|
|
||||||
GIF *cgif_context;
|
CGIF *cgif_context;
|
||||||
GIFConfig cgif_config;
|
CGIF_Config cgif_config;
|
||||||
FrameConfig cgif_frame_config;
|
CGIF_FrameConfig cgif_frame_config;
|
||||||
|
|
||||||
if( VIPS_OBJECT_CLASS( vips_foreign_save_cgif_parent_class )->
|
if( VIPS_OBJECT_CLASS( vips_foreign_save_cgif_parent_class )->
|
||||||
build( object ) )
|
build( object ) )
|
||||||
@ -155,15 +155,15 @@ vips_foreign_save_cgif_build( VipsObject *object )
|
|||||||
|
|
||||||
/* Initiialise cgif
|
/* Initiialise cgif
|
||||||
*/
|
*/
|
||||||
memset( &cgif_config, 0, sizeof( GIFConfig ) );
|
memset( &cgif_config, 0, sizeof( CGIF_Config ) );
|
||||||
cgif_config.width = t[4]->Xsize;
|
cgif_config.width = t[4]->Xsize;
|
||||||
cgif_config.height = page_height;
|
cgif_config.height = page_height;
|
||||||
cgif_config.pGlobalPalette = paletteRgb;
|
cgif_config.pGlobalPalette = paletteRgb;
|
||||||
cgif_config.numGlobalPaletteEntries = t[5]->Xsize;
|
cgif_config.numGlobalPaletteEntries = t[5]->Xsize;
|
||||||
cgif_config.numLoops = loop;
|
cgif_config.numLoops = loop;
|
||||||
cgif_config.attrFlags = GIF_ATTR_IS_ANIMATED;
|
cgif_config.attrFlags = CGIF_ATTR_IS_ANIMATED;
|
||||||
if( has_transparency )
|
if( has_transparency )
|
||||||
cgif_config.attrFlags |= GIF_ATTR_HAS_TRANSPARENCY;
|
cgif_config.attrFlags |= CGIF_ATTR_HAS_TRANSPARENCY;
|
||||||
cgif_config.pWriteFn = vips__cgif_write;
|
cgif_config.pWriteFn = vips__cgif_write;
|
||||||
cgif_config.pContext = (void *) cgif->target;
|
cgif_config.pContext = (void *) cgif->target;
|
||||||
cgif_context = cgif_newgif( &cgif_config );
|
cgif_context = cgif_newgif( &cgif_config );
|
||||||
@ -174,7 +174,7 @@ vips_foreign_save_cgif_build( VipsObject *object )
|
|||||||
for( top = 0; top < t[4]->Ysize; top += page_height ) {
|
for( top = 0; top < t[4]->Ysize; top += page_height ) {
|
||||||
int page_index = top / page_height;
|
int page_index = top / page_height;
|
||||||
|
|
||||||
memset( &cgif_frame_config, 0, sizeof( FrameConfig ) );
|
memset( &cgif_frame_config, 0, sizeof( CGIF_FrameConfig ) );
|
||||||
cgif_frame_config.pImageData = (uint8_t *)
|
cgif_frame_config.pImageData = (uint8_t *)
|
||||||
VIPS_IMAGE_ADDR( t[4], 0, top );
|
VIPS_IMAGE_ADDR( t[4], 0, top );
|
||||||
if( delay &&
|
if( delay &&
|
||||||
@ -185,8 +185,8 @@ vips_foreign_save_cgif_build( VipsObject *object )
|
|||||||
/* Allow cgif to optimise by adding transparency
|
/* Allow cgif to optimise by adding transparency
|
||||||
*/
|
*/
|
||||||
cgif_frame_config.genFlags =
|
cgif_frame_config.genFlags =
|
||||||
FRAME_GEN_USE_TRANSPARENCY |
|
CGIF_FRAME_GEN_USE_TRANSPARENCY |
|
||||||
FRAME_GEN_USE_DIFF_WINDOW;
|
CGIF_FRAME_GEN_USE_DIFF_WINDOW;
|
||||||
cgif_addframe( cgif_context, &cgif_frame_config );
|
cgif_addframe( cgif_context, &cgif_frame_config );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user