Class FinderPattern


  • public final class FinderPattern
    extends ResultPoint

    Encapsulates a finder pattern, which are the three square patterns found in the corners of QR Codes. It also encapsulates a count of similar finder patterns, as a convenience to the finder's bookkeeping.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      (package private) FinderPattern​(float posX, float posY, float estimatedModuleSize)  
      private FinderPattern​(float posX, float posY, float estimatedModuleSize, int count)  
    • Field Detail

      • estimatedModuleSize

        private final float estimatedModuleSize
      • count

        private final int count
    • Constructor Detail

      • FinderPattern

        FinderPattern​(float posX,
                      float posY,
                      float estimatedModuleSize)
      • FinderPattern

        private FinderPattern​(float posX,
                              float posY,
                              float estimatedModuleSize,
                              int count)
    • Method Detail

      • getEstimatedModuleSize

        public float getEstimatedModuleSize()
      • getCount

        public int getCount()
      • aboutEquals

        boolean aboutEquals​(float moduleSize,
                            float i,
                            float j)

        Determines if this finder pattern "about equals" a finder pattern at the stated position and size -- meaning, it is at nearly the same center with nearly the same size.

      • combineEstimate

        FinderPattern combineEstimate​(float i,
                                      float j,
                                      float newModuleSize)
        Combines this object's current estimate of a finder pattern position and module size with a new estimate. It returns a new FinderPattern containing a weighted average based on count.