Image (reference counted) now uses shared_ptr.

This commit is contained in:
2025-08-01 01:30:15 -04:00
parent b2963b17d2
commit 65f85a0b43
9 changed files with 31 additions and 65 deletions

View File

@ -69,21 +69,17 @@ struct DilloImage {
std::unique_ptr< bitvec_t > BitVec; /**< Bit vector for decoded rows */
uint_t ScanNumber; /**< Current decoding scan */
ImageState State; /**< Processing status */
int RefCount; /**< Reference counter */
};
/*
* Function prototypes
*/
DilloImage *a_Image_new(void *layout, void *img_rndr,
std::shared_ptr< DilloImage > a_Image_new(void *layout, void *img_rndr,
int32_t bg_color, int32_t fg_color);
DilloImage *a_Image_new_with_dw(void *layout, const char *alt_text,
std::shared_ptr< DilloImage > a_Image_new_with_dw(void *layout, const char *alt_text,
int32_t bg_color, int32_t fg_color);
void *a_Image_get_dw(DilloImage *Image);
void a_Image_ref(DilloImage *Image);
void a_Image_unref(DilloImage *Image);
void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url,
int version, uint_t width, uint_t height,