MeiCam SDK For iOS  3.15.0
NvsCaption.h
Go to the documentation of this file.
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()
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:131
-[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:160
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:371
-[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:44
-[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:413
-[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 getStrikeOut]
BOOL getStrikeOut()
Gets the caption strike out.
-[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:46
-[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:144
-[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:172
-[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:184
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.