// //------------------ DOK FILE -------------------------------------------------- +Header core.2d.gif.maker =pkg core.2d.gif.maker =title core.2d.gif.maker =short encoding GIF files (still or animated) =desc This package contains functions to encode with the GIF file format (*.gif files). // // //------------------ PROTO ----------------------------------------------------- gifStdPalettize +Proto gifStdPalettize =type fun Bitmap Int Int -> GifFrame =mode function =pkg core.2d.gif.maker =impl mcy =link =desc This function builds a gif frame from a bitmap, to be used with [[gifFromFrames]]. The process uses a standard palette (blue and green: 3 bits, red: 2 bits). // +arg bmp =type Bitmap =desc The bitmap // +arg x =type Int =desc The x coordinate of the bitmap in the gif // +arg y =type Int =desc The y coordinate of the bitmap in the gif // +arg result =type GifFrame =desc The resulting frame // // //------------------ PROTO ----------------------------------------------------- gifFromFrames +Proto gifFromFrames =type fun Int Int list [GifFrame Int] Int -> Str =mode function =pkg core.2d.gif.maker =impl mcy =link =desc This function computes the animated gif encoding of a list of frames. // +arg w =type Int =desc width of the gif // +arg h =type Int =desc height of the gif // +arg lFrames =type list [GifFrame Int] =desc A list of frames. Each frame is a tuple [frame, duration], where duration is expressed in milliseconds. Frames are obtained from [[gifStdPalettize]] // +arg transparency =type Int =desc An RGB transparency color, or nil when no transparency is required // +arg result =type Str =desc A binary string encoding an animated gif content. // // //------------------ PROTO ----------------------------------------------------- gifFromBitmap +Proto gifFromBitmap =type fun Bitmap -> Str =mode function =pkg core.2d.gif.maker =impl mcy =link =desc This function computes the gif encoding of the bitmap bmp. // +arg bmp =type Bitmap =desc A bitmap // +arg result =type Str =desc A binary string encoding the bitmap as a gif content.