Interface HumanFaceFactory


public interface HumanFaceFactory
This class provides services that instantiates a human face.
  • Method Details

    • create

      static HumanFace create(File file, boolean loadLandmarks) throws IOException
      Reads a 3D human face from the given OBJ file.
      Parameters:
      file - OBJ file
      loadLandmarks - If true, then the constructor aims to load landmarks as well
      Throws:
      IOException - on I/O failure
    • create

      static HumanFace create(File file) throws IOException
      Reads a 3D human face from the given OBJ file.
      Parameters:
      file - OBJ file
      Throws:
      IOException - on I/O failure
    • create

      Recover human face from serialized dump file. As the dump file can contain additional objects, e.g., camera, it is supposed that the given input stream is set to a human face object.
      Parameters:
      in - A dump file as object input stream
      Returns:
      The instance of the human face
      Throws:
      IOException - If reading fails
      ClassNotFoundException - If there is no human face in the stream
    • create

      static HumanFace create(String name, MeshModel model, boolean isAverageFace)
      Creates a human face from existing mesh model. The mesh model is stored directly (not copied).
      Parameters:
      name - Name of created human face
      model - Mesh model
      Throws:
      IllegalArgumentException - if the model is null
    • save

      static void save(HumanFace face, File file) throws IOException
      Save face data by rewriting existing files!
      Parameters:
      face - Face
      Throws:
      IOException - on IO error
    • saveAs

      static void saveAs(HumanFace face, File file) throws IOException
      Save face by writing the data into a new files.
      Parameters:
      face - Face
      file - Basic file name without suffixes
      Throws:
      IOException - on IO error, especially if the files already exist