Variants

Variants — Functions for handling different size variants.

Functions

Includes

#include <abydos.h>

Description

Some formats may contain different varaints of the same image. The definition of variant in this context is different versions of the same image in different sizes. It could be embedded thumbnails. The thumbnail might not just be a scaled down version of the full size image, it could be some intelligent cropping involved. Or it could be a set of icons with different sizes and different detail level. Or it could be mipmap textures.

Functions

abydos_get_variant_count ()

int
abydos_get_variant_count (abydos_t *ar);

Get the number of variants of the image.

Parameters

ar

an abydos_t

 

Returns

The number of variants.


abydos_get_variant_size ()

void
abydos_get_variant_size (abydos_t *ar,
                         int variant,
                         int *width,
                         int *height);

Get the size of a certain variant.

Parameters

ar

an abydos_t

 

variant

variant number starting from 0

 

width

where to store the width (or NULL)

 

height

where to store the height (or NULL)

 

abydos_get_variant_at_size_min ()

int
abydos_get_variant_at_size_min (abydos_t *ar,
                                int width,
                                int height);

abydos_get_variant_at_size_max ()

int
abydos_get_variant_at_size_max (abydos_t *ar,
                                int width,
                                int height);

abydos_prefer_variant ()

void
abydos_prefer_variant (abydos_t *ar,
                       int width,
                       int height);