Defining the ARFilter interface

Given a source image, our previous filters just produced a destination image. Now, we also want to produce data about the pose (position and rotation) of something that may be visible in the source image. For OpenGL's purposes, a pose is expressed as an array of 16 floating point numbers, representing a 4 x 4 transformation matrix. Thus, we may define the ARFilter interface as follows:

public interface ARFilter extends Filter {
  public float[] getGLPose();
}

When the pose matrix is unknown, getGLPose() should return null.

The most basic implementation of the ARFilter interface is the NoneARFilter class. NoneARFilter does not actually find the pose matrix. Instead, the getGLPose() method always returns null, as we can see in the following code:

public class NoneARFilter extends NoneFilter implements ARFilter {
  @Override
  public float[] getGLPose() {
    return null;
  }
}

The NoneARFilter class, similar to its parent class NoneFilter, is just a convenient stand-in for other filters. We use NoneARFilter when we want to turn off filtering but still have an object that conforms to the ARFilter interface.