TencentNavKit

TNKSnapShot.h
Go to the documentation of this file.
1//
2// TNKSnapShot.h
3// TencentNavKit
4//
5// Created by halldwang on 2025/12/1.
6// Copyright © 2025 Tencent. All rights reserved.
7//
8
9
10#import <Foundation/Foundation.h>
11#import <UIKit/UIKit.h>
12
13NS_ASSUME_NONNULL_BEGIN
14
18 typedef NS_ENUM(NSInteger, TNKSnapShotImageQuality) {
19 TNKSnapShotImageQualityHigh,
20 TNKSnapShotImageQualityMiddle,
21 TNKSnapShotImageQualityLow
22};
23
27 typedef NS_ENUM(NSInteger, TNKSnapShotImageFormat) {
28 TNKSnapShotImagePNG,
29 TNKSnapShotImageJPEG
30};
31
35 typedef NS_ENUM(NSInteger, TNKSnapShotOutputType) {
36 TNKSnapShotOutputTypeNSData,
37 TNKSnapShotOutputTypeUIImage
38};
39
43@interface TNKSnapShotConfig : NSObject
44
48@property (nonatomic, assign) CGFloat width;
49
53@property (nonatomic, assign) CGFloat height;
54
58@property (nonatomic, assign) NSInteger interval;
59
63@property (nonatomic, assign) TNKSnapShotImageQuality imageQuality;
64
68@property (nonatomic, assign) TNKSnapShotImageFormat imageFormat;
69
73@property (nonatomic, assign) TNKSnapShotOutputType outputType;
74
78@property (nonatomic, assign) NSInteger jpegQuality;
79
84@property (nonatomic, assign) BOOL usesStaticMap;
85
86@end
87
91@interface TNKSnapShotResult : NSObject
92
96@property (nonatomic, strong, readonly) id image;
97
101@property (nonatomic, assign, readonly) int64_t version;
102
106@property (nonatomic, assign, readonly) NSTimeInterval timestamp;
107
111@property (nonatomic, assign, readonly) BOOL changed;
112
113@end
114
115
116NS_ASSUME_NONNULL_END
NS_ENUM
NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, TNKSnapShotImageQuality)
图片质量
Definition: TNKSnapShot.h:18
TNKSnapShotConfig
截图配置类
Definition: TNKSnapShot.h:44
TNKSnapShotConfig::height
CGFloat height
截图区域宽，默认 256
Definition: TNKSnapShot.h:53
TNKSnapShotConfig::usesStaticMap
BOOL usesStaticMap
截图时使用静态图作为底图. 默认为NO 注意：启用时采用服务端渲染的方向绘制底图，会消耗较多流量.
Definition: TNKSnapShot.h:84
TNKSnapShotConfig::outputType
TNKSnapShotOutputType outputType
截图输出类型
Definition: TNKSnapShot.h:73
TNKSnapShotConfig::imageFormat
TNKSnapShotImageFormat imageFormat
图像格式，默认 TNKSnapShotImagePNG
Definition: TNKSnapShot.h:68
TNKSnapShotConfig::interval
NSInteger interval
截图的间隔（毫秒）默认 5000
Definition: TNKSnapShot.h:58
TNKSnapShotConfig::jpegQuality
NSInteger jpegQuality
JPEG压缩质量（0-100），默认 90，仅在imageFormat为JPEG时生效
Definition: TNKSnapShot.h:78
TNKSnapShotConfig::imageQuality
TNKSnapShotImageQuality imageQuality
像素质量，默认 TNKSnapShotImageQualityHigh
Definition: TNKSnapShot.h:63
TNKSnapShotConfig::width
CGFloat width
截图区域宽，默认 256
Definition: TNKSnapShot.h:48
TNKSnapShotResult
截图结果类
Definition: TNKSnapShot.h:92