Download Winsoft Camera for iOS v1.7 Full Source for Delphi/C++ Builder 10 - 11

Winsoft Camera for iOS v1.7 Full Source for Delphi/C++ Builder 10 - 11

Winsoft Camera for iOS v1.7 Full Source for Delphi/C++ Builder 10 - 11
Winsoft Camera for iOS v1.7 Full Source for Delphi/C++ Builder 10 - 11


Delphi and C++ Builder camera component for iOS.

Features

Uses AVFoundation framework
Supports native video preview
Supports barcode detection (EAN, QR Code, Data Matrix, Aztec, UPC-E, PDF417, ITF 14, ...)
Supports face detection
Supports human, dog and cat detection
Available for Delphi/C++ Builder 10 - 11
Source code included in registered version
Royalty free distribution in applications

type
  TICameraError = record
    property Code: LongInt read;
    property Domain: string read;
    property Error: NSError read;
    property IsError: Boolean read;
    property LocalizedDescription: string read;
  end;

  EICameraError = class(Exception)
  end;

  EICameraOSError = class(EICameraError)
    constructor Create(Error: NSError);
    property Error: TICameraError read;
  end;

  TICameraAuthorizationStatus = (NotDetermined, Restricted, Denied, Authorized);

  TICameraColorSpace = (Unknown, sRGB, P3_D65, HLG_BT2020);

  TICameraExposureMode = (Unknown, Locked, AutoExpose, ContinuousAutoExposure);

  TICameraFocusMode = (Unknown, Locked, AutoFocus, ContinuousAutoFocus);

  TICameraFlashMode = (Unknown, Off, On, Auto);

  TICameraTorchMode = (Unknown, Off, On, Auto);

  TICameraWhiteBalanceMode = (Unknown, Locked, AutoWhiteBalance, ContinuousAutoWhiteBalance);

  TICameraPosition = (Unknown, Back, Front);

  TICameraAspectRatio = (Unknown, Fit, Fill, Resize);

  TICameraRangeRestriction = (Unknown, None, Near, Far);

  TICameraSmoothAutoFocus = (Unknown, Off, On);

  TICameraVideoMirrored = (Unknown, Off, On);

  TICameraVideoOrientation = (Unknown, Portrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight);

  TICameraSymbology = (Unknown, Aztec, Code128, Code39, Code39Mod43, Code93,
   DataMatrix, Ean13, Ean8, Interleaved2of5, Itf14, Pdf417, QRCode, Upce);

  TICameraSymbologies = set of TICameraSymbology;

  TICameraBarcode = record
    Symbology: TICameraSymbology;
    Bounds: TRectF;
    Text: string;
  end;

  TICameraBarcodeDetectedEvent = procedure(Sender: TObject; const Barcode: TICameraBarcode) of object;

  TICameraFace = record
    Bounds: TRectF;
    FaceID: Integer;
    HasRollAngle: Boolean;
    RollAngle: Double;
    HasYawAngle: Boolean;
    YawAngle: Double;
  end;

  TICameraFaceDetectedEvent = procedure(Sender: TObject; const Face: TICameraFace) of object;

  TICameraBody = record
    Bounds: TRectF;
    BodyID: Integer;
  end;

  TICameraBodyDetectedEvent = procedure(Sender: TObject; const Body: TICameraBody) of object;

  TICameraFrameRate = record
    Max: Double;
    Min: Double;
  end;

  TICameraCaptureFormat = record
    property Binned: Boolean read;
    property FieldOfView: Single read;
    property Format: AVCaptureDeviceFormat read;
    property FrameRates: TArray<TICameraFrameRate> read;
    property MaxZoom: Double read;
    property MediaSubType: string read;
    property MediaType: string read;
    property Size: TSize read;
    property Stabilization: Boolean read;
    property Upscale: Double read;
  end;

  TICameraCaptureDevice = record
    property ActiveFormat: TICameraCaptureFormat read;
    property Device: AVCaptureDevice read;
    property Formats: TArray<TICameraCaptureFormat> read;
    property Model: string read;
    property Name: string read;
    property Position: TICameraPosition read;
    property UniqueID: string read;
  end;

  TICameraAuthorizationEvent = procedure(Sender: TObject; Granted: Boolean) of object;

  TICamera = class(TComponent)
    constructor Create(AOwner: TComponent);
    procedure CancelVideoZoomRamp;
    function IsExposureModeSupported(ExposureMode: TICameraExposureMode): Boolean;
    function IsFlashModeSupported(FlashMode: TICameraFlashMode): Boolean;
    function IsFocusModeSupported(FocusMode: TICameraFocusMode): Boolean;
    function IsTorchModeSupported(TorchMode: TICameraTorchMode): Boolean;
    function IsWhiteBalanceModeSupported(WhiteBalanceMode: TICameraWhiteBalanceMode): Boolean;
    procedure RampToVideoZoomFactor(Factor: Double; Rate: Single = 1.0);
    procedure RequestAccess;
    function SampleBufferToBitmap(const Bitmap: TBitmap; const SetSize: Boolean): Boolean;
    procedure Start;
    procedure Stop;

    property ActiveColorSpace: TICameraColorSpace read write;
    property ActiveFormat: TICameraCaptureFormat read write;
    property CaptureMetadataOutput: AVCaptureMetadataOutput read;
    property CaptureVideoDevices: TArray<TICameraCaptureDevice> read;
    property DefaultCaptureVideoDevice: TICameraCaptureDevice read;
    property Device: AVCaptureDevice read write;
    property DeviceInput: AVCaptureDeviceInput read;
    property DeviceName: string read;
    property ExposurePointOfInterest: TPointF read write;
    property ExposureTargetBias: Single read write;
    property ExposureTargetOffset: Single read;
    property FocusPointOfInterest: TPointF read write;
    property Formats: TArray<TICameraCaptureFormat> read;
    property HasFlash: Boolean read;
    property HasTorch: Boolean read;
    property IsAdjustingExposure: Boolean read;
    property IsAdjustingFocus: Boolean read;
    property IsAdjustingWhiteBalance: Boolean read;
    property IsAutoFocusRangeRestrictionSupported: Boolean read;
    property IsConnected: Boolean read;
    property IsExposurePointOfInterestSupported: Boolean read;
    property IsFlashAvailable: Boolean read;
    property IsFocusPointOfInterestSupported: Boolean read;
    property IsLowLightBoostEnabled: Boolean read;
    property IsLowLightBoostSupported: Boolean read;
    property Iso: Single read write;
    property IsSmoothAutoFocusEnabled: Boolean read;
    property IsPreviewMirroringSupported: Boolean read;
    property IsPreviewOrientationSupported: Boolean read;
    property IsRampingVideoZoom: Boolean read;
    property IsRunning: Boolean read;
    property IsSmoothAutoFocusSupported: Boolean read;
    property IsTorchActive: Boolean read;
    property IsTorchAvailable: Boolean read;
    property IsVideoHdrEnabled: Boolean read write;
    property IsVideoMirroringSupported: Boolean read;
    property IsVideoOrientationSupported: Boolean read;
    property LensAperture: Single read;
    property LensPosition: Single read;
    property Manufacturer: string read;
    property MaxAvailableTorchLevel: Single read;
    property MaxAvailableVideoZoomFactor: Double read;
    property MaxExposureTargetBias: Single read;
    property MaxFrameRate: Double read write;
    property MaxWhiteBalanceGain: Single read;
    property MinAvailableVideoZoomFactor: Double read;
    property MinExposureTargetBias: Single read;
    property MinFrameRate: Double read write;
    property Model: string read;
    property Position: TICameraPosition read;
    property SampleBuffer: CMSampleBufferRef read;
    property Session: AVCaptureSession read;
    property TorchLevel: Single read;
    property UniqueID: string read;
    property VideoDataOutput: AVCaptureVideoDataOutput read;
    property VideoDataOutputConnection: AVCaptureConnection read;
    property VideoPreviewLayer: AVCaptureVideoPreviewLayer read;
    property VideoZoomFactor: Double read write;
    property View: UIView read;
  published
    property About: string read write stored False;
    property Active: Boolean read write default False;
    property AutoFocusRangeRestriction: TICameraRangeRestriction read write default Unknown;
    property ExposureMode: TICameraExposureMode read write default Unknown;
    property FlashMode: TICameraFlashMode read write default Unknown;
    property FocusMode: TICameraFocusMode read write default Unknown;
    property Preview: Boolean read write default False;
    property PreviewAspectRatio: TICameraAspectRatio read write default Unknown;
    property PreviewAutoMirroring: TICameraVideoMirrored read write default Unknown;
    property PreviewFrame: TBounds read write;
    property PreviewMirrored: TICameraVideoMirrored read write default Unknown;
    property PreviewOrientation: TICameraVideoOrientation read write default Unknown;
    property RectOfInterest: TRectF read write;
    property SmoothAutoFocus: TICameraSmoothAutoFocus read write default Unknown;
    property Symbologies: TICameraSymbologies read write default
      [Unknown, Aztec, Code128, Code39, Code39Mod43, Code93, DataMatrix,
       Ean13, Ean8, Interleaved2of5, Itf14, Pdf417, QRCode, Upce];
    property TorchMode: TICameraTorchMode read write default Unknown;
    property VideoMirrored: TICameraVideoMirrored read write default Unknown;
    property VideoOrientation: TICameraVideoOrientation read write default Unknown;
    property WhiteBalanceMode: TICameraWhiteBalanceMode read write default Unknown;

    property OnAuthorization: TICameraAuthorizationEvent read write;
    property OnBarcodeDetected: TICameraBarcodeDetectedEvent read write;
    property OnCatDetected: TICameraBodyDetectedEvent read write;
    property OnDogDetected: TICameraBodyDetectedEvent read write;
    property OnFaceDetected: TICameraFaceDetectedEvent read write;
    property OnHumanDetected: TICameraBodyDetectedEvent read write;
    property OnSampleBufferReady: TNotifyEvent read write;
  end;


What's new

Version 1.7

added Delphi/C++ Builder 11 files


Only for V.I.P
Warning! You are not allowed to view this text.
  • 15