HVTView Class Reference

Inherits from UIView
Declared in HVTView.h

Overview

HVTView is a subclass of UIView that you use to preview video as it is being captured by HVTCamera.

Being a subclass of UIKit’s UIView, it inherits all the properties of this class and extends its functionality. You can create an HVTView by using the Interface Builder (and setting the class property to HVTView) or by instantiating it programmatically with initWithCoder: and initWithFrame: methods.

You use this view in conjunction with an HVTCamera instance, as illustrated in the following code fragment:

HVTcamera *camera = [HVTcamera new];
HVTView *view = // an instance of HVTView created programmatically or in the Interface Builder
[camera addView:view];

The view’s orientation is derived by the HVTCamera it is attached to. So, make sure the [HVTCamera interfaceOrientation] property matches your app’s interface orientation.

You can use the fillMode property to influence how the video preview is displayed relative to the view’s bounds. You can use the showHUD property if you want the crop region to be displayed or not.

Configuration

  viewType

Specifies the preview type of the view.

@property (nonatomic) HVTViewType viewType

Discussion

When set to HVTViewTypeNormal, HUD elements can be displayed depending on the showHUD property.

The default value, HVTViewTypeNormal is best suited for most applications.

See Also

Declared In

HVTView.h

  watermarkPosition

Specifies the position of the Horizon watermark on the view.

@property (nonatomic) HVTViewWatermarkPosition watermarkPosition

Discussion

The default value, HVTViewWatermarkPositionBottomRight places the watermark in the bottom right corner of the HVTView.

Declared In

HVTView.h

  enabled

Specifies whether the view is enabled or not.

@property (nonatomic) BOOL enabled

Discussion

Enabled means that the rendering takes place and disabled is when rendering is not active for this view.

Use this property to manually stop the renderning to a specific view for certain cases (e.g. use in a UICollectionViewCell)

Declared In

HVTView.h

  filter

Specifies the active filter for this view.

@property (nonatomic) CIFilter *filter

Discussion

You can use the predefined filters provided by Core Image library or add your own custom CIKernels.

Declared In

HVTView.h

  showHUD

Specifies whether HUD elements, such as the crop region and corners, are shown.

@property (nonatomic) BOOL showHUD

Discussion

This property applies only when viewType is set to HVTViewTypeNormal.

The default value is YES.

Declared In

HVTView.h

  fillMode

Specifies how the video preview is displayed within the view’s bounds rect.

@property (nonatomic) HVTViewFillMode fillMode

Discussion

A common usage scenario is to toggle the fill mode when the user double taps the view.

The property in animated.

The default value is HVTViewFillModeAspectFit.

See Also

Declared In

HVTView.h

  focusViewColor

Assigns the color to the circle that is being displayed when the user tries to focus in a point of the HVTView.

@property (nonatomic) UIColor *focusViewColor

Discussion

The default color is white .

Declared In

HVTView.h

  focusViewBorderWidth

Assigns the border width to the circle that is being displayed when the user tries to focus in a point of the HVTView.

@property (nonatomic) CGFloat focusViewBorderWidth

Discussion

The default border width is 1.0

Declared In

HVTView.h

  cropRegionTintColor

Sets and returns the tint color for the dark area of the crop region.

@property (nonatomic) UIColor *cropRegionTintColor

Discussion

The RGB values of this color will be multiplied with the video. The alpha value is not used. For example set it to [UIColor grayColor] for a dark look.

The default color is (0.5f, 0.5f, 0.5f, 1.0f).

Declared In

HVTView.h

  enablesDoubleTapToChangeFillMode

Controls if the view will include a double tap gesture to cycle through the different fill modes available.

@property (nonatomic, getter=isDoubleTapToChangeFillModeEnabled) BOOL enablesDoubleTapToChangeFillMode

Discussion

The default value is NO.

See Also

Declared In

HVTView.h

  enablesTapToFocus

Controls if the view will include a tap to focus gesture.

@property (nonatomic, getter=isTapToFocusEnabled) BOOL enablesTapToFocus

Discussion

The default value is NO.

Declared In

HVTView.h

  enablesLongPressToLockFocusExposure

Controls if the view will include a long press to lock focus and exposure gesture.

@property (nonatomic, getter=isLongPressToLockFocusExposureEnabled) BOOL enablesLongPressToLockFocusExposure

Discussion

The default value is NO.

Declared In

HVTView.h