GifEncoder

gif.GifEncoder (Class)

Static Members

gif
clamp(value: Float, a: Float, b: Float): Float

Clamp a value between a and b and return the clamped version

Name Type
value Float
a Float
b Float
Returns
Float

Instance Members

gif
print(): Void

Allows a custom print handler for error messages. Defaults to Sys.println on sys targets, and trace otherwise.


gif
start(output: haxe.io.BytesOutput): Void
Name Type
output haxe.io.BytesOutput

gif
add(output: haxe.io.BytesOutput, frame: GifFrame): Void
Name Type
output haxe.io.BytesOutput
frame GifFrame

gif
commit(output: haxe.io.BytesOutput): Void
Name Type
output haxe.io.BytesOutput

gif
new(_frame_width: Int, _frame_height: Int, _framerate: Float, ?_repeat: Int = GifRepeat.Infinite, ?_quality: Int = 10): Void

Construct a gif encoder with options:

frame width/height: Default is 0, required

framerate: This is used if an added frame has a delay that is negative.

repeat: Default is 0 (no repeat); -1 means play indefinitely. Use GifRepeat for clarity

quality: Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. Higher values will speed up the quantization pass at the cost of lower image quality (maximum = 100).

Name Type Default
_frame_width Int
_frame_height Int
_framerate Float
_repeat Int GifRepeat.Infinite
_quality Int 10

Private Members

gif
width: Int

gif
height: Int

gif
framerate: Float

gif
repeat: Int

gif
colorDepth: Int

gif
paletteSize: Int

gif
sampleInterval: Int


gif
indexedPixels: haxe.io.UInt8Array

gif
colorTab: haxe.io.UInt8Array

gif
usedEntry: Array<Bool>

gif
nq: NeuQuant

gif
lzwEncoder: LzwEncoder

gif
started: Bool

gif
first_frame: Bool

gif
analyze(pixels: haxe.io.UInt8Array): Void
Name Type
pixels haxe.io.UInt8Array

gif
write_LSD(output: haxe.io.BytesOutput): Void

Writes Logical Screen Descriptor.

Name Type
output haxe.io.BytesOutput

gif
write_NetscapeExt(output: haxe.io.BytesOutput): Void

Writes Netscape application extension to define repeat count.

Name Type
output haxe.io.BytesOutput

gif
write_palette(output: haxe.io.BytesOutput): Void

Write color table.

Name Type
output haxe.io.BytesOutput

gif
write_pixels(output: haxe.io.BytesOutput): Void

Encodes and writes pixel data.

Name Type
output haxe.io.BytesOutput

gif
write_image_desc(output: haxe.io.BytesOutput, first: Bool): Void

Writes Image Descriptor.

Name Type
output haxe.io.BytesOutput
first Bool

gif
write_GraphicControlExt(output: haxe.io.BytesOutput, delay: Float): Void

Writes Graphic Control Extension. Delay is in seconds, floored and converted to 1/100 of a second

Name Type
output haxe.io.BytesOutput
delay Float