pig.js icon indicating copy to clipboard operation
pig.js copied to clipboard

Add support for custom ProgressiveImage equivalents

Open Ortham opened this issue 7 years ago • 0 comments

As it is, pig.js doesn't give you any control over what is rendered on the grid, beyond specifying a filename and aspect ratio for each image. This adds the ability to specify an alternative implementation of ProgressiveImage to display images with.

Implementations must still provide the same interface as ProgressiveImage, which according to what Pig uses is (in TypeScript):

interface PigImage {
    aspectRatio: number;
    style: PigImageStyle;

    load(): void;
    hide(): void;
}

// All numbers have units pixels.
interface PigImageStyle {
    width: number;
    height: number;
    translateX: number;
    translateY: number;
    transition: string;
}

Ortham avatar Jun 09 '18 11:06 Ortham