123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- class LoadVidResult {
- LoadVidResult({
- this.isSuccess = false,
- this.frameCount = 0,
- this.probeBase64,
- });
- String? probeBase64;
- int frameCount;
- bool isSuccess;
- factory LoadVidResult.fromJson(Map<String, dynamic> map) {
- return LoadVidResult(
- isSuccess: map['IsSuccess'],
- frameCount: map['FrameCount'],
- probeBase64: map["ProbeBase64"],
- );
- }
- }
- abstract class VidFrameProcessorBase {
- VidFrameProcessorBase(this.typeName);
- final String typeName;
- Map<String, dynamic> toJson() {
- return <String, dynamic>{};
- }
- String toJsonText() {
- final map = toJson();
- final values = map.values;
- final valuesTxt = values.join(',');
- return '$typeName|$valuesTxt';
- }
- }
- class VidFrameBrightnessProcessor extends VidFrameProcessorBase {
- VidFrameBrightnessProcessor(this.brightness) : super("Brightness");
- int brightness;
- factory VidFrameBrightnessProcessor.fromJson(Map<String, dynamic> map) {
- return VidFrameBrightnessProcessor(map['Brightness']);
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map["Brightness"] = brightness;
- return map;
- }
- }
- class VidFrameContrastProcessor extends VidFrameProcessorBase {
- VidFrameContrastProcessor(this.contrast) : super("Contrast");
- int contrast;
- factory VidFrameContrastProcessor.fromJson(Map<String, dynamic> map) {
- return VidFrameContrastProcessor(map['Contrast']);
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map["Contrast"] = contrast;
- return map;
- }
- }
- class GetVidFrameRequest {
- /// 获取Vid帧请求
- ///
- /// [name] Vid缓存文件名
- ///
- /// [index] 帧索引
- ///
- /// [processors] 图像处理器集合
- GetVidFrameRequest({
- required this.index,
- this.processors,
- });
- int index;
- List<VidFrameProcessorBase>? processors;
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['Index'] = index;
- if (processors != null) {
- map['Processors'] = processors!.map((e) => e.toJsonText()).toList();
- }
- return map;
- }
- }
- class GetVidFrameResult {
- GetVidFrameResult({
- this.isSuccess = false,
- this.frameBase64,
- });
- String? frameBase64;
- bool isSuccess;
- factory GetVidFrameResult.fromJson(Map<String, dynamic> map) {
- return GetVidFrameResult(
- isSuccess: map['IsSuccess'],
- frameBase64: map["FrameBase64"],
- );
- }
- }
|