美摄SDK For iOS  3.15.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 
417 - (void)setStrikeOut:(BOOL)strikeOut;
418 
428 - (BOOL)getStrikeOut;
429 
441 - (float)getLetterSpacing;
442 
454 - (void)setLetterSpacing:(float)letterSpacing;
455 
467 
478 - (void)setLetterSpacingType:(NvsLetterSpacingType)letterSpacingType;
479 
490 - (float)getLineSpacing;
491 
502 - (void)setLineSpacing:(float)lineSpacing;
503 
504 
514 - (void)setTextColor:(const NvsColor *)textColor;
515 
523 - (void)resetTextColorState;
524 
535 
545 - (void)setDrawOutline:(BOOL)drawOutline;
546 
556 - (BOOL)getDrawOutline;
557 
567 - (void)setOutlineColor:(const NvsColor *)outlineColor;
568 
579 
587 - (void)resetOutlineColorState;
588 
598 - (void)setOutlineWidth:(float)outlineWidth;
599 
609 - (float)getOutlineWidth;
610 
620 - (void)setDrawShadow:(BOOL)drawShadow;
621 
631 - (BOOL)getDrawShadow;
632 
642 - (void)setShadowColor:(const NvsColor *)shadowColor;
643 
654 
664 - (void)setShadowOffset:(CGPoint)shadowOffset;
665 
675 - (CGPoint)getShadowOffset;
676 
686 - (void)setShadowFeather:(float)feather;
687 
697 - (float)getShadowFeather;
698 
708 - (void)setFontSize:(float)fontSize;
709 
719 - (float)getFontSize;
720 
728 - (void)setFrameCaptionMaxFontSize:(float)maxFontSize;
729 
740 - (void)setFontWithFilePath:(NSString *)filePath;
741 
752 - (NSString *)getFontFilePath;
753 
762 - (NSString *)getFontFamily;
763 
774 - (void)setFontFamily:(NSString *)family;
775 
786 - (void)setCaptionTranslation:(CGPoint)translation;
787 
797 - (CGPoint)getCaptionTranslation;
798 
810 - (void)translateCaption:(CGPoint)translationOffset;
811 
822 - (void)setAnchorPoint:(CGPoint)anchor;
823 
834 - (CGPoint)getAnchorPoint;
835 
847 - (void)setScaleX:(float)scale;
848 
860 - (float)getScaleX;
861 
873 - (void)setScaleY:(float)scale;
874 
886 - (float)getScaleY;
887 
899 - (void)scaleCaption:(float)scaleFactor anchor:(CGPoint)anchor;
900 
911 - (void)setRotationZ:(float)angle;
912 
923 - (float)getRotationZ;
924 
937 - (void)rotateCaption:(float)angle anchor:(CGPoint)anchor;
938 
949 - (void)rotateCaption:(float)angle;
950 
961 - (void)setTextFrameOriginRect:(NvsRect)rc;
962 
972 
982 - (NSArray *)getBoundingRectangleVertices;
983 
995 - (NSArray *)getCaptionBoundingVertices:(NvsBoundingType)boundingType;
996 
1008 - (void)setCenterPolarAngle:(float)centerPolarAngle;
1009 
1021 - (float)getCenterPolarAngle;
1022 
1034 - (float)getTextCenterPolarAngle;
1035 
1047 - (void)setCenterAzimuthAngle:(float)centerAzimuthAngle;
1048 
1061 - (float)getCenterAzimuthAngle;
1062 
1074 - (float)getTextCenterAzimuthAngle;
1075 
1087 - (void)setPolarAngleRange:(float)polarAngleRange;
1088 
1100 - (float)getPolarAngleRange;
1101 
1113 - (float)getTextPolarAngleRange;
1114 
1126 - (float)getOrthoAngleRange;
1127 
1139 - (float)getTextOrthoAngleRange;
1140 
1152 - (void)setPanoramicScaleX:(float)scaleX;
1153 
1165 - (float)getPanoramicScaleX;
1166 
1178 - (void)setPanoramicScaleY:(float)scaleY;
1179 
1191 - (float)getPanoramicScaleY;
1192 
1204 - (void)setPanoramicRotation:(float)rotationAngle;
1205 
1217 - (float)getPanoramicRotation;
1218 
1228 - (void)setZValue:(float)value;
1229 
1239 - (float)getZValue;
1240 
1250 - (void)setRecordingUserOperation:(BOOL)recordingUserOperation;
1251 
1261 - (void)setOpacity:(float)opacity;
1262 
1272 - (float)getOpacity;
1273 
1284 - (void)setBackgroundColor:(const NvsColor *)backgroundColor;
1285 
1297 
1308 - (void)setBackgroundRadius:(float)radius;
1309 
1320 - (float)getBackgroundRadius;
1321 
1322 
1332 -(void)setBoundaryPaddingRatio:(float)ratio;
1333 
1343 -(float)getBoundaryPaddingRatio;
1344 
1355 - (void)setSecondaryColor:(const NvsColor *)color;
1356 
1368 
1379 - (void)setSecondaryOutlineColor:(const NvsColor *)color;
1380 
1392 
1401 - (void)setCurrentKeyFrameTime:(int64_t)time;
1402 
1415 - (bool)setControlPoint:(NSString *)fxParam controlPointPair:(NvsControlPointPair *)controlPointPair;
1416 
1429 - (NvsControlPointPair*)getControlPoint:(NSString*)fxParam;
1430 
1440 - (BOOL)isFrameCaption;
1441 
1452 - (void)setTextSpanList:(NSArray<NvsCaptionSpan *>*)storyboardCaptionSpanList;
1453 
1462 - (NSArray<NvsCaptionSpan *>*)getTextSpanList;
1463 
1473 
1483 
1494 - (BOOL)hasOutlineLayerInComplexRender:(int)layerIndex;
1495 
1506 - (NvsColor)getComplexRenderLayerOutlineColor:(int)layerIndex;
1507 
1520 - (BOOL)setComplexRenderLayerOutlineColor:(int)layerIndex color:(NvsColor)color;
1521 
1532 - (float)getComplexRenderLayerOutlineWidth:(int)layerIndex;
1533 
1546 - (BOOL)setComplexRenderLayerOutlineWidth:(int)layerIndex width:(float)width;
1547 
1558 - (float)getComplexRenderLayerOpacity:(int)layerIndex;
1559 
1572 - (BOOL)setComplexRenderLayerOpacity:(int)layerIndex opacity:(float)opacity;
1573 
1574 
1575 @end
-[NvsCaption getShadowOffset]
CGPoint getShadowOffset()
获取当前字幕阴影的偏移量
-[NvsCaption getCenterPolarAngle]
float getCenterPolarAngle()
获取字幕中心点的极角。只对全景图字幕有效
-[NvsCaption getTextLayout]
NvsCaptionTextLayout * getTextLayout()
获取字幕layout属性
NvsRoleInTheme
NvsRoleInTheme
片段在主题中的角色
Definition: NvsCommonDef.h:131
-[NvsCaption getOrthoAngleRange]
float getOrthoAngleRange()
获取字幕与极角垂直的张角。只对全景图字幕有效
NvsCaption::modularCaptionAnimationPackageId
NSString * modularCaptionAnimationPackageId
模块字幕循环动画样式包裹ID
Definition: NvsCaption.h:42
NvsLetterSpacingType
NvsLetterSpacingType
字间距类型
Definition: NvsCommonDef.h:160
NvsControlPointPair
关键帧控制点对类。
Definition: NvsControlPointPair.h:27
NvsCaption::modularCaptionInAnimationPackageId
NSString * modularCaptionInAnimationPackageId
模块字幕入动画样式包裹ID
Definition: NvsCaption.h:43
-[NvsCaption getModularCaptionOutAnimationDuration]
int getModularCaptionOutAnimationDuration()
获取模块字幕出动画的时长
NvsRect
矩形
Definition: NvsCommonDef.h:371
-[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:413
-[NvsCaption getModularCaptionAnimationPeroid]
int getModularCaptionAnimationPeroid()
获取模块字幕循环动画的周期
-[NvsCaption getBackgroundRadius]
float getBackgroundRadius()
获取字幕文本的当前背景框的圆角半径
-[NvsCaption getTextSpanList]
NSArray< NvsCaptionSpan * > * getTextSpanList()
获取需要应用多种layout属性
-[NvsCaption getStrikeOut]
BOOL getStrikeOut()
获取字幕删除线状态
-[NvsCaption getRotationZ]
float getRotationZ()
获取字幕旋转角度
-[NvsCaption resetTextColorState]
void resetTextColorState()
重置字幕颜色状态
NvsCaption
时间线字幕
Definition: NvsCaption.h:34
NvsCaptionSpan
Definition: NvsCaptionSpan.h:46
-[NvsCaption getCenterAzimuthAngle]
float getCenterAzimuthAngle()
获取字幕中心点的方位角。只对全景图字幕有效
NvsTextAlignment
NvsTextAlignment
字幕对齐方式
Definition: NvsCommonDef.h:144
-[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:172
-[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:184
NvsCaption::category
NvsCategory category
片段类型
Definition: NvsCaption.h:38
NvsCaption::isModular
BOOL isModular
当前字幕是否为模块字幕
Definition: NvsCaption.h:36
-[NvsCaption getShadowFeather]
float getShadowFeather()
获取当前字幕阴影的羽化程度