Module ui.renderimage

Image rendering module.

All the render* functions should return a BlitBuffer object on success, nil otherwise.

Functions

RenderImage:renderImageFile (filename[, want_frames=false], width, height) Renders image file as a BlitBuffer with the best renderer
RenderImage:renderImageData (string, size[, want_frames=false], width, height) Renders image data as a BlitBuffer with the best renderer
RenderImage:renderImageDataWithMupdf (string, size, width, height) Renders image data as a BlitBuffer with MuPDF
RenderImage:renderSVGImageDataWithCRengine (string, size, width, height) Renders SVG image data as a BlitBuffer with CRengine (and extended LunaSVG)
RenderImage:renderGifImageDataWithGifLib (string, size[, want_frames=false], width, height) Renders image data as a BlitBuffer with GifLib
RenderImage:renderWebpImageDataWithLibwebp (string, size[, want_frames=false], width, height) Renders image data as a BlitBuffer with libwebp
RenderImage:scaleBlitBuffer (BlitBuffer, width, height[, free_orig_bb=true]) Rescales a BlitBuffer to the requested size if needed
RenderImage:renderSVGImageFile (filename, width, height, zoom) Renders SVG image file as a BlitBuffer with the best renderer
RenderImage:renderCheckerboard (width, height, bb_type) Renders a checkerboard pattern (useful as a fallback after a decoding failure)


Functions

RenderImage:renderImageFile (filename[, want_frames=false], width, height)
Renders image file as a BlitBuffer with the best renderer

Parameters:

  • filename string image file path
  • want_frames bool whether to return a list of animated GIF frames (default false)
  • width int requested width
  • height int requested height

Returns:

    BlitBuffer or list of frames (each a function returning a Blitbuffer)
RenderImage:renderImageData (string, size[, want_frames=false], width, height)
Renders image data as a BlitBuffer with the best renderer

Parameters:

  • string data or userdata (pointer) with image bytes
  • size int size of data
  • want_frames bool whether to return a list of animated GIF frames (default false)
  • width int requested width
  • height int requested height

Returns:

    BlitBuffer or list of frames (each a function returning a Blitbuffer)
RenderImage:renderImageDataWithMupdf (string, size, width, height)
Renders image data as a BlitBuffer with MuPDF

Parameters:

  • string data or userdata (pointer) with image bytes
  • size int size of data
  • width int requested width
  • height int requested height

Returns:

    BlitBuffer
RenderImage:renderSVGImageDataWithCRengine (string, size, width, height)
Renders SVG image data as a BlitBuffer with CRengine (and extended LunaSVG)

Parameters:

  • string data or userdata (pointer) with image bytes
  • size int size of data
  • width int requested width
  • height int requested height

Returns:

    BlitBuffer
RenderImage:renderGifImageDataWithGifLib (string, size[, want_frames=false], width, height)
Renders image data as a BlitBuffer with GifLib

Parameters:

  • string data or userdata (pointer) with image bytes
  • size int size of data
  • want_frames bool whether to also return a list with animated GIF frames (default false)
  • width int requested width
  • height int requested height

Returns:

    BlitBuffer or list of frames (each a function returning a Blitbuffer)
RenderImage:renderWebpImageDataWithLibwebp (string, size[, want_frames=false], width, height)
Renders image data as a BlitBuffer with libwebp

Parameters:

  • string data or userdata (pointer) with image bytes
  • size int size of data
  • want_frames bool whether to also return a list with animated WebP frames (default false)
  • width int requested width
  • height int requested height

Returns:

    BlitBuffer or list of frames (each a function returning a Blitbuffer)
RenderImage:scaleBlitBuffer (BlitBuffer, width, height[, free_orig_bb=true])
Rescales a BlitBuffer to the requested size if needed

Parameters:

  • BlitBuffer bb
  • width int
  • height int
  • free_orig_bb bool free() original bb if scaled (default true)

Returns:

    BlitBuffer
RenderImage:renderSVGImageFile (filename, width, height, zoom)
Renders SVG image file as a BlitBuffer with the best renderer

Parameters:

  • filename string image file path
  • width int requested width
  • height int requested height
  • zoom number requested zoom

Returns:

    BlitBuffer
RenderImage:renderCheckerboard (width, height, bb_type)
Renders a checkerboard pattern (useful as a fallback after a decoding failure)

Parameters:

  • width
  • height
  • bb_type
generated by LDoc 1.4.6 Last updated 2022-09-28 20:16:06