Module freeimage

Corona binding for FreeImage:

"FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications.

FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit or 64-bit versions of Windows, and cross-platform (works both with Linux and Mac OS X)."

This binding largely follows FreeImagePlus.

local freeimage = require("plugin.freeimage")

Functions

IdentifyFIF (string) Identify an image file's format.
NewImage ([image_type="BITMAP"[, width=0[, height=0[, bpp=0]]]]) Instantiate a new fipImage.
NewMemoryIO ([data[, size_in_bytes=0]]) Wrap a memory buffer containing image data.
NewMultiPage (keep_in_memory) Instantiate a new fipMultiPage.
NewWinImage ([image_type="BITMAP"[, width=0[, height=0[, bpp=0]]]]) Instantiate a new fipWinImage.


Functions

IdentifyFIF (string)
Identify an image file's format.

Parameters:

  • string name Filename.

Returns:

    uint FIF code. (TODO This is probably broken, should return a file format)
NewImage ([image_type="BITMAP"[, width=0[, height=0[, bpp=0]]]])
Instantiate a new fipImage.

Parameters:

  • image_type string Image type, cf. enums.FREE_IMAGE_TYPE. (default "BITMAP")
  • width uint (default 0)
  • height uint (default 0)
  • bpp uint Bitdepth. (default 0)

Returns:

    fipImage New image.
NewMemoryIO ([data[, size_in_bytes=0]])
Wrap a memory buffer containing image data.

The memory buffer is read only and has to be freed by the user when no longer in use. (TODO: true?)

When default arguments are used, open a memory file as read/write.

Parameters:

  • data Pointer to the memory buffer.
  • size_in_bytes uint Buffer size in bytes. (default 0)

Returns:

    fipMemoryIO New memory handle.
NewMultiPage (keep_in_memory)
Instantiate a new fipMultiPage.

Parameters:

  • keep_in_memory bool When true, all gathered bitmap data in the page manipulation process is kept in memory, otherwise it is lazily flushed to a temporary file on the hard disk in 64 Kb blocks.

Returns:

    fipMultiPage New multi-page.
NewWinImage ([image_type="BITMAP"[, width=0[, height=0[, bpp=0]]]])
Instantiate a new fipWinImage.

Parameters:

  • image_type string Image type, cf. enums.FREE_IMAGE_TYPE. (default "BITMAP")
  • width uint (default 0)
  • height uint (default 0)
  • bpp uint Bitdepth. (default 0)

Returns:

    fipWinImage New (Win) image.
generated by LDoc 1.4.0