# getHat method

int getHat()

Gets the value indicating whether the subject wears a hat. -1 if not computed. The range is 0-100, 100 meaning a hat is detected.

return Value indicating whether the subject wears a hat. -1 if not computed. The range is 0-100, 100 meaning a hat is detected. throws FaceException An error has occurred during Face Library execution.

## Implementation

    int getHat() {
      Pointer<Int> pHat = calloc();
      try {
        var err = faceSDK.id3FacePortrait_GetHat(_pHandle.value, pHat);
        if (err != FaceError.success.value) {
          throw FaceException(err);
        }
        final vHat = pHat.value;
        return vHat;
      } finally {
        calloc.free(pHat);
      }
    }