美摄SDK For iOS  3.7.2
NvsVideoEffectCaption.h
浏览该文件的文档.
1 //================================================================================
2 //
3 // (c) Copyright China Digital Video (Beijing) Limited, 2016. All rights reserved.
4 //
5 // This code and information is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the implied
7 // warranties of merchantability and/or fitness for a particular purpose.
8 //
9 //--------------------------------------------------------------------------------
10 // Birth Date: Jan 29. 2021
11 // Author: NewAuto video team
12 //================================================================================
13 #pragma once
14 
15 #import "NvsEffect.h"
16 #import <CoreGraphics/CGGeometry.h>
17 
26 {
31 
39 {
44 
52 {
60 
68 {
72 
82 typedef enum
83 {
90 
98 {
102 
103 
104 
119 
120 @property (readonly) BOOL isPanoramic;
121 @property (readonly) BOOL isModular;
122 @property (nonatomic) BOOL clipAffinityEnabled;
123 @property (readonly) int64_t inPoint;
124 @property (readonly) int64_t outPoint;
126 @property (readonly) NvsVideoEffectCategory category;
127 @property (readonly) NSString* captionStylePackageId;
128 @property (readonly) NSString* modularCaptionContextPackageId;
129 @property (readonly) NSString* modularCaptionRendererPackageId;
130 @property (readonly) NSString* modularCaptionAnimationPackageId;
131 @property (readonly) NSString* modularCaptionInAnimationPackageId;
132 @property (readonly) NSString* modularCaptionOutAnimationPackageId;
133 
143 - (void)setVideoResolution:(NvsEffectVideoResolution)resolution;
144 
159 - (int64_t)changeInPoint:(int64_t)newInPoint;
160 
175 - (int64_t)changeOutPoint:(int64_t)newOutPoint;
176 
189 - (void)movePosition:(int64_t)offset;
190 
203 -(bool) applyCaptionStyle:(NSString*) captionStylePackageId;
204 
219 -(bool) applyModularCaptionContext:(NSString*) captionContextPackageId;
220 
235 -(bool) applyModularCaptionRenderer:(NSString*) captionRendererPackageId;
236 
251 -(bool) applyModularCaptionAnimation:(NSString*) captionAnimationPackageId;
252 
267 -(bool) applyModularCaptionInAnimation:(NSString*) captionInAnimationPackageId;
268 
283 -(bool) applyModularCaptionOutAnimation:(NSString*) captionOutAnimationPackageId;
284 
295 -(void) setModularCaptionAnimationPeroid:(int)periodInMS;
296 
308 
319 -(void) setModularCaptionInAnimationDuration:(int)inAnimationDurationInMS;
320 
332 
343 -(void) setModularCaptionOutAnimationDuration:(int)outAnimationDurationInMS;
344 
356 
371 -(bool) applyCaptionStyleWithAssetDefaultParam:(NSString*) captionStylePackageId isUseDefaultAssetParam:(NvsVideoEffectAssetDefaultParam)isUseDefaultAssetParam;
372 
382 - (void)setText:(NSString *)text;
383 
393 - (NSString *)getText;
394 
404 - (void)setVerticalLayout:(BOOL)verticalLayout;
405 
415 - (BOOL)getVerticalLayout;
416 
427 - (void)setTextAlignment:(NvsVideoEffectTextAlignment)textAlign;
428 
439 
451 - (void)setTextVerticalAlignment:(NvsVideoEffectTextAlignment)textVerticalAlign;
452 
464 
474 - (void)setBold:(BOOL)bold;
475 
485 - (BOOL)getBold;
486 
496 - (void)setWeight:(int)weight;
497 
507 - (int)getWeight;
508 
518 - (void)setItalic:(BOOL)italic;
519 
529 - (BOOL)getItalic;
530 
540 - (void)setUnderline:(BOOL)underline;
541 
551 - (BOOL)getUnderline;
552 
564 - (float)getLetterSpacing;
565 
577 - (void)setLetterSpacing:(float)letterSpacing;
578 
590 
601 - (void)setLetterSpacingType:(NvsVideoEffectLetterSpacingType)letterSpacingType;
602 
613 - (float)getLineSpacing;
614 
625 - (void)setLineSpacing:(float)lineSpacing;
626 
627 
637 - (void)setTextColor:(const NvsEffectColor *)textColor;
638 
649 
659 - (void)setDrawOutline:(BOOL)drawOutline;
660 
670 - (BOOL)getDrawOutline;
671 
681 - (void)setOutlineColor:(const NvsEffectColor *)outlineColor;
682 
693 
703 - (void)setOutlineWidth:(float)outlineWidth;
704 
714 - (float)getOutlineWidth;
715 
725 - (void)setDrawShadow:(BOOL)drawShadow;
726 
736 - (BOOL)getDrawShadow;
737 
747 - (void)setShadowColor:(const NvsEffectColor *)shadowColor;
748 
759 
769 - (void)setShadowOffset:(CGPoint)shadowOffset;
770 
780 - (CGPoint)getShadowOffset;
781 
791 - (void)setShadowFeather:(float)feather;
792 
802 - (float)getShadowFeather;
803 
813 - (void)setFontSize:(float)fontSize;
814 
824 - (float)getFontSize;
825 
833 - (void)setFrameCaptionMaxFontSize:(float)maxFontSize;
834 
845 - (void)setFontWithFilePath:(NSString *)filePath;
846 
857 - (NSString *)getFontFilePath;
858 
867 - (NSString *)getFontFamily;
868 
879 - (void)setFontFamily:(NSString *)family;
880 
891 - (void)setCaptionTranslation:(CGPoint)translation;
892 
902 - (CGPoint)getCaptionTranslation;
903 
915 - (void)translateCaption:(CGPoint)translationOffset;
916 
927 - (void)setAnchorPoint:(CGPoint)anchor;
928 
939 - (CGPoint)getAnchorPoint;
940 
952 - (void)setScaleX:(float)scale;
953 
965 - (float)getScaleX;
966 
978 - (void)setScaleY:(float)scale;
979 
991 - (float)getScaleY;
992 
1004 - (void)scaleCaption:(float)scaleFactor anchor:(CGPoint)anchor;
1005 
1016 - (void)setRotationZ:(float)angle;
1017 
1028 - (float)getRotationZ;
1029 
1042 - (void)rotateCaption:(float)angle anchor:(CGPoint)anchor;
1043 
1054 - (void)rotateCaption:(float)angle;
1055 
1066 - (void)setTextFrameOriginRect:(NvsEffectRect)rc;
1067 
1076 - (NvsEffectRect)getTextBoundingRect:(BOOL)actualBoundingRect;
1077 
1089 - (NSArray *)getCaptionBoundingVertices:(NvsVideoEffectBoundingType)boundingType;
1090 
1100 - (void)setCenterPolarAngle:(float)centerPolarAngle;
1101 
1111 - (float)getCenterPolarAngle;
1112 
1122 - (float)getTextCenterPolarAngle;
1123 
1133 - (void)setCenterAzimuthAngle:(float)centerAzimuthAngle;
1134 
1145 - (float)getCenterAzimuthAngle;
1146 
1156 - (float)getTextCenterAzimuthAngle;
1157 
1167 - (void)setPolarAngleRange:(float)polarAngleRange;
1168 
1178 - (float)getPolarAngleRange;
1179 
1189 - (float)getTextPolarAngleRange;
1190 
1200 - (float)getOrthoAngleRange;
1201 
1211 - (float)getTextOrthoAngleRange;
1212 
1222 - (void)setPanoramicScaleX:(float)scaleX;
1223 
1233 - (float)getPanoramicScaleX;
1234 
1244 - (void)setPanoramicScaleY:(float)scaleY;
1245 
1255 - (float)getPanoramicScaleY;
1256 
1266 - (void)setPanoramicRotation:(float)rotationAngle;
1267 
1277 - (float)getPanoramicRotation;
1278 
1288 - (void)setZValue:(float)value;
1289 
1299 - (float)getZValue;
1300 
1310 - (void)setRecordingUserOperation:(BOOL)recordingUserOperation;
1311 
1321 - (void)setOpacity:(float)opacity;
1322 
1332 - (float)getOpacity;
1333 
1344 - (void)setBackgroundColor:(const NvsEffectColor *)backgroundColor;
1345 
1357 
1368 - (void)setBackgroundRadius:(float)radius;
1369 
1380 - (float)getBackgroundRadius;
1381 
1392 - (void)setSecondaryColor:(const NvsEffectColor *)color;
1393 
1405 
1414 - (void)setCurrentKeyFrameTime:(int64_t)time;
1415 
1425 - (BOOL)isFrameCaption;
1426 
1427 @end
NvsVideoEffectCaption::clipAffinityEnabled
BOOL clipAffinityEnabled
是否开启与clip的亲和关系
Definition: NvsVideoEffectCaption.h:122
-[NvsVideoEffectCaption getOpacity]
float getOpacity()
获取字幕透明度
-[NvsVideoEffectCaption getCenterAzimuthAngle]
float getCenterAzimuthAngle()
获取字幕中心点的方位角。只对全景图字幕有效
-[NvsVideoEffectCaption getOutlineColor]
NvsEffectColor getOutlineColor()
获取当前字幕描边的颜色值
-[NvsVideoEffectCaption isFrameCaption]
BOOL isFrameCaption()
获取字幕是否是边框字幕
-[NvsVideoEffectCaption getRotationZ]
float getRotationZ()
获取字幕旋转角度
-[NvsVideoEffectCaption getTextAlignment]
NvsVideoEffectTextAlignment getTextAlignment()
获取字幕水平对齐方式
-[NvsVideoEffectCaption getCenterPolarAngle]
float getCenterPolarAngle()
获取字幕中心点的极角。只对全景图字幕有效
NvsVideoEffectCategory
NvsVideoEffectCategory
Definition: NvsVideoEffectCaption.h:26
NvsEffectRect
矩形
Definition: NvsEffectCommonDef.h:120
NvsVideoEffectLetterSpacingTypePercentage
@ NvsVideoEffectLetterSpacingTypePercentage
Definition: NvsVideoEffectCaption.h:99
NvsVideoEffectCaption::isPanoramic
BOOL isPanoramic
是否为全景图字幕
Definition: NvsVideoEffectCaption.h:120
-[NvsVideoEffectCaption getShadowFeather]
float getShadowFeather()
获取当前字幕阴影的羽化程度
-[NvsVideoEffectCaption getZValue]
float getZValue()
获取字幕Z值。
-[NvsVideoEffectCaption getAnchorPoint]
CGPoint getAnchorPoint()
获取字幕锚点
-[NvsVideoEffectCaption getBackgroundRadius]
float getBackgroundRadius()
获取字幕文本的当前背景框的圆角半径
NvsVideoEffectCaption
字幕
Definition: NvsVideoEffectCaption.h:119
-[NvsVideoEffectCaption getTextCenterPolarAngle]
float getTextCenterPolarAngle()
获取字幕文本中心点的极角。只对全景图字幕有效
-[NvsVideoEffectCaption getPanoramicRotation]
float getPanoramicRotation()
获取字幕旋转角度。只对全景图字幕有效
NvsVideoEffectTextAlignmentTop
@ NvsVideoEffectTextAlignmentTop
Definition: NvsVideoEffectCaption.h:56
-[NvsVideoEffectCaption getDrawOutline]
BOOL getDrawOutline()
获取字幕描边状态
-[NvsVideoEffectCaption getModularCaptionInAnimationDuration]
int getModularCaptionInAnimationDuration()
获取模块字幕入动画的时长
-[NvsVideoEffectCaption getShadowOffset]
CGPoint getShadowOffset()
获取当前字幕阴影的偏移量
-[NvsVideoEffectCaption getTextCenterAzimuthAngle]
float getTextCenterAzimuthAngle()
获取字幕文本中心点的方位角。只对全景图字幕有效
-[NvsVideoEffectCaption getScaleX]
float getScaleX()
获取字幕水平缩放系数
-[NvsVideoEffectCaption getPolarAngleRange]
float getPolarAngleRange()
获取字幕极角的张角。只对全景图字幕有效
NvsVideoEffectCaption::modularCaptionContextPackageId
NSString * modularCaptionContextPackageId
模块字幕环境样式包裹ID
Definition: NvsVideoEffectCaption.h:128
NvsVideoEffectCaption::category
NvsVideoEffectCategory category
片段类型
Definition: NvsVideoEffectCaption.h:126
-[NvsVideoEffectCaption getTextOrthoAngleRange]
float getTextOrthoAngleRange()
获取字幕文本与极角垂直的张角。只对全景图字幕有效
NvsVideoEffectRoleInTheme
NvsVideoEffectRoleInTheme
片段在主题中的角色
Definition: NvsVideoEffectCaption.h:39
NvsVideoEffectCaption::modularCaptionRendererPackageId
NSString * modularCaptionRendererPackageId
模块字幕渲染样式包裹ID
Definition: NvsVideoEffectCaption.h:129
NvsVideoEffectTextAlignmentBottom
@ NvsVideoEffectTextAlignmentBottom
Definition: NvsVideoEffectCaption.h:57
-[NvsVideoEffectCaption getUnderline]
BOOL getUnderline()
获取字幕下划线状态
NvsVideoEffectTextAlignment
NvsVideoEffectTextAlignment
字幕对齐方式
Definition: NvsVideoEffectCaption.h:52
NvsVideoEffectDefaultCategory
@ NvsVideoEffectDefaultCategory
默认类型
Definition: NvsVideoEffectCaption.h:27
-[NvsVideoEffectCaption getModularCaptionAnimationPeroid]
int getModularCaptionAnimationPeroid()
获取模块字幕循环动画的周期
NvsVideoEffectBoundingType_Frame
@ NvsVideoEffectBoundingType_Frame
包括装饰在内的整体边框
Definition: NvsVideoEffectCaption.h:86
-[NvsVideoEffectCaption getLineSpacing]
float getLineSpacing()
获取字幕行间距
-[NvsVideoEffectCaption getSecondaryColor]
NvsEffectColor getSecondaryColor()
获取字幕字体的当前第二个颜色值
NvsVideoEffectTextAlignmentCenter
@ NvsVideoEffectTextAlignmentCenter
Definition: NvsVideoEffectCaption.h:54
VIDEO_EFFECT_NOT_USE_ASSET_DEFAULT_PARAM
@ VIDEO_EFFECT_NOT_USE_ASSET_DEFAULT_PARAM
Definition: NvsVideoEffectCaption.h:70
NvsVideoEffectRoleInThemeTrailer
@ NvsVideoEffectRoleInThemeTrailer
片尾
Definition: NvsVideoEffectCaption.h:42
-[NvsVideoEffectCaption getFontSize]
float getFontSize()
获取当前字幕的字体大小
NvsVideoEffectBoundingType_Text
@ NvsVideoEffectBoundingType_Text
文字的实际边框
Definition: NvsVideoEffectCaption.h:84
-[NvsVideoEffectCaption getCaptionTranslation]
CGPoint getCaptionTranslation()
获取字幕的平移量
-[NvsVideoEffectCaption getBold]
BOOL getBold()
获取字幕字体加粗状态
NvsVideoEffectAssetDefaultParam
NvsVideoEffectAssetDefaultParam
使用默认的字幕包属性
Definition: NvsVideoEffectCaption.h:68
-[NvsVideoEffectCaption getLetterSpacing]
float getLetterSpacing()
获取字幕字间距
-[NvsVideoEffectCaption getTextVerticalAlignment]
NvsVideoEffectTextAlignment getTextVerticalAlignment()
获取字幕垂直对齐方式
NvsVideoEffectBoundingType_Typographic_Text
@ NvsVideoEffectBoundingType_Typographic_Text
文字的排版边框
Definition: NvsVideoEffectCaption.h:88
-[NvsVideoEffectCaption getOrthoAngleRange]
float getOrthoAngleRange()
获取字幕与极角垂直的张角。只对全景图字幕有效
NvsVideoEffectBoundingType
NvsVideoEffectBoundingType
Definition: NvsVideoEffectCaption.h:83
NvsVideoEffectCaption::captionStylePackageId
NSString * captionStylePackageId
字幕样式包裹ID
Definition: NvsVideoEffectCaption.h:127
VIDEO_EFFECT_USE_ASSET_DEFAULT_PARAM
@ VIDEO_EFFECT_USE_ASSET_DEFAULT_PARAM
Definition: NvsVideoEffectCaption.h:69
NvsVideoEffectCaption::modularCaptionAnimationPackageId
NSString * modularCaptionAnimationPackageId
模块字幕循环动画样式包裹ID
Definition: NvsVideoEffectCaption.h:130
NvsVideoEffectCaption::inPoint
int64_t inPoint
字幕在时间线上显示的入点(单位微秒)
Definition: NvsVideoEffectCaption.h:123
-[NvsVideoEffectCaption getItalic]
BOOL getItalic()
获取字幕斜体状态
-[NvsVideoEffectCaption getModularCaptionOutAnimationDuration]
int getModularCaptionOutAnimationDuration()
获取模块字幕出动画的时长
-[NvsVideoEffectCaption getTextColor]
NvsEffectColor getTextColor()
获取字幕字体的当前颜色值
NvsEffectColor
自定义颜色类
Definition: NvsEffectCommonDef.h:55
NvsVideoEffectBoundingType_Text_Origin_Frame
@ NvsVideoEffectBoundingType_Text_Origin_Frame
没有经过变换的文字框的边框
Definition: NvsVideoEffectCaption.h:87
NvsVideoEffectTextAlignmentLeft
@ NvsVideoEffectTextAlignmentLeft
Definition: NvsVideoEffectCaption.h:53
-[NvsVideoEffectCaption getOutlineWidth]
float getOutlineWidth()
获取当前字幕描边的宽度
NvsVideoEffectTextAlignmentVCenter
@ NvsVideoEffectTextAlignmentVCenter
Definition: NvsVideoEffectCaption.h:58
NvsVideoEffectCaption::roleInTheme
NvsVideoEffectRoleInTheme roleInTheme
字幕在主题中的角色(通用、片头、片尾)
Definition: NvsVideoEffectCaption.h:125
NvsVideoEffectCaption::modularCaptionInAnimationPackageId
NSString * modularCaptionInAnimationPackageId
模块字幕入动画样式包裹ID
Definition: NvsVideoEffectCaption.h:131
NvsVideoEffectThemeCategory
@ NvsVideoEffectThemeCategory
主题类型
Definition: NvsVideoEffectCaption.h:29
NvsVideoEffectCaption::modularCaptionOutAnimationPackageId
NSString * modularCaptionOutAnimationPackageId
模块字幕出动画样式包裹ID
Definition: NvsVideoEffectCaption.h:132
-[NvsVideoEffectCaption getBackgroundColor]
NvsEffectColor getBackgroundColor()
获取字幕文本的当前背景颜色值
NvsVideoEffectCaption::isModular
BOOL isModular
当前字幕是否为模块字幕
Definition: NvsVideoEffectCaption.h:121
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
NvsEffect
特效
Definition: NvsEffect.h:46
-[NvsVideoEffectCaption getLetterSpacingType]
NvsVideoEffectLetterSpacingType getLetterSpacingType()
获取字幕字间距类型
-[NvsVideoEffectCaption getFontFamily]
NSString * getFontFamily()
获取字幕字体
NvsEffectVideoResolution
视频解析度
Definition: NvsEffectCommonDef.h:39
-[NvsVideoEffectCaption getScaleY]
float getScaleY()
获取字幕垂直缩放系数
NvsVideoEffectCaption::outPoint
int64_t outPoint
字幕在时间线显示上的出点(单位微秒)
Definition: NvsVideoEffectCaption.h:124
-[NvsVideoEffectCaption getPanoramicScaleY]
float getPanoramicScaleY()
获取字幕垂直缩放系数。只对全景图字幕有效
NvsVideoEffectLetterSpacingType
NvsVideoEffectLetterSpacingType
字间距类型
Definition: NvsVideoEffectCaption.h:98
-[NvsVideoEffectCaption getTextPolarAngleRange]
float getTextPolarAngleRange()
获取字幕文本极角的张角。只对全景图字幕有效
NvsVideoEffectRoleInThemeTitle
@ NvsVideoEffectRoleInThemeTitle
片头
Definition: NvsVideoEffectCaption.h:41
NvsVideoEffectLetterSpacingTypeAbsolute
@ NvsVideoEffectLetterSpacingTypeAbsolute
Definition: NvsVideoEffectCaption.h:100
-[NvsVideoEffectCaption getDrawShadow]
BOOL getDrawShadow()
获取当前字幕阴影状态
NvsVideoEffectTextAlignmentRight
@ NvsVideoEffectTextAlignmentRight
Definition: NvsVideoEffectCaption.h:55
NvsVideoEffectRoleInThemeGeneral
@ NvsVideoEffectRoleInThemeGeneral
通用
Definition: NvsVideoEffectCaption.h:40
-[NvsVideoEffectCaption getFontFilePath]
NSString * getFontFilePath()
获取字幕字体的文件路径
-[NvsVideoEffectCaption getVerticalLayout]
BOOL getVerticalLayout()
获取字幕布局状态
-[NvsVideoEffectCaption getWeight]
int getWeight()
获取字幕权重值
-[NvsVideoEffectCaption getText]
NSString * getText()
获取字幕文本
NvsEffect.h
NvsVideoEffectUserCategory
@ NvsVideoEffectUserCategory
用户自定义类型
Definition: NvsVideoEffectCaption.h:28
-[NvsVideoEffectCaption getShadowColor]
NvsEffectColor getShadowColor()
获取当前字幕阴影的颜色
-[NvsVideoEffectCaption getPanoramicScaleX]
float getPanoramicScaleX()
获取字幕水平缩放系数。只对全景图字幕有效
NvsVideoEffectBoundingType_Text_Frame
@ NvsVideoEffectBoundingType_Text_Frame
文字框的边框
Definition: NvsVideoEffectCaption.h:85