美摄SDK For iOS
3.14.0
|
时间线字幕 更多...
#import <NvsCaption.h>
属性 | |
BOOL | isPanoramic |
是否为全景图字幕 更多... | |
BOOL | isModular |
当前字幕是否为模块字幕 更多... | |
NvsRoleInTheme | roleInTheme |
字幕在主题中的角色(通用、片头、片尾) 更多... | |
NvsCategory | category |
片段类型 更多... | |
NSString * | captionStylePackageId |
字幕样式包裹ID 更多... | |
NSString * | modularCaptionContextPackageId |
模块字幕环境样式包裹ID 更多... | |
NSString * | modularCaptionRendererPackageId |
模块字幕渲染样式包裹ID 更多... | |
NSString * | modularCaptionAnimationPackageId |
模块字幕循环动画样式包裹ID 更多... | |
NSString * | modularCaptionInAnimationPackageId |
模块字幕入动画样式包裹ID 更多... | |
NSString * | modularCaptionOutAnimationPackageId |
模块字幕出动画样式包裹ID 更多... | |
![]() | |
NvsFxDescription * | description |
特效描述 更多... | |
时间线字幕
字幕是视频上叠加的自定义文字。编辑视频时,可以添加和移除字幕,并对字幕位置进行调整处理。添加完字幕,还可以进行样式设置,包括字体大小,颜色,阴影,描边等。
- (bool) applyCaptionStyle: | (NSString *) | captionStylePackageId |
运用字幕样式
captionStylePackageId | 字幕样式资源包ID |
- (bool) applyCaptionStyleWithAssetDefaultParam: | (NSString *) | captionStylePackageId | |
isUseDefaultAssetParam: | (NvsAssetDefaultParam) | isUseDefaultAssetParam | |
运用字幕样式
captionStylePackageId | 字幕样式资源包ID |
isUseDefaultAssetParam | 是否使用默认素材参数 |
- (bool) applyModularCaptionAnimation: | (NSString *) | captionAnimationPackageId |
运用模块字幕循环动画样式包
captionAnimationPackageId | 字幕循环动画样式资源包ID |
- (bool) applyModularCaptionContext: | (NSString *) | captionContextPackageId |
运用模块字幕环境样式包
captionContextPackageId | 字幕环境样式资源包ID |
- (bool) applyModularCaptionInAnimation: | (NSString *) | captionInAnimationPackageId |
运用模块字幕入动画样式包。注意:如果已经应用了循环动画样式包,需要先把循环动画设置为null,否则不生效
captionInAnimationPackageId | 字幕入动画样式资源包ID |
- (bool) applyModularCaptionOutAnimation: | (NSString *) | captionOutAnimationPackageId |
运用模块字幕出动画样式包. 注意:如果已经应用了循环动画样式包,需要先把循环动画设置为null,否则不生效
captionOutAnimationPackageId | 字幕出动画样式资源包ID |
- (bool) applyModularCaptionRenderer: | (NSString *) | captionRendererPackageId |
运用模块字幕渲染样式包
captionRendererPackageId | 字幕渲染样式资源包ID |
- (CGPoint) getAnchorPoint |
- (NvsColor) getBackgroundColor |
- (float) getBackgroundRadius |
- (BOOL) getBold |
- (float) getBoundaryPaddingRatio |
获取字幕边界扩展比率
- (NSArray *) getBoundingRectangleVertices |
获取字幕的原始包围矩形框变换后的顶点位置
- (NSArray *) getCaptionBoundingVertices: | (NvsBoundingType) | boundingType |
获取字幕原始边框变换后的顶点位置
boundingType | 边框类型。请参见[边框类型] Bounding Type |
- (CGPoint) getCaptionTranslation |
- (float) getCenterAzimuthAngle |
获取字幕中心点的方位角。只对全景图字幕有效
- (float) getCenterPolarAngle |
获取字幕中心点的极角。只对全景图字幕有效
- (int) getComplexRenderLayerCount |
获取复杂字幕层数。
- (float) getComplexRenderLayerOpacity: | (int) | layerIndex |
获取复杂字幕某层字幕不透明度。
layerIndex | 字幕层数 |
- (NvsColor) getComplexRenderLayerOutlineColor: | (int) | layerIndex |
获取复杂字幕某层字幕描边颜色值。
layerIndex | 字幕层数 |
- (float) getComplexRenderLayerOutlineWidth: | (int) | layerIndex |
获取复杂字幕某层字幕描边宽度。
layerIndex | 字幕层数 |
- (NvsControlPointPair*) getControlPoint: | (NSString *) | fxParam |
返回关键帧控制点对
fxParam | 字幕参数的类型 |
- (BOOL) getDrawOutline |
- (BOOL) getDrawShadow |
- (NSString *) getFontFamily |
获取字幕字体
- (NSString *) getFontFilePath |
- (float) getFontSize |
- (BOOL) getItalic |
- (float) getLetterSpacing |
获取字幕字间距
- (NvsLetterSpacingType) getLetterSpacingType |
获取字幕字间距类型
- (float) getLineSpacing |
获取字幕行间距
- (int) getModularCaptionAnimationPeroid |
获取模块字幕循环动画的周期
- (int) getModularCaptionInAnimationDuration |
获取模块字幕入动画的时长
- (int) getModularCaptionOutAnimationDuration |
获取模块字幕出动画的时长
- (float) getOpacity |
- (float) getOrthoAngleRange |
获取字幕与极角垂直的张角。只对全景图字幕有效
- (NvsColor) getOutlineColor |
- (float) getOutlineWidth |
- (float) getPanoramicRotation |
获取字幕旋转角度。只对全景图字幕有效
- (float) getPanoramicScaleX |
获取字幕水平缩放系数。只对全景图字幕有效
- (float) getPanoramicScaleY |
获取字幕垂直缩放系数。只对全景图字幕有效
- (float) getPolarAngleRange |
获取字幕极角的张角。只对全景图字幕有效
- (float) getRotationZ |
- (float) getScaleX |
- (float) getScaleY |
- (NvsColor) getSecondaryColor |
获取字幕字体的当前第二个颜色值
- (NvsColor) getSecondaryOutlineColor |
获取字幕描边的第二个颜色值
- (NvsColor) getShadowColor |
- (float) getShadowFeather |
获取当前字幕阴影的羽化程度
- (CGPoint) getShadowOffset |
- (NSString *) getText |
- (NvsTextAlignment) getTextAlignment |
- (NvsRect) getTextBoundingRect |
获取字幕文本矩形框
- (float) getTextCenterAzimuthAngle |
获取字幕文本中心点的方位角。只对全景图字幕有效
- (float) getTextCenterPolarAngle |
获取字幕文本中心点的极角。只对全景图字幕有效
- (NvsColor) getTextColor |
- (NvsCaptionTextLayout *) getTextLayout |
获取字幕layout属性
- (float) getTextOrthoAngleRange |
获取字幕文本与极角垂直的张角。只对全景图字幕有效
- (float) getTextPolarAngleRange |
获取字幕文本极角的张角。只对全景图字幕有效
- (NSArray<NvsCaptionSpan *>*) getTextSpanList |
获取需要应用多种layout属性
- (NvsTextAlignment) getTextVerticalAlignment |
- (BOOL) getUnderline |
获取字幕下划线状态
- (BOOL) getVerticalLayout |
- (int) getWeight |
获取字幕权重值
- (float) getZValue |
- (BOOL) hasOutlineLayerInComplexRender: | (int) | layerIndex |
判断当前层是否有描边
layerIndex | 字幕层数 |
- (BOOL) isFrameCaption |
获取字幕是否是边框字幕
- (void) resetOutlineColorState |
重置字幕描边颜色状态
- (void) resetTextColorState |
重置字幕颜色状态
- (void) rotateCaption: | (float) | angle |
- (void) rotateCaption: | (float) | angle | |
anchor: | (CGPoint) | anchor | |
- (void) scaleCaption: | (float) | scaleFactor | |
anchor: | (CGPoint) | anchor | |
缩放字幕
scaleFactor | 字幕缩放的因子 |
anchor | 字幕缩放的锚点 |
- (void) setAnchorPoint: | (CGPoint) | anchor |
- (void) setBackgroundColor: | (const NvsColor *) | backgroundColor |
- (void) setBackgroundRadius: | (float) | radius |
- (void) setBold: | (BOOL) | bold |
- (void) setBoundaryPaddingRatio: | (float) | ratio |
- (void) setCaptionTranslation: | (CGPoint) | translation |
- (void) setCenterAzimuthAngle: | (float) | centerAzimuthAngle |
对字幕设置中心点的方位角。只对全景图字幕有效
centerAzimuthAngle | 中心点的方位角,单位为角度 注意: 注意:3.13.0以后默认不开启全景功能 |
- (void) setCenterPolarAngle: | (float) | centerPolarAngle |
对字幕设置中心点的极角。只对全景图字幕有效
centerPolarAngle | 中心点的极角,单位为角度 注意: 注意:3.13.0以后默认不开启全景功能 |
- (BOOL) setComplexRenderLayerOpacity: | (int) | layerIndex | |
opacity: | (float) | opacity | |
设置复杂字幕某层字幕不透明度。
layerIndex | 字幕层数 |
opacity | 不透明度 |
- (BOOL) setComplexRenderLayerOutlineColor: | (int) | layerIndex | |
color: | (NvsColor) | color | |
设置复杂字幕某层字幕描边颜色值。
layerIndex | 字幕层数 |
color | 颜色值 |
- (BOOL) setComplexRenderLayerOutlineWidth: | (int) | layerIndex | |
width: | (float) | width | |
设置复杂字幕某层字幕描边宽度。
layerIndex | 字幕层数 |
width | 描边宽度 |
- (bool) setControlPoint: | (NSString *) | fxParam | |
controlPointPair: | (NvsControlPointPair *) | controlPointPair | |
设置字幕的关键帧控制点对
fxParam | 字幕参数的类型 |
controlPointPair | 控制点对,设置控制点为{0, 0},即当前控制点为线性插值方式,否则为曲线插值方式 |
- (void) setCurrentKeyFrameTime: | (int64_t) | time |
设置字幕的关键帧时间
- (void) setDrawOutline: | (BOOL) | drawOutline |
- (void) setDrawShadow: | (BOOL) | drawShadow |
- (void) setFontFamily: | (NSString *) | family |
- (void) setFontSize: | (float) | fontSize |
- (void) setFontWithFilePath: | (NSString *) | filePath |
- (void) setFrameCaptionMaxFontSize: | (float) | maxFontSize |
设置边框字幕最大字体大小,只对边框型字幕有效果
- (void) setItalic: | (BOOL) | italic |
- (void) setLetterSpacing: | (float) | letterSpacing |
设置字幕字间距
letterSpacing | 字间距,类型默认百分比。(LETTER_SPACING_TYPE) |
- (void) setLetterSpacingType: | (NvsLetterSpacingType) | letterSpacingType |
- (void) setLineSpacing: | (float) | lineSpacing |
- (void) setModularCaptionAnimationPeroid: | (int) | periodInMS |
- (void) setModularCaptionInAnimationDuration: | (int) | inAnimationDurationInMS |
设置模块字幕入动画的时长
inAnimationDurationInMS | 入动画的时长,注意:单位是毫秒 |
- (void) setModularCaptionOutAnimationDuration: | (int) | outAnimationDurationInMS |
设置模块字幕出动画的时长
outAnimationDurationInMS | 出动画的时长,注意:单位是毫秒 |
- (void) setOpacity: | (float) | opacity |
- (void) setOutlineColor: | (const NvsColor *) | outlineColor |
- (void) setOutlineWidth: | (float) | outlineWidth |
- (void) setPanoramicRotation: | (float) | rotationAngle |
对字幕设置旋转角度。只对全景图字幕有效
rotationAngle | 旋转角度 注意: 注意:3.13.0以后默认不开启全景功能 |
- (void) setPanoramicScaleX: | (float) | scaleX |
对字幕设置水平缩放系数。只对全景图字幕有效
scaleX | 水平缩放系数 注意: 注意:3.13.0以后默认不开启全景功能 |
- (void) setPanoramicScaleY: | (float) | scaleY |
对字幕设置垂直缩放系数。只对全景图字幕有效
scaleY | 垂直缩放系数 注意: 注意:3.13.0以后默认不开启全景功能 |
- (void) setPolarAngleRange: | (float) | polarAngleRange |
对字幕设置极角的张角。只对全景图字幕有效
polarAngleRange | 极角的张角,单位为角度 注意: 注意:3.13.0以后默认不开启全景功能 |
- (void) setRecordingUserOperation: | (BOOL) | recordingUserOperation |
设置字幕是否记录用户的操作
recordingUserOperation | 字幕是否记录用户操作 |
- (void) setRotationZ: | (float) | angle |
- (void) setScaleX: | (float) | scale |
- (void) setScaleY: | (float) | scale |
- (void) setSecondaryColor: | (const NvsColor *) | color |
- (void) setSecondaryOutlineColor: | (const NvsColor *) | color |
- (void) setShadowColor: | (const NvsColor *) | shadowColor |
- (void) setShadowFeather: | (float) | feather |
- (void) setShadowOffset: | (CGPoint) | shadowOffset |
- (void) setText: | (NSString *) | text |
- (void) setTextAlignment: | (NvsTextAlignment) | textAlign |
- (void) setTextColor: | (const NvsColor *) | textColor |
- (void) setTextFrameOriginRect: | (NvsRect) | rc |
设置边框字幕的原始边框大小,如果当前字幕不是边框字幕,该函数没有效果. 可以通过getCaptionBoundingVertices中的BOUNDING_TYPE_TEXT_ORIGIN_FRAME获取原始边框大小
rc | 新的边框大小 |
- (void) setTextSpanList: | (NSArray< NvsCaptionSpan * > *) | storyboardCaptionSpanList |
用户可以指定字幕中位置从某一起始字符到某一结束字符之间,应用多种layout属性。
- (void) setTextVerticalAlignment: | (NvsTextAlignment) | textVerticalAlign |
设置字幕垂直对齐方式,仅边框型字幕有效
textVerticalAlign | 字幕垂直对齐方式 |
- (void) setUnderline: | (BOOL) | underline |
- (void) setVerticalLayout: | (BOOL) | verticalLayout |
- (void) setWeight: | (int) | weight |
- (void) setZValue: | (float) | value |
- (void) translateCaption: | (CGPoint) | translationOffset |
|
readatomicassign |
字幕样式包裹ID
|
readatomicassign |
片段类型
|
readatomicassign |
当前字幕是否为模块字幕
|
readatomicassign |
是否为全景图字幕
|
readatomicassign |
模块字幕循环动画样式包裹ID
|
readatomicassign |
模块字幕环境样式包裹ID
|
readatomicassign |
模块字幕入动画样式包裹ID
|
readatomicassign |
模块字幕出动画样式包裹ID
|
readatomicassign |
模块字幕渲染样式包裹ID
|
readatomicassign |
字幕在主题中的角色(通用、片头、片尾)