Package ilda

Class IldaWriter

java.lang.Object
be.cmbsoft.ilda.IldaWriter

public class IldaWriter extends Object
Writes IldaFrames to an ilda file. By default, ilda v4 is used.
  • Method Details

    • writeFile

      public static void writeFile (String location, List<IldaFrame> frames, int ildaVersion)
      Writes a valid ilda file to a certain location with specified format.
      Parameters:
      location - The path to where the ilda file should be exported
      frames - All frames that should be included in the ilda file
      ildaVersion - ilda format: 0 = 3D, palette; 1 = 2D, palette; (2 = palette header); (3 = deprecated); 4 = 3D, RGB; 5 = 2D, RGB
    • writeFile

      public static void writeFile (String location, IldaFrame[] frames, int ildaVersion)
    • 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 exported
      frames - All frames that should be included in the ilda file
      palette - An IldaPalette that will be appended in front of the ilda file with a format 2 header
      ildaVersion - 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

      public static void writeFile (String location, IldaFrame[] frames)
    • writeFile

      public static void writeFile (String location, List<IldaFrame> frames)
      Writes a valid ILDA file to the specified location in format 4
      Parameters:
      location - Where to write the file to
      frames - Frames that will go into the file
    • getBytesFromFrames

      public static byte[] getBytesFromFrames (List<IldaFrame> frames)
    • getBytesFromFrames

      public static byte[] getBytesFromFrames (List<IldaFrame> frames, int ildaVersion)
    • 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 bytes
      palette - an IldaPalette which gets appended before the laser art in the ilda file
      ildaVersion - 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

      public static byte[] getBytesFromFrames (IldaFrame[] frames, IldaPalette palette, int ildaVersion)
    • getBytesFromFrames

      public static byte[] getBytesFromFrames (IldaFrame[] frames, int ildaVersion)
      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 frames
      ildaVersion - The ilda format version, can be 0, 1, 4 or 5.
      Returns:
      Valid bytes that compose an ilda file