MeiCam SDK For iOS  3.7.2
NvsVideoEffectCaption.h
Go to the documentation of this file.
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
Whether to enable the affinity with clip.
Definition: NvsVideoEffectCaption.h:122
-[NvsVideoEffectCaption getOpacity]
float getOpacity()
Get the caption opacity.
-[NvsVideoEffectCaption getCenterAzimuthAngle]
float getCenterAzimuthAngle()
Gets the azimuth angle of the center point for the caption. It's only valid for the panorama caption.
-[NvsVideoEffectCaption getOutlineColor]
NvsEffectColor getOutlineColor()
Gets the color of the outline for the caption.
-[NvsVideoEffectCaption isFrameCaption]
BOOL isFrameCaption()
Gets whether the caption is a frame caption.
-[NvsVideoEffectCaption getRotationZ]
float getRotationZ()
Gets the rotation angle for the caption.
-[NvsVideoEffectCaption getTextAlignment]
NvsVideoEffectTextAlignment getTextAlignment()
Gets the caption horizontal alignment method.
-[NvsVideoEffectCaption getCenterPolarAngle]
float getCenterPolarAngle()
Gets the polar angle of the center point for the caption. It's only valid for the panorama caption.
NvsVideoEffectCategory
NvsVideoEffectCategory
Definition: NvsVideoEffectCaption.h:26
NvsEffectRect
Rectangle.
Definition: NvsEffectCommonDef.h:120
NvsVideoEffectLetterSpacingTypePercentage
@ NvsVideoEffectLetterSpacingTypePercentage
Definition: NvsVideoEffectCaption.h:99
NvsVideoEffectCaption::isPanoramic
BOOL isPanoramic
Whether it is a panorama caption.
Definition: NvsVideoEffectCaption.h:120
-[NvsVideoEffectCaption getShadowFeather]
float getShadowFeather()
Gets the feathering degree of the caption shadow.
-[NvsVideoEffectCaption getZValue]
float getZValue()
Gets the Z value of the caption.
-[NvsVideoEffectCaption getAnchorPoint]
CGPoint getAnchorPoint()
Gets the caption anchor.
-[NvsVideoEffectCaption getBackgroundRadius]
float getBackgroundRadius()
Get the current text background rectangle's corner radius value.
NvsVideoEffectCaption
captions.
Definition: NvsVideoEffectCaption.h:119
-[NvsVideoEffectCaption getTextCenterPolarAngle]
float getTextCenterPolarAngle()
Gets the polar angle of the center point for the caption text. It's only valid for the panorama capti...
-[NvsVideoEffectCaption getPanoramicRotation]
float getPanoramicRotation()
Gets the rotation angle for the caption. It's only valid for the panorama caption.
NvsVideoEffectTextAlignmentTop
@ NvsVideoEffectTextAlignmentTop
Definition: NvsVideoEffectCaption.h:56
-[NvsVideoEffectCaption getDrawOutline]
BOOL getDrawOutline()
Gets the status whether the caption draws the outline.
-[NvsVideoEffectCaption getModularCaptionInAnimationDuration]
int getModularCaptionInAnimationDuration()
Get modular caption in-animation duration.
-[NvsVideoEffectCaption getShadowOffset]
CGPoint getShadowOffset()
Gets the offset of the caption shadow.
-[NvsVideoEffectCaption getTextCenterAzimuthAngle]
float getTextCenterAzimuthAngle()
Gets the azimuth angle of the center point for the caption text. It's only valid for the panorama cap...
-[NvsVideoEffectCaption getScaleX]
float getScaleX()
Gets the horizontal scaling factor for the caption.
-[NvsVideoEffectCaption getPolarAngleRange]
float getPolarAngleRange()
Gets the ranging angle of the polar angle for the caption. It's only valid for the panorama caption.
NvsVideoEffectCaption::modularCaptionContextPackageId
NSString * modularCaptionContextPackageId
The package ID of the modular caption context style.
Definition: NvsVideoEffectCaption.h:128
NvsVideoEffectCaption::category
NvsVideoEffectCategory category
Clip type.
Definition: NvsVideoEffectCaption.h:126
-[NvsVideoEffectCaption getTextOrthoAngleRange]
float getTextOrthoAngleRange()
Gets the ranging angle of which is perpendicular with the polar angle for the caption text....
NvsVideoEffectRoleInTheme
NvsVideoEffectRoleInTheme
The role of the clip in the theme.
Definition: NvsVideoEffectCaption.h:39
NvsVideoEffectCaption::modularCaptionRendererPackageId
NSString * modularCaptionRendererPackageId
The package ID of the modular caption render style.
Definition: NvsVideoEffectCaption.h:129
NvsVideoEffectTextAlignmentBottom
@ NvsVideoEffectTextAlignmentBottom
Definition: NvsVideoEffectCaption.h:57
-[NvsVideoEffectCaption getUnderline]
BOOL getUnderline()
Gets the caption under line.
NvsVideoEffectTextAlignment
NvsVideoEffectTextAlignment
Text alignment style.
Definition: NvsVideoEffectCaption.h:52
NvsVideoEffectDefaultCategory
@ NvsVideoEffectDefaultCategory
Default type.
Definition: NvsVideoEffectCaption.h:27
-[NvsVideoEffectCaption getModularCaptionAnimationPeroid]
int getModularCaptionAnimationPeroid()
Get modular caption Animation Peroid.
NvsVideoEffectBoundingType_Frame
@ NvsVideoEffectBoundingType_Frame
The whole bounding including decoration.
Definition: NvsVideoEffectCaption.h:86
-[NvsVideoEffectCaption getLineSpacing]
float getLineSpacing()
Gets caption line spacing.
-[NvsVideoEffectCaption getSecondaryColor]
NvsEffectColor getSecondaryColor()
Gets the current color value of the caption.
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
Trailer.
Definition: NvsVideoEffectCaption.h:42
-[NvsVideoEffectCaption getFontSize]
float getFontSize()
Gets the font size of the caption.
NvsVideoEffectBoundingType_Text
@ NvsVideoEffectBoundingType_Text
The actual text bounding.
Definition: NvsVideoEffectCaption.h:84
-[NvsVideoEffectCaption getCaptionTranslation]
CGPoint getCaptionTranslation()
Gets the translation amount of the caption.
-[NvsVideoEffectCaption getBold]
BOOL getBold()
Gets the state whether the caption font is bold.
NvsVideoEffectAssetDefaultParam
NvsVideoEffectAssetDefaultParam
Uses the default caption package.
Definition: NvsVideoEffectCaption.h:68
-[NvsVideoEffectCaption getLetterSpacing]
float getLetterSpacing()
Gets caption word spacing.
-[NvsVideoEffectCaption getTextVerticalAlignment]
NvsVideoEffectTextAlignment getTextVerticalAlignment()
Gets the caption vertical alignment method.
NvsVideoEffectBoundingType_Typographic_Text
@ NvsVideoEffectBoundingType_Typographic_Text
The typographic text bounding.
Definition: NvsVideoEffectCaption.h:88
-[NvsVideoEffectCaption getOrthoAngleRange]
float getOrthoAngleRange()
Gets the ranging angle which is perpendicular with the polar angle for the caption....
NvsVideoEffectBoundingType
NvsVideoEffectBoundingType
Definition: NvsVideoEffectCaption.h:83
NvsVideoEffectCaption::captionStylePackageId
NSString * captionStylePackageId
The package ID of the caption style.
Definition: NvsVideoEffectCaption.h:127
VIDEO_EFFECT_USE_ASSET_DEFAULT_PARAM
@ VIDEO_EFFECT_USE_ASSET_DEFAULT_PARAM
Definition: NvsVideoEffectCaption.h:69
NvsVideoEffectCaption::modularCaptionAnimationPackageId
NSString * modularCaptionAnimationPackageId
The package ID of the modular caption animation style.
Definition: NvsVideoEffectCaption.h:130
NvsVideoEffectCaption::inPoint
int64_t inPoint
The in point of the caption on the timeline(in microseconds)
Definition: NvsVideoEffectCaption.h:123
-[NvsVideoEffectCaption getItalic]
BOOL getItalic()
Gets the state whether the caption font is italic.
-[NvsVideoEffectCaption getModularCaptionOutAnimationDuration]
int getModularCaptionOutAnimationDuration()
Get modular caption out-animation duration.
-[NvsVideoEffectCaption getTextColor]
NvsEffectColor getTextColor()
Gets the current color value of the caption font.
NvsEffectColor
Self-defined color.
Definition: NvsEffectCommonDef.h:55
NvsVideoEffectBoundingType_Text_Origin_Frame
@ NvsVideoEffectBoundingType_Text_Origin_Frame
Text frame bounding that has not been transformed.
Definition: NvsVideoEffectCaption.h:87
NvsVideoEffectTextAlignmentLeft
@ NvsVideoEffectTextAlignmentLeft
Definition: NvsVideoEffectCaption.h:53
-[NvsVideoEffectCaption getOutlineWidth]
float getOutlineWidth()
Gets the width of the outline for the caption.
NvsVideoEffectTextAlignmentVCenter
@ NvsVideoEffectTextAlignmentVCenter
Definition: NvsVideoEffectCaption.h:58
NvsVideoEffectCaption::roleInTheme
NvsVideoEffectRoleInTheme roleInTheme
The role of captions in the theme (general, title, and trailer.)
Definition: NvsVideoEffectCaption.h:125
NvsVideoEffectCaption::modularCaptionInAnimationPackageId
NSString * modularCaptionInAnimationPackageId
The package ID of the modular caption in-animation style.
Definition: NvsVideoEffectCaption.h:131
NvsVideoEffectThemeCategory
@ NvsVideoEffectThemeCategory
Theme category.
Definition: NvsVideoEffectCaption.h:29
NvsVideoEffectCaption::modularCaptionOutAnimationPackageId
NSString * modularCaptionOutAnimationPackageId
The package ID of the modular caption out-animation style.
Definition: NvsVideoEffectCaption.h:132
-[NvsVideoEffectCaption getBackgroundColor]
NvsEffectColor getBackgroundColor()
Get the current text background color value.
NvsVideoEffectCaption::isModular
BOOL isModular
whether the current caption is a modular caption
Definition: NvsVideoEffectCaption.h:121
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
NvsEffect
Special effects.
Definition: NvsEffect.h:46
-[NvsVideoEffectCaption getLetterSpacingType]
NvsVideoEffectLetterSpacingType getLetterSpacingType()
Gets caption word spacing type.
-[NvsVideoEffectCaption getFontFamily]
NSString * getFontFamily()
Gets the caption font.
NvsEffectVideoResolution
Video resolution.
Definition: NvsEffectCommonDef.h:39
-[NvsVideoEffectCaption getScaleY]
float getScaleY()
Gets the vertical scaling factor for the caption.
NvsVideoEffectCaption::outPoint
int64_t outPoint
The out point of the caption on the timeline (in microseconds)
Definition: NvsVideoEffectCaption.h:124
-[NvsVideoEffectCaption getPanoramicScaleY]
float getPanoramicScaleY()
Gets the vertical scaling factor for the caption. It's only valid for the panorama caption.
NvsVideoEffectLetterSpacingType
NvsVideoEffectLetterSpacingType
letter spacing type
Definition: NvsVideoEffectCaption.h:98
-[NvsVideoEffectCaption getTextPolarAngleRange]
float getTextPolarAngleRange()
Gets the ranging angle of the polar angle for the caption text. It's only valid for the panorama capt...
NvsVideoEffectRoleInThemeTitle
@ NvsVideoEffectRoleInThemeTitle
Title.
Definition: NvsVideoEffectCaption.h:41
NvsVideoEffectLetterSpacingTypeAbsolute
@ NvsVideoEffectLetterSpacingTypeAbsolute
Definition: NvsVideoEffectCaption.h:100
-[NvsVideoEffectCaption getDrawShadow]
BOOL getDrawShadow()
Gets the state of the current caption shadow.
NvsVideoEffectTextAlignmentRight
@ NvsVideoEffectTextAlignmentRight
Definition: NvsVideoEffectCaption.h:55
NvsVideoEffectRoleInThemeGeneral
@ NvsVideoEffectRoleInThemeGeneral
General.
Definition: NvsVideoEffectCaption.h:40
-[NvsVideoEffectCaption getFontFilePath]
NSString * getFontFilePath()
Gets the file path of the caption font.
-[NvsVideoEffectCaption getVerticalLayout]
BOOL getVerticalLayout()
Gets the state whether the caption is vertical layout.
-[NvsVideoEffectCaption getWeight]
int getWeight()
Gets the caption weight.
-[NvsVideoEffectCaption getText]
NSString * getText()
Gets the caption text.
NvsEffect.h
NvsVideoEffectUserCategory
@ NvsVideoEffectUserCategory
User-defined type.
Definition: NvsVideoEffectCaption.h:28
-[NvsVideoEffectCaption getShadowColor]
NvsEffectColor getShadowColor()
Gets the color of the caption shadow.
-[NvsVideoEffectCaption getPanoramicScaleX]
float getPanoramicScaleX()
Gets the horizontal scaling factor for the caption. It's only valid for the panorama caption.
NvsVideoEffectBoundingType_Text_Frame
@ NvsVideoEffectBoundingType_Text_Frame
Text frame bounding.
Definition: NvsVideoEffectCaption.h:85