
/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by codegen project: GeneratePropsCpp.js
 */

#include <react/renderer/components/NativeCameraKitSpec/Props.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/propsConversions.h>

namespace facebook::react {

CKCameraProps::CKCameraProps(
    const PropsParserContext &context,
    const CKCameraProps &sourceProps,
    const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),

    flashMode(convertRawProp(context, rawProps, "flashMode", sourceProps.flashMode, {})),
    focusMode(convertRawProp(context, rawProps, "focusMode", sourceProps.focusMode, {})),
    maxPhotoQualityPrioritization(convertRawProp(context, rawProps, "maxPhotoQualityPrioritization", sourceProps.maxPhotoQualityPrioritization, {})),
    zoomMode(convertRawProp(context, rawProps, "zoomMode", sourceProps.zoomMode, {})),
    zoom(convertRawProp(context, rawProps, "zoom", sourceProps.zoom, {-1.0})),
    maxZoom(convertRawProp(context, rawProps, "maxZoom", sourceProps.maxZoom, {-1.0})),
    torchMode(convertRawProp(context, rawProps, "torchMode", sourceProps.torchMode, {})),
    cameraType(convertRawProp(context, rawProps, "cameraType", sourceProps.cameraType, {})),
    scanBarcode(convertRawProp(context, rawProps, "scanBarcode", sourceProps.scanBarcode, {false})),
    showFrame(convertRawProp(context, rawProps, "showFrame", sourceProps.showFrame, {false})),
    laserColor(convertRawProp(context, rawProps, "laserColor", sourceProps.laserColor, {})),
    frameColor(convertRawProp(context, rawProps, "frameColor", sourceProps.frameColor, {})),
    ratioOverlay(convertRawProp(context, rawProps, "ratioOverlay", sourceProps.ratioOverlay, {})),
    ratioOverlayColor(convertRawProp(context, rawProps, "ratioOverlayColor", sourceProps.ratioOverlayColor, {})),
    resetFocusTimeout(convertRawProp(context, rawProps, "resetFocusTimeout", sourceProps.resetFocusTimeout, {-1})),
    resetFocusWhenMotionDetected(convertRawProp(context, rawProps, "resetFocusWhenMotionDetected", sourceProps.resetFocusWhenMotionDetected, {false})),
    resizeMode(convertRawProp(context, rawProps, "resizeMode", sourceProps.resizeMode, {})),
    scanThrottleDelay(convertRawProp(context, rawProps, "scanThrottleDelay", sourceProps.scanThrottleDelay, {-1})),
    iOsDeferredStart(convertRawProp(context, rawProps, "iOsDeferredStart", sourceProps.iOsDeferredStart, {false})),
    barcodeFrameSize(convertRawProp(context, rawProps, "barcodeFrameSize", sourceProps.barcodeFrameSize, {})),
    shutterPhotoSound(convertRawProp(context, rawProps, "shutterPhotoSound", sourceProps.shutterPhotoSound, {false})),
    allowedBarcodeTypes(convertRawProp(context, rawProps, "allowedBarcodeTypes", sourceProps.allowedBarcodeTypes, {})),
    shutterAnimationDuration(convertRawProp(context, rawProps, "shutterAnimationDuration", sourceProps.shutterAnimationDuration, {-1})),
    outputPath(convertRawProp(context, rawProps, "outputPath", sourceProps.outputPath, {})) {}
    
#ifdef RN_SERIALIZABLE_STATE
ComponentName CKCameraProps::getDiffPropsImplementationTarget() const {
  return "CKCamera";
}

folly::dynamic CKCameraProps::getDiffProps(
    const Props* prevProps) const {
  static const auto defaultProps = CKCameraProps();
  const CKCameraProps* oldProps = prevProps == nullptr
      ? &defaultProps
      : static_cast<const CKCameraProps*>(prevProps);
  if (this == oldProps) {
    return folly::dynamic::object();
  }
  folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
  
  if (flashMode != oldProps->flashMode) {
    result["flashMode"] = flashMode;
  }
    
  if (focusMode != oldProps->focusMode) {
    result["focusMode"] = focusMode;
  }
    
  if (maxPhotoQualityPrioritization != oldProps->maxPhotoQualityPrioritization) {
    result["maxPhotoQualityPrioritization"] = maxPhotoQualityPrioritization;
  }
    
  if (zoomMode != oldProps->zoomMode) {
    result["zoomMode"] = zoomMode;
  }
    
  if ((zoom != oldProps->zoom) && !(std::isnan(zoom) && std::isnan(oldProps->zoom))) {
    result["zoom"] = zoom;
  }
    
  if ((maxZoom != oldProps->maxZoom) && !(std::isnan(maxZoom) && std::isnan(oldProps->maxZoom))) {
    result["maxZoom"] = maxZoom;
  }
    
  if (torchMode != oldProps->torchMode) {
    result["torchMode"] = torchMode;
  }
    
  if (cameraType != oldProps->cameraType) {
    result["cameraType"] = cameraType;
  }
    
  if (scanBarcode != oldProps->scanBarcode) {
    result["scanBarcode"] = scanBarcode;
  }
    
  if (showFrame != oldProps->showFrame) {
    result["showFrame"] = showFrame;
  }
    
  if (laserColor != oldProps->laserColor) {
    result["laserColor"] = *laserColor;
  }
    
  if (frameColor != oldProps->frameColor) {
    result["frameColor"] = *frameColor;
  }
    
  if (ratioOverlay != oldProps->ratioOverlay) {
    result["ratioOverlay"] = ratioOverlay;
  }
    
  if (ratioOverlayColor != oldProps->ratioOverlayColor) {
    result["ratioOverlayColor"] = *ratioOverlayColor;
  }
    
  if (resetFocusTimeout != oldProps->resetFocusTimeout) {
    result["resetFocusTimeout"] = resetFocusTimeout;
  }
    
  if (resetFocusWhenMotionDetected != oldProps->resetFocusWhenMotionDetected) {
    result["resetFocusWhenMotionDetected"] = resetFocusWhenMotionDetected;
  }
    
  if (resizeMode != oldProps->resizeMode) {
    result["resizeMode"] = resizeMode;
  }
    
  if (scanThrottleDelay != oldProps->scanThrottleDelay) {
    result["scanThrottleDelay"] = scanThrottleDelay;
  }
    
  if (iOsDeferredStart != oldProps->iOsDeferredStart) {
    result["iOsDeferredStart"] = iOsDeferredStart;
  }
    
  if (barcodeFrameSize != oldProps->barcodeFrameSize) {
    result["barcodeFrameSize"] = toDynamic(barcodeFrameSize);
  }
    
  if (shutterPhotoSound != oldProps->shutterPhotoSound) {
    result["shutterPhotoSound"] = shutterPhotoSound;
  }
    
  if (allowedBarcodeTypes != oldProps->allowedBarcodeTypes) {
    result["allowedBarcodeTypes"] = toDynamic(allowedBarcodeTypes);
  }
    
  if (shutterAnimationDuration != oldProps->shutterAnimationDuration) {
    result["shutterAnimationDuration"] = shutterAnimationDuration;
  }
    
  if (outputPath != oldProps->outputPath) {
    result["outputPath"] = outputPath;
  }
  return result;
}
#endif

} // namespace facebook::react
