C_ImageProcessing
High-level API for dealing with common image formats
Status
Experimental: Functionality may change for any reason, without semantic versioning guarantees
Availability
This is a global namespace and can be accessed directly:
C_ImageProcessing.DecodeFileContents(imageFileContents)
Functions
DecodeFileContents
Decodes the given imageFileContents
and returns the raw pixel data in RGBA format, as well as the image dimensions. Any file format that's supported by stbi_image can be decoded. This includes at least the following: BMP, PNG, JPG, TGA.
Available since: v0.0.9Arguments |
---|
# | Name | Type | Fallback |
---|
| imageFileContents | string | |
Return values |
---|
# | Name | Type |
---|
| rgbaPixelArray | table |
| imageWidthInPixels | number |
| imageHeightInPixels | number |
EncodeBMP
Encodes the given rgbaPixelArray
as a BMP image of the provided dimensions.
Available since: v0.0.9Arguments |
---|
# | Name | Type | Fallback |
---|
| rgbaPixelArray | table | |
| imageWidthInPixels | number | |
| imageHeightInPixels | number | |
Return values |
---|
# | Name | Type |
---|
| bmpFileContents | string |
EncodePNG
Encodes the given rgbaPixelArray
as a PNG image of the provided dimensions, without padding (zero-length stride).
Available since: v0.0.9Arguments |
---|
# | Name | Type | Fallback |
---|
| rgbaPixelArray | table | |
| imageWidthInPixels | number | |
| imageHeightInPixels | number | |
Return values |
---|
# | Name | Type |
---|
| pngFileContents | string |
EncodeJPG
Encodes the given rgbaPixelArray
as a JPEG image of the provided dimensions, using the highest quality setting (100%).
Available since: v0.0.9Arguments |
---|
# | Name | Type | Fallback |
---|
| rgbaPixelArray | table | |
| imageWidthInPixels | number | |
| imageHeightInPixels | number | |
Return values |
---|
# | Name | Type |
---|
| jpegFileContents | string |
EncodeTGA
Encodes the given rgbaPixelArray
as a TGA image of the provided dimensions.
Available since: v0.0.10Arguments |
---|
# | Name | Type | Fallback |
---|
| rgbaPixelArray | table | |
| imageWidthInPixels | number | |
| imageHeightInPixels | number | |
Return values |
---|
# | Name | Type |
---|
| tgaFileContents | string |
Changelog
Version | What happened? |
---|
v0.0.10 | Added EncodeTGA |
v0.0.9 | Initial release |