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 boolean whether to return a list of animated GIF frames (default false)
  • width integer requested width
  • height integer 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 integer size of data
  • want_frames boolean whether to return a list of animated GIF frames (default false)
  • width integer requested width
  • height integer 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 integer size of data
  • width integer requested width
  • height integer 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 integer size of data
  • width integer requested width
  • height integer 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 integer size of data
  • want_frames boolean whether to also return a list with animated GIF frames (default false)
  • width integer requested width
  • height integer 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 integer size of data
  • want_frames boolean whether to also return a list with animated WebP frames (default false)
  • width integer requested width
  • height integer 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 integer
  • height integer
  • free_orig_bb boolean 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 integer requested width
  • height integer 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.5.0 Last updated 2024-11-21 07:57:34