Logo Search packages:      
Sourcecode: zebra version File versions  Download package

void zebra_image_free_data ( zebra_image_t image  )  [inline]

built-in cleanup handler. passes the image data buffer to free()

Definition at line 80 of file image.c.

References zebra_image_create(), and zebra_image_free_data().

Referenced by zebra_image_convert_resize(), zebra_image_free_data(), and zebra_image_set_data().

{
    if(!img)
        return;
    if(img->src) {
        /* replace video image w/new copy */
        assert(img->refcnt);
        zebra_image_t *newimg = zebra_image_create();
        memcpy(newimg, img, sizeof(zebra_image_t));
        /* recycle video image */
        newimg->cleanup(newimg);
        /* detach old image from src */
        img->cleanup = NULL;
        img->src = NULL;
        img->srcidx = -1;
    }
    else if(img->cleanup && img->data) {
        if(img->cleanup != zebra_image_free_data)
            img->cleanup(img);
        else
            free((void*)img->data);
    }
    img->data = NULL;
}


Generated by  Doxygen 1.6.0   Back to index