美摄SDK For iOS  3.14.0
NvsCaption.h
浏览该文件的文档.
1 //================================================================================
2 //
3 // (c) Copyright Meishe Co. Ltd, 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: Meishe video team
12 //================================================================================
13 #pragma once
14 
15 #import "NvsFx.h"
16 #import <CoreGraphics/CGGeometry.h>
18 #import "NvsCaptionSpan.h"
19 #import "NvsCaptionTextLayout.h"
20 
34 
35 @property (readonly) BOOL isPanoramic;
36 @property (readonly) BOOL isModular;
37 @property (readonly) NvsRoleInTheme roleInTheme;
38 @property (readonly) NvsCategory category;
39 @property (readonly) NSString* captionStylePackageId;
40 @property (readonly) NSString* modularCaptionContextPackageId;
41 @property (readonly) NSString* modularCaptionRendererPackageId;
42 @property (readonly) NSString* modularCaptionAnimationPackageId;
43 @property (readonly) NSString* modularCaptionInAnimationPackageId;
44 @property (readonly) NSString* modularCaptionOutAnimationPackageId;
45 
58 -(bool) applyCaptionStyle:(NSString*) captionStylePackageId;
59 
74 -(bool) applyModularCaptionContext:(NSString*) captionContextPackageId;
75 
90 -(bool) applyModularCaptionRenderer:(NSString*) captionRendererPackageId;
91 
106 -(bool) applyModularCaptionAnimation:(NSString*) captionAnimationPackageId;
107 
122 -(bool) applyModularCaptionInAnimation:(NSString*) captionInAnimationPackageId;
123 
138 -(bool) applyModularCaptionOutAnimation:(NSString*) captionOutAnimationPackageId;
139 
150 -(void) setModularCaptionAnimationPeroid:(int)periodInMS;
151 
163 
174 -(void) setModularCaptionInAnimationDuration:(int)inAnimationDurationInMS;
175 
187 
198 -(void) setModularCaptionOutAnimationDuration:(int)outAnimationDurationInMS;
199 
211 
226 -(bool) applyCaptionStyleWithAssetDefaultParam:(NSString*) captionStylePackageId isUseDefaultAssetParam:(NvsAssetDefaultParam)isUseDefaultAssetParam;
227 
237 - (void)setText:(NSString *)text;
238 
248 - (NSString *)getText;
249 
259 - (void)setVerticalLayout:(BOOL)verticalLayout;
260 
270 - (BOOL)getVerticalLayout;
271 
282 - (void)setTextAlignment:(NvsTextAlignment)textAlign;
283 
294 
306 - (void)setTextVerticalAlignment:(NvsTextAlignment)textVerticalAlign;
307 
319 
329 - (void)setBold:(BOOL)bold;
330 
340 - (BOOL)getBold;
341 
351 - (void)setWeight:(int)weight;
352 
362 - (int)getWeight;
363 
373 - (void)setItalic:(BOOL)italic;
374 
384 - (BOOL)getItalic;
385 
395 - (void)setUnderline:(BOOL)underline;
396 
406 - (BOOL)getUnderline;
407 
419 - (float)getLetterSpacing;
420 
432 - (void)setLetterSpacing:(float)letterSpacing;
433 
445 
456 - (void)setLetterSpacingType:(NvsLetterSpacingType)letterSpacingType;
457 
468 - (float)getLineSpacing;
469 
480 - (void)setLineSpacing:(float)lineSpacing;
481 
482 
492 - (void)setTextColor:(const NvsColor *)textColor;
493 
501 - (void)resetTextColorState;
502 
513 
523 - (void)setDrawOutline:(BOOL)drawOutline;
524 
534 - (BOOL)getDrawOutline;
535 
545 - (void)setOutlineColor:(const NvsColor *)outlineColor;
546 
557 
565 - (void)resetOutlineColorState;
566 
576 - (void)setOutlineWidth:(float)outlineWidth;
577 
587 - (float)getOutlineWidth;
588 
598 - (void)setDrawShadow:(BOOL)drawShadow;
599 
609 - (BOOL)getDrawShadow;
610 
620 - (void)setShadowColor:(const NvsColor *)shadowColor;
621 
632 
642 - (void)setShadowOffset:(CGPoint)shadowOffset;
643 
653 - (CGPoint)getShadowOffset;
654 
664 - (void)setShadowFeather:(float)feather;
665 
675 - (float)getShadowFeather;
676 
686 - (void)setFontSize:(float)fontSize;
687 
697 - (float)getFontSize;
698 
706 - (void)setFrameCaptionMaxFontSize:(float)maxFontSize;
707 
718 - (void)setFontWithFilePath:(NSString *)filePath;
719 
730 - (NSString *)getFontFilePath;
731 
740 - (NSString *)getFontFamily;
741 
752 - (void)setFontFamily:(NSString *)family;
753 
764 - (void)setCaptionTranslation:(CGPoint)translation;
765 
775 - (CGPoint)getCaptionTranslation;
776 
788 - (void)translateCaption:(CGPoint)translationOffset;
789 
800 - (void)setAnchorPoint:(CGPoint)anchor;
801 
812 - (CGPoint)getAnchorPoint;
813 
825 - (void)setScaleX:(float)scale;
826 
838 - (float)getScaleX;
839 
851 - (void)setScaleY:(float)scale;
852 
864 - (float)getScaleY;
865 
877 - (void)scaleCaption:(float)scaleFactor anchor:(CGPoint)anchor;
878 
889 - (void)setRotationZ:(float)angle;
890 
901 - (float)getRotationZ;
902 
915 - (void)rotateCaption:(float)angle anchor:(CGPoint)anchor;
916 
927 - (void)rotateCaption:(float)angle;
928 
939 - (void)setTextFrameOriginRect:(NvsRect)rc;
940 
950 
960 - (NSArray *)getBoundingRectangleVertices;
961 
973 - (NSArray *)getCaptionBoundingVertices:(NvsBoundingType)boundingType;
974 
986 - (void)setCenterPolarAngle:(float)centerPolarAngle;
987 
999 - (float)getCenterPolarAngle;
1000 
1012 - (float)getTextCenterPolarAngle;
1013 
1025 - (void)setCenterAzimuthAngle:(float)centerAzimuthAngle;
1026 
1039 - (float)getCenterAzimuthAngle;
1040 
1052 - (float)getTextCenterAzimuthAngle;
1053 
1065 - (void)setPolarAngleRange:(float)polarAngleRange;
1066 
1078 - (float)getPolarAngleRange;
1079 
1091 - (float)getTextPolarAngleRange;
1092 
1104 - (float)getOrthoAngleRange;
1105 
1117 - (float)getTextOrthoAngleRange;
1118 
1130 - (void)setPanoramicScaleX:(float)scaleX;
1131 
1143 - (float)getPanoramicScaleX;
1144 
1156 - (void)setPanoramicScaleY:(float)scaleY;
1157 
1169 - (float)getPanoramicScaleY;
1170 
1182 - (void)setPanoramicRotation:(float)rotationAngle;
1183 
1195 - (float)getPanoramicRotation;
1196 
1206 - (void)setZValue:(float)value;
1207 
1217 - (float)getZValue;
1218 
1228 - (void)setRecordingUserOperation:(BOOL)recordingUserOperation;
1229 
1239 - (void)setOpacity:(float)opacity;
1240 
1250 - (float)getOpacity;
1251 
1262 - (void)setBackgroundColor:(const NvsColor *)backgroundColor;
1263 
1275 
1286 - (void)setBackgroundRadius:(float)radius;
1287 
1298 - (float)getBackgroundRadius;
1299 
1300 
1310 -(void)setBoundaryPaddingRatio:(float)ratio;
1311 
1321 -(float)getBoundaryPaddingRatio;
1322 
1333 - (void)setSecondaryColor:(const NvsColor *)color;
1334 
1346 
1357 - (void)setSecondaryOutlineColor:(const NvsColor *)color;
1358 
1370 
1379 - (void)setCurrentKeyFrameTime:(int64_t)time;
1380 
1393 - (bool)setControlPoint:(NSString *)fxParam controlPointPair:(NvsControlPointPair *)controlPointPair;
1394 
1407 - (NvsControlPointPair*)getControlPoint:(NSString*)fxParam;
1408 
1418 - (BOOL)isFrameCaption;
1419 
1430 - (void)setTextSpanList:(NSArray<NvsCaptionSpan *>*)storyboardCaptionSpanList;
1431 
1440 - (NSArray<NvsCaptionSpan *>*)getTextSpanList;
1441 
1451 
1461 
1472 - (BOOL)hasOutlineLayerInComplexRender:(int)layerIndex;
1473 
1484 - (NvsColor)getComplexRenderLayerOutlineColor:(int)layerIndex;
1485 
1498 - (BOOL)setComplexRenderLayerOutlineColor:(int)layerIndex color:(NvsColor)color;
1499 
1510 - (float)getComplexRenderLayerOutlineWidth:(int)layerIndex;
1511 
1524 - (BOOL)setComplexRenderLayerOutlineWidth:(int)layerIndex width:(float)width;
1525 
1536 - (float)getComplexRenderLayerOpacity:(int)layerIndex;
1537 
1550 - (BOOL)setComplexRenderLayerOpacity:(int)layerIndex opacity:(float)opacity;
1551 
1552 
1553 @end
-[NvsCaption getShadowOffset]
CGPoint getShadowOffset()
获取当前字幕阴影的偏移量
-[NvsCaption getCenterPolarAngle]
float getCenterPolarAngle()
获取字幕中心点的极角。只对全景图字幕有效
-[NvsCaption getTextLayout]
NvsCaptionTextLayout * getTextLayout()
获取字幕layout属性
NvsRoleInTheme
NvsRoleInTheme
片段在主题中的角色
Definition: NvsCommonDef.h:121
-[NvsCaption getOrthoAngleRange]
float getOrthoAngleRange()
获取字幕与极角垂直的张角。只对全景图字幕有效
NvsCaption::modularCaptionAnimationPackageId
NSString * modularCaptionAnimationPackageId
模块字幕循环动画样式包裹ID
Definition: NvsCaption.h:42
NvsLetterSpacingType
NvsLetterSpacingType
字间距类型
Definition: NvsCommonDef.h:150
NvsControlPointPair
关键帧控制点对类。
Definition: NvsControlPointPair.h:27
NvsCaption::modularCaptionInAnimationPackageId
NSString * modularCaptionInAnimationPackageId
模块字幕入动画样式包裹ID
Definition: NvsCaption.h:43
-[NvsCaption getModularCaptionOutAnimationDuration]
int getModularCaptionOutAnimationDuration()
获取模块字幕出动画的时长
NvsRect
矩形
Definition: NvsCommonDef.h:361
-[NvsCaption getScaleY]
float getScaleY()
获取字幕垂直缩放系数
-[NvsCaption getLetterSpacing]
float getLetterSpacing()
获取字幕字间距
-[NvsCaption getDrawOutline]
BOOL getDrawOutline()
获取字幕描边状态
-[NvsCaption getLetterSpacingType]
NvsLetterSpacingType getLetterSpacingType()
获取字幕字间距类型
-[NvsCaption getModularCaptionInAnimationDuration]
int getModularCaptionInAnimationDuration()
获取模块字幕入动画的时长
-[NvsCaption getItalic]
BOOL getItalic()
获取字幕斜体状态
-[NvsCaption getBoundaryPaddingRatio]
float getBoundaryPaddingRatio()
获取字幕边界扩展比率
-[NvsCaption getVerticalLayout]
BOOL getVerticalLayout()
获取字幕布局状态
-[NvsCaption getTextVerticalAlignment]
NvsTextAlignment getTextVerticalAlignment()
获取字幕垂直对齐方式,仅边框型字幕有效
NvsCaption::modularCaptionRendererPackageId
NSString * modularCaptionRendererPackageId
模块字幕渲染样式包裹ID
Definition: NvsCaption.h:41
NvsBoundingType
NvsBoundingType
Definition: NvsCompoundCaption.h:44
-[NvsCaption resetOutlineColorState]
void resetOutlineColorState()
重置字幕描边颜色状态
-[NvsCaption getText]
NSString * getText()
获取字幕文本
NvsCaption::modularCaptionOutAnimationPackageId
NSString * modularCaptionOutAnimationPackageId
模块字幕出动画样式包裹ID
Definition: NvsCaption.h:44
NvsFx
特效类
Definition: NvsFx.h:83
-[NvsCaption getScaleX]
float getScaleX()
获取字幕水平缩放系数
-[NvsCaption getCaptionTranslation]
CGPoint getCaptionTranslation()
获取字幕的平移量
-[NvsCaption getOpacity]
float getOpacity()
获取字幕透明度
-[NvsCaption getBackgroundColor]
NvsColor getBackgroundColor()
获取字幕文本的当前背景颜色值
NvsCaption::isPanoramic
BOOL isPanoramic
是否为全景图字幕
Definition: NvsCaption.h:35
-[NvsCaption getOutlineColor]
NvsColor getOutlineColor()
获取当前字幕描边的颜色值
NvsCaptionTextLayout.h
-[NvsCaption getAnchorPoint]
CGPoint getAnchorPoint()
获取字幕锚点
-[NvsCaption getDrawShadow]
BOOL getDrawShadow()
获取当前字幕阴影状态
-[NvsCaption getZValue]
float getZValue()
获取字幕Z值。
-[NvsCaption getTextColor]
NvsColor getTextColor()
获取字幕字体的当前颜色值
-[NvsCaption getUnderline]
BOOL getUnderline()
获取字幕下划线状态
-[NvsCaption getTextCenterAzimuthAngle]
float getTextCenterAzimuthAngle()
获取字幕文本中心点的方位角。只对全景图字幕有效
NvsColor
自定义颜色类
Definition: NvsCommonDef.h:403
-[NvsCaption getModularCaptionAnimationPeroid]
int getModularCaptionAnimationPeroid()
获取模块字幕循环动画的周期
-[NvsCaption getBackgroundRadius]
float getBackgroundRadius()
获取字幕文本的当前背景框的圆角半径
-[NvsCaption getTextSpanList]
NSArray< NvsCaptionSpan * > * getTextSpanList()
获取需要应用多种layout属性
-[NvsCaption getRotationZ]
float getRotationZ()
获取字幕旋转角度
-[NvsCaption resetTextColorState]
void resetTextColorState()
重置字幕颜色状态
NvsCaption
时间线字幕
Definition: NvsCaption.h:34
NvsCaptionSpan
Definition: NvsCaptionSpan.h:45
-[NvsCaption getCenterAzimuthAngle]
float getCenterAzimuthAngle()
获取字幕中心点的方位角。只对全景图字幕有效
NvsTextAlignment
NvsTextAlignment
字幕对齐方式
Definition: NvsCommonDef.h:134
-[NvsCaption getShadowColor]
NvsColor getShadowColor()
获取当前字幕阴影的颜色
-[NvsCaption getTextCenterPolarAngle]
float getTextCenterPolarAngle()
获取字幕文本中心点的极角。只对全景图字幕有效
-[NvsCaption isFrameCaption]
BOOL isFrameCaption()
获取字幕是否是边框字幕
-[NvsCaption getBoundingRectangleVertices]
NSArray * getBoundingRectangleVertices()
获取字幕的原始包围矩形框变换后的顶点位置
-[NvsCaption getComplexRenderLayerCount]
int getComplexRenderLayerCount()
获取复杂字幕层数。
NvsCaption::modularCaptionContextPackageId
NSString * modularCaptionContextPackageId
模块字幕环境样式包裹ID
Definition: NvsCaption.h:40
-[NvsCaption getSecondaryColor]
NvsColor getSecondaryColor()
获取字幕字体的当前第二个颜色值
-[NvsCaption getTextBoundingRect]
NvsRect getTextBoundingRect()
获取字幕文本矩形框
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
NvsCaption::captionStylePackageId
NSString * captionStylePackageId
字幕样式包裹ID
Definition: NvsCaption.h:39
-[NvsCaption getSecondaryOutlineColor]
NvsColor getSecondaryOutlineColor()
获取字幕描边的第二个颜色值
-[NvsCaption getFontFamily]
NSString * getFontFamily()
获取字幕字体
NvsAssetDefaultParam
NvsAssetDefaultParam
使用默认的字幕包属性
Definition: NvsCommonDef.h:162
-[NvsCaption getWeight]
int getWeight()
获取字幕权重值
-[NvsCaption getBold]
BOOL getBold()
获取字幕字体加粗状态
-[NvsCaption getPanoramicScaleX]
float getPanoramicScaleX()
获取字幕水平缩放系数。只对全景图字幕有效
NvsCaption::roleInTheme
NvsRoleInTheme roleInTheme
字幕在主题中的角色(通用、片头、片尾)
Definition: NvsCaption.h:37
-[NvsCaption getPanoramicScaleY]
float getPanoramicScaleY()
获取字幕垂直缩放系数。只对全景图字幕有效
-[NvsCaption getOutlineWidth]
float getOutlineWidth()
获取当前字幕描边的宽度
NvsCaptionTextLayout
Definition: NvsCaptionTextLayout.h:16
-[NvsCaption getPolarAngleRange]
float getPolarAngleRange()
获取字幕极角的张角。只对全景图字幕有效
NvsCaptionSpan.h
-[NvsCaption getFontSize]
float getFontSize()
获取当前字幕的字体大小
-[NvsCaption getTextAlignment]
NvsTextAlignment getTextAlignment()
获取字幕水平对齐方式
-[NvsCaption getPanoramicRotation]
float getPanoramicRotation()
获取字幕旋转角度。只对全景图字幕有效
NvsFx.h
-[NvsCaption getTextOrthoAngleRange]
float getTextOrthoAngleRange()
获取字幕文本与极角垂直的张角。只对全景图字幕有效
-[NvsCaption getTextPolarAngleRange]
float getTextPolarAngleRange()
获取字幕文本极角的张角。只对全景图字幕有效
NvsTimelineCompoundCaption.h
-[NvsCaption getFontFilePath]
NSString * getFontFilePath()
获取字幕字体的文件路径
-[NvsCaption getLineSpacing]
float getLineSpacing()
获取字幕行间距
NvsCategory
NvsCategory
片段在主题中的类型
Definition: NvsCommonDef.h:174
NvsCaption::category
NvsCategory category
片段类型
Definition: NvsCaption.h:38
NvsCaption::isModular
BOOL isModular
当前字幕是否为模块字幕
Definition: NvsCaption.h:36
-[NvsCaption getShadowFeather]
float getShadowFeather()
获取当前字幕阴影的羽化程度