Package ilda

Class IldaFrame

java.lang.Object
be.cmbsoft.ilda.IldaFrame

public class IldaFrame extends Object
A frame is essentially a collection of points, and some metadata. It can render its geometry to a PGraphics.
  • Field Details

    • ildaVersion

      protected int ildaVersion
    • frameName

      protected String frameName
    • companyName

      protected String companyName
    • pointCount

      protected int pointCount
    • frameNumber

      protected int frameNumber
    • totalFrames

      protected int totalFrames
    • scannerHead

      protected int scannerHead
    • palette

      protected boolean palette
  • Constructor Details

    • IldaFrame

      public IldaFrame()
  • Method Details

    • fixHeaders

      public static void fixHeaders (List<IldaFrame> frames)
      Fixes the frame headers eg. updates point count, frame number, total frames, ... It leaves the frame name and company name untouched. It assumes the frames form a complete sequence.
      Parameters:
      frames - A reference to the frames whose headers need to get fixed.
    • fixHeaders

      public static void fixHeaders (List<IldaFrame> frames, String frameName, String companyName)
      Fixes the frame headers eg.updates point count, frame number, total frames It sets the frame name and company name to the arguments you gave it. It assumes the frames form a complete sequence (for the total frame entry). Call this before writing to an ilda file
      Parameters:
      frames - A reference to the frames whose headers need to get fixed.
      frameName - A name you want to give the frame
      companyName - Another name
    • fixHeader

      public static void fixHeader (IldaFrame frame, int frameNumber, int totalFrames, String frameName, String companyName)
      Static version of fixHeader() See documentation there
    • fixHeaders

      public static void fixHeaders (IldaFrame[] frames)
    • addPoint

      public void addPoint (IldaPoint point)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PApplet parent)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PApplet parent, int sizex, int sizey)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PGraphics pg, boolean showBlanking, int sizex, int sizey)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PApplet parent, boolean showBlanking, int sizex, int sizey)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PGraphics pg, boolean showBlanking)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PGraphics pg, boolean showBlanking, float rotx, float roty, float rotz)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PApplet parent, boolean showBlanking)
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PApplet parent, boolean showBlanking, float rotx, float roty, float rotz)
    • palettePaint

      public void palettePaint (IldaPalette palette)
    • getIldaVersion

      public int getIldaVersion()
    • getFrameName

      public String getFrameName()
    • setFrameName

      public void setFrameName (String frameName)
    • getCompanyName

      public String getCompanyName()
    • setCompanyName

      public void setCompanyName (String companyName)
    • getPointCount

      public int getPointCount()
    • getFrameNumber

      public int getFrameNumber()
    • setFrameNumber

      public void setFrameNumber (int frameNumber)
    • getTotalFrames

      public int getTotalFrames()
    • setTotalFrames

      public void setTotalFrames (int totalFrames)
    • getScannerHead

      public int getScannerHead()
    • setScannerHead

      public void setScannerHead (int scannerHead)
    • isPalette

      public boolean isPalette()
    • setPalette

      public void setPalette (boolean palette)
    • fixHeader

      public void fixHeader (int frameNumber, int totalFrames, String frameName, String companyName)
      Fix the header of the current frame
      Parameters:
      frameNumber - index of the frame in the animation
      totalFrames - total frames in the animation
      frameName - name of the frame
      companyName - name of the owner/program/company that owns or created the frame
    • setIldaFormat

      public void setIldaFormat (int versionNumber)
      Set the ilda version this frame uses. 0 = 3D, palette 1 = 2D, palette 4 = 3D, RGB 5 = 3D, RGB Internally, all frames are 3D and use RGB. This just stores the version number as a variable, so it can be resaved in the same format if required.
      Parameters:
      versionNumber - integer, can be 0, 1, 4 or 5
    • renderFrame

      public processing.core.PGraphics renderFrame (processing.core.PGraphics pg, boolean showBlanking, int sizex, int sizey, float rotx, float roty, float rotz)
      Renders the frame to a PGraphics to be displayed in the sketch. The PGraphics should be 3D a 2D version might get implemented You must call beginDraw() and endDraw() yourself!
      Parameters:
      pg - A reference to the PGraphics (it can't generate its own as this usually results in memory leaks)
      showBlanking - Should blanking lines be displayed?
      sizex - Size of the PGraphics element it returns
      sizey -
      rotx - Rotation of the frame
      roty -
      rotz -
      Returns:
      a PGraphics with the frame drawn
    • getPoints

      public List<IldaPoint> getPoints()
    • getCopyOnWritePoints

      public List<IldaPoint> getCopyOnWritePoints()
    • toString

      public String toString()
      Overrides:
      toString in class Object