MeiCam SDK For iOS  3.10.0
NvsCaption.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 "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 
984 - (void)setCenterPolarAngle:(float)centerPolarAngle;
985 
995 - (float)getCenterPolarAngle;
996 
1006 - (float)getTextCenterPolarAngle;
1007 
1017 - (void)setCenterAzimuthAngle:(float)centerAzimuthAngle;
1018 
1029 - (float)getCenterAzimuthAngle;
1030 
1040 - (float)getTextCenterAzimuthAngle;
1041 
1051 - (void)setPolarAngleRange:(float)polarAngleRange;
1052 
1062 - (float)getPolarAngleRange;
1063 
1073 - (float)getTextPolarAngleRange;
1074 
1084 - (float)getOrthoAngleRange;
1085 
1095 - (float)getTextOrthoAngleRange;
1096 
1106 - (void)setPanoramicScaleX:(float)scaleX;
1107 
1117 - (float)getPanoramicScaleX;
1118 
1128 - (void)setPanoramicScaleY:(float)scaleY;
1129 
1139 - (float)getPanoramicScaleY;
1140 
1150 - (void)setPanoramicRotation:(float)rotationAngle;
1151 
1161 - (float)getPanoramicRotation;
1162 
1172 - (void)setZValue:(float)value;
1173 
1183 - (float)getZValue;
1184 
1194 - (void)setRecordingUserOperation:(BOOL)recordingUserOperation;
1195 
1205 - (void)setOpacity:(float)opacity;
1206 
1216 - (float)getOpacity;
1217 
1228 - (void)setBackgroundColor:(const NvsColor *)backgroundColor;
1229 
1241 
1252 - (void)setBackgroundRadius:(float)radius;
1253 
1264 - (float)getBackgroundRadius;
1265 
1266 
1276 -(void)setBoundaryPaddingRatio:(float)ratio;
1277 
1287 -(float)getBoundaryPaddingRatio;
1288 
1299 - (void)setSecondaryColor:(const NvsColor *)color;
1300 
1312 
1323 - (void)setSecondaryOutlineColor:(const NvsColor *)color;
1324 
1336 
1345 - (void)setCurrentKeyFrameTime:(int64_t)time;
1346 
1359 - (bool)setControlPoint:(NSString *)fxParam controlPointPair:(NvsControlPointPair *)controlPointPair;
1360 
1373 - (NvsControlPointPair*)getControlPoint:(NSString*)fxParam;
1374 
1384 - (BOOL)isFrameCaption;
1385 
1396 - (void)setTextSpanList:(NSArray<NvsCaptionSpan *>*)storyboardCaptionSpanList;
1397 
1406 - (NSArray<NvsCaptionSpan *>*)getTextSpanList;
1407 
1417 
1427 
1438 - (BOOL)hasOutlineLayerInComplexRender:(int)layerIndex;
1439 
1450 - (NvsColor)getComplexRenderLayerOutlineColor:(int)layerIndex;
1451 
1464 - (BOOL)setComplexRenderLayerOutlineColor:(int)layerIndex color:(NvsColor)color;
1465 
1476 - (float)getComplexRenderLayerOutlineWidth:(int)layerIndex;
1477 
1490 - (BOOL)setComplexRenderLayerOutlineWidth:(int)layerIndex width:(float)width;
1491 
1502 - (float)getComplexRenderLayerOpacity:(int)layerIndex;
1503 
1516 - (BOOL)setComplexRenderLayerOpacity:(int)layerIndex opacity:(float)opacity;
1517 
1518 
1519 @end
-[NvsCaption getShadowOffset]
CGPoint getShadowOffset()
Gets the offset of the caption shadow.
-[NvsCaption getCenterPolarAngle]
float getCenterPolarAngle()
Gets the polar angle of the center point for the caption. It's only valid for the panorama caption.
-[NvsCaption getTextLayout]
NvsCaptionTextLayout * getTextLayout()
NvsRoleInTheme
NvsRoleInTheme
The role of the clip in the theme.
Definition: NvsCommonDef.h:121
-[NvsCaption getOrthoAngleRange]
float getOrthoAngleRange()
Gets the ranging angle which is perpendicular with the polar angle for the caption....
NvsCaption::modularCaptionAnimationPackageId
NSString * modularCaptionAnimationPackageId
The package ID of the modular caption animation style.
Definition: NvsCaption.h:42
NvsLetterSpacingType
NvsLetterSpacingType
letter spacing type
Definition: NvsCommonDef.h:150
NvsControlPointPair
Key frame control point pair structure.
Definition: NvsControlPointPair.h:27
NvsCaption::modularCaptionInAnimationPackageId
NSString * modularCaptionInAnimationPackageId
The package ID of the modular caption in-animation style.
Definition: NvsCaption.h:43
-[NvsCaption getModularCaptionOutAnimationDuration]
int getModularCaptionOutAnimationDuration()
Get modular caption out-animation duration.
NvsRect
Rectangle.
Definition: NvsCommonDef.h:292
-[NvsCaption getScaleY]
float getScaleY()
Gets the vertical scaling factor for the caption.
-[NvsCaption getLetterSpacing]
float getLetterSpacing()
Gets caption word spacing.
-[NvsCaption getDrawOutline]
BOOL getDrawOutline()
Gets the status whether the caption draws the outline.
-[NvsCaption getLetterSpacingType]
NvsLetterSpacingType getLetterSpacingType()
Gets caption word spacing type.
-[NvsCaption getModularCaptionInAnimationDuration]
int getModularCaptionInAnimationDuration()
Get modular caption in-animation duration.
-[NvsCaption getItalic]
BOOL getItalic()
Gets the state whether the caption font is italic.
-[NvsCaption getBoundaryPaddingRatio]
float getBoundaryPaddingRatio()
Gets the caption boundary padding ratio.
-[NvsCaption getVerticalLayout]
BOOL getVerticalLayout()
Gets the state whether the caption is vertical layout.
-[NvsCaption getTextVerticalAlignment]
NvsTextAlignment getTextVerticalAlignment()
Gets the caption vertical alignment method, valid for frame-caption only.
NvsCaption::modularCaptionRendererPackageId
NSString * modularCaptionRendererPackageId
The package ID of the modular caption render style.
Definition: NvsCaption.h:41
NvsBoundingType
NvsBoundingType
Definition: NvsCompoundCaption.h:32
-[NvsCaption resetOutlineColorState]
void resetOutlineColorState()
Resets the outlinecolor state of the caption text.
-[NvsCaption getText]
NSString * getText()
Gets the caption text.
NvsCaption::modularCaptionOutAnimationPackageId
NSString * modularCaptionOutAnimationPackageId
The package ID of the modular caption out-animation style.
Definition: NvsCaption.h:44
NvsFx
effect class.
Definition: NvsFx.h:83
-[NvsCaption getScaleX]
float getScaleX()
Gets the horizontal scaling factor for the caption.
-[NvsCaption getCaptionTranslation]
CGPoint getCaptionTranslation()
Gets the translation amount of the caption.
-[NvsCaption getOpacity]
float getOpacity()
Get the caption opacity.
-[NvsCaption getBackgroundColor]
NvsColor getBackgroundColor()
Get the current text background color value.
NvsCaption::isPanoramic
BOOL isPanoramic
Whether it is a panorama caption.
Definition: NvsCaption.h:35
-[NvsCaption getOutlineColor]
NvsColor getOutlineColor()
Gets the color of the outline for the caption.
NvsCaptionTextLayout.h
-[NvsCaption getAnchorPoint]
CGPoint getAnchorPoint()
Gets the caption anchor.
-[NvsCaption getDrawShadow]
BOOL getDrawShadow()
Gets the state of the current caption shadow.
-[NvsCaption getZValue]
float getZValue()
Gets the Z value of the caption.
-[NvsCaption getTextColor]
NvsColor getTextColor()
Gets the current color value of the caption font.
-[NvsCaption getUnderline]
BOOL getUnderline()
Gets the caption under line.
-[NvsCaption getTextCenterAzimuthAngle]
float getTextCenterAzimuthAngle()
Gets the azimuth angle of the center point for the caption text. It's only valid for the panorama cap...
NvsColor
Self-defined color.
Definition: NvsCommonDef.h:334
-[NvsCaption getModularCaptionAnimationPeroid]
int getModularCaptionAnimationPeroid()
Get modular caption Animation Peroid.
-[NvsCaption getBackgroundRadius]
float getBackgroundRadius()
Get the current text background rectangle's corner radius value.
-[NvsCaption getTextSpanList]
NSArray< NvsCaptionSpan * > * getTextSpanList()
-[NvsCaption getRotationZ]
float getRotationZ()
Gets the rotation angle for the caption.
-[NvsCaption resetTextColorState]
void resetTextColorState()
Resets the color state of the caption text.
NvsCaption
captions.
Definition: NvsCaption.h:34
NvsCaptionSpan
Definition: NvsCaptionSpan.h:45
-[NvsCaption getCenterAzimuthAngle]
float getCenterAzimuthAngle()
Gets the azimuth angle of the center point for the caption. It's only valid for the panorama caption.
NvsTextAlignment
NvsTextAlignment
Text alignment style.
Definition: NvsCommonDef.h:134
-[NvsCaption getShadowColor]
NvsColor getShadowColor()
Gets the color of the caption shadow.
-[NvsCaption getTextCenterPolarAngle]
float getTextCenterPolarAngle()
Gets the polar angle of the center point for the caption text. It's only valid for the panorama capti...
-[NvsCaption isFrameCaption]
BOOL isFrameCaption()
Gets whether the caption is a frame caption.
-[NvsCaption getBoundingRectangleVertices]
NSArray * getBoundingRectangleVertices()
Gets the vertex position of the original enclosing rectangle of the caption after transformation.
-[NvsCaption getComplexRenderLayerCount]
int getComplexRenderLayerCount()
Gets the number of complex caption layers.
NvsCaption::modularCaptionContextPackageId
NSString * modularCaptionContextPackageId
The package ID of the modular caption context style.
Definition: NvsCaption.h:40
-[NvsCaption getSecondaryColor]
NvsColor getSecondaryColor()
Gets the current color value of the caption.
-[NvsCaption getTextBoundingRect]
NvsRect getTextBoundingRect()
Gets the rectangle of the caption text.
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
NvsCaption::captionStylePackageId
NSString * captionStylePackageId
The package ID of the caption style.
Definition: NvsCaption.h:39
-[NvsCaption getSecondaryOutlineColor]
NvsColor getSecondaryOutlineColor()
Gets the current outline sencondary color value of the caption.
-[NvsCaption getFontFamily]
NSString * getFontFamily()
Gets the caption font.
NvsAssetDefaultParam
NvsAssetDefaultParam
Uses the default caption package.
Definition: NvsCommonDef.h:162
-[NvsCaption getWeight]
int getWeight()
Gets the caption weight.
-[NvsCaption getBold]
BOOL getBold()
Gets the state whether the caption font is bold.
-[NvsCaption getPanoramicScaleX]
float getPanoramicScaleX()
Gets the horizontal scaling factor for the caption. It's only valid for the panorama caption.
NvsCaption::roleInTheme
NvsRoleInTheme roleInTheme
The role of captions in the theme (general, title, and trailer.)
Definition: NvsCaption.h:37
-[NvsCaption getPanoramicScaleY]
float getPanoramicScaleY()
Gets the vertical scaling factor for the caption. It's only valid for the panorama caption.
-[NvsCaption getOutlineWidth]
float getOutlineWidth()
Gets the width of the outline for the caption.
NvsCaptionTextLayout
Definition: NvsCaptionTextLayout.h:16
-[NvsCaption getPolarAngleRange]
float getPolarAngleRange()
Gets the ranging angle of the polar angle for the caption. It's only valid for the panorama caption.
NvsCaptionSpan.h
-[NvsCaption getFontSize]
float getFontSize()
Gets the font size of the caption.
-[NvsCaption getTextAlignment]
NvsTextAlignment getTextAlignment()
Gets the caption horizontal alignment method.
-[NvsCaption getPanoramicRotation]
float getPanoramicRotation()
Gets the rotation angle for the caption. It's only valid for the panorama caption.
NvsFx.h
-[NvsCaption getTextOrthoAngleRange]
float getTextOrthoAngleRange()
Gets the ranging angle of which is perpendicular with the polar angle for the caption text....
-[NvsCaption getTextPolarAngleRange]
float getTextPolarAngleRange()
Gets the ranging angle of the polar angle for the caption text. It's only valid for the panorama capt...
NvsTimelineCompoundCaption.h
-[NvsCaption getFontFilePath]
NSString * getFontFilePath()
Gets the file path of the caption font.
-[NvsCaption getLineSpacing]
float getLineSpacing()
Gets caption line spacing.
NvsCategory
NvsCategory
The type of clip in theme.
Definition: NvsCommonDef.h:174
NvsCaption::category
NvsCategory category
Clip type.
Definition: NvsCaption.h:38
NvsCaption::isModular
BOOL isModular
whether the current caption is a modular caption
Definition: NvsCaption.h:36
-[NvsCaption getShadowFeather]
float getShadowFeather()
Gets the feathering degree of the caption shadow.