Package ilda
Class IldaWriter
java.lang.Object
be.cmbsoft.ilda.IldaWriter
Writes IldaFrames to an ilda file.
By default, ilda v4 is used.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getBytesFromFrames
(IldaFrame[] frames, int ildaVersion) This method returns a byte array from only an ArrayList of IldaFrames.static byte[]
getBytesFromFrames
(IldaFrame[] frames, IldaPalette palette, int ildaVersion) static byte[]
getBytesFromFrames
(List<IldaFrame> frames) static byte[]
getBytesFromFrames
(List<IldaFrame> frames, int ildaVersion) static byte[]
getBytesFromFrames
(List<IldaFrame> frames, IldaPalette palette, int ildaVersion) This method returns a byte array which can be exported directly as an ilda file from a palette and an ArrayList of IldaFrames.static void
static void
static void
writeFile
(String location, IldaFrame[] frames, IldaPalette palette, int ildaVersion) static void
Writes a valid ILDA file to the specified location in format 4static void
Writes a valid ilda file to a certain location with specified format.static void
writeFile
(String location, List<IldaFrame> frames, IldaPalette palette, int ildaVersion) Writes a valid ilda file to a certain location with specified format.
-
Method Details
-
writeFile
Writes a valid ilda file to a certain location with specified format.- Parameters:
location
- The path to where the ilda file should be exportedframes
- All frames that should be included in the ilda fileildaVersion
- ilda format: 0 = 3D, palette; 1 = 2D, palette; (2 = palette header); (3 = deprecated); 4 = 3D, RGB; 5 = 2D, RGB
-
writeFile
-
writeFile
public static void writeFile(String location, List<IldaFrame> frames, IldaPalette palette, int ildaVersion) Writes a valid ilda file to a certain location with specified format. It does not check if the specified location has a valid .ild extension.- Parameters:
location
- The path to where the ilda file should be exportedframes
- All frames that should be included in the ilda filepalette
- An IldaPalette that will be appended in front of the ilda file with a format 2 headerildaVersion
- ilda format: should be 0 or 1 since only those two formats use a palette for their colour information but nobody is stopping you from appending a palette to a format 4/5 file, though that would be pointless
-
writeFile
public static void writeFile(String location, IldaFrame[] frames, IldaPalette palette, int ildaVersion) -
writeFile
-
writeFile
Writes a valid ILDA file to the specified location in format 4- Parameters:
location
- Where to write the file toframes
- Frames that will go into the file
-
getBytesFromFrames
-
getBytesFromFrames
-
getBytesFromFrames
public static byte[] getBytesFromFrames(List<IldaFrame> frames, IldaPalette palette, int ildaVersion) This method returns a byte array which can be exported directly as an ilda file from a palette and an ArrayList of IldaFrames. It will insert the palette as a format 2 header before all frames. It assumes the colours already have the correct colour index, no recolourisation happens.- Parameters:
frames
- an ArrayList of IldaFrames which get converted to ilda-compliant bytespalette
- an IldaPalette which gets appended before the laser art in the ilda fileildaVersion
- the ilda format the frames get saved as, can be 0, 1, 4 or 5 but only 0 and 1 use a palette. It makes no sense to export as format 4 or 5 with a palette included.- Returns:
- ilda compliant byte array which can be directly exported as an ilda file
-
getBytesFromFrames
-
getBytesFromFrames
This method returns a byte array from only an ArrayList of IldaFrames. This array can be saved to disk directly as a valid ilda file (binary file).- Parameters:
frames
- The framesildaVersion
- The ilda format version, can be 0, 1, 4 or 5.- Returns:
- Valid bytes that compose an ilda file
-