diff --git a/Source/Core/Core.h b/Source/Core/Core.h index 53644fe8a..972d0c426 100755 --- a/Source/Core/Core.h +++ b/Source/Core/Core.h @@ -65,6 +65,7 @@ struct per_item const activefilter Filter; const char* color; const int thickness; + const char* fillInfo { nullptr }; }; struct stream_info diff --git a/Source/Core/VideoCore.cpp b/Source/Core/VideoCore.cpp index 6602ea8be..8f74696a9 100644 --- a/Source/Core/VideoCore.cpp +++ b/Source/Core/VideoCore.cpp @@ -271,44 +271,44 @@ struct per_group VideoPerGroup [Group_VideoMax]= const struct per_item VideoPerItem [Item_VideoMax]= { //Y - { Group_Y, Group_VideoMax, "Y MIN", "lavfi.signalstats.YMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "gray", 1 }, - { Group_Y, Group_VideoMax, "Y LOW", "lavfi.signalstats.YLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "green", 2 }, - { Group_Y, Group_VideoMax, "Y AVG", "lavfi.signalstats.YAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "yellow", 3 }, - { Group_Y, Group_VideoMax, "Y HIGH", "lavfi.signalstats.YHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_Y, Group_VideoMax, "Y MAX", "lavfi.signalstats.YMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_Y, Group_VideoMax, "Y MIN", "lavfi.signalstats.YMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "silver", 1 }, + { Group_Y, Group_VideoMax, "Y LOW", "lavfi.signalstats.YLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkgreen", 1, "Y MIN;teal;0.2" }, + { Group_Y, Group_VideoMax, "Y AVG", "lavfi.signalstats.YAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "black", 1, "Y LOW;teal;0.8" }, + { Group_Y, Group_VideoMax, "Y HIGH", "lavfi.signalstats.YHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "lightgreen", 1, "Y AVG;teal;0.8" }, + { Group_Y, Group_VideoMax, "Y MAX", "lavfi.signalstats.YMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "gray", 1, "Y HIGH;teal;0.2" }, //U - { Group_U, Group_VideoMax, "U MIN", "lavfi.signalstats.UMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_U, Group_VideoMax, "U LOW", "lavfi.signalstats.ULOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_U, Group_VideoMax, "U AVG", "lavfi.signalstats.UAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_U, Group_VideoMax, "U HIGH", "lavfi.signalstats.UHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_U, Group_VideoMax, "U MAX", "lavfi.signalstats.UMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_U, Group_VideoMax, "U MIN", "lavfi.signalstats.UMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "silver", 1 }, + { Group_U, Group_VideoMax, "U LOW", "lavfi.signalstats.ULOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkblue", 1, "U MIN;darkblue;0.2" }, + { Group_U, Group_VideoMax, "U AVG", "lavfi.signalstats.UAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "black", 1, "U LOW;darkblue;0.8" }, + { Group_U, Group_VideoMax, "U HIGH", "lavfi.signalstats.UHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "lightblue", 1, "U AVG;darkblue;0.8" }, + { Group_U, Group_VideoMax, "U MAX", "lavfi.signalstats.UMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "gray", 1, "U HIGH;darkblue;0.2" }, //V - { Group_V, Group_VideoMax, "V MIN", "lavfi.signalstats.VMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_V, Group_VideoMax, "V LOW", "lavfi.signalstats.VLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_V, Group_VideoMax, "V AVG", "lavfi.signalstats.VAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_V, Group_VideoMax, "V HIGH", "lavfi.signalstats.VHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_V, Group_VideoMax, "V MAX", "lavfi.signalstats.VMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_V, Group_VideoMax, "V MIN", "lavfi.signalstats.VMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "silver", 1 }, + { Group_V, Group_VideoMax, "V LOW", "lavfi.signalstats.VLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkred", 1, "V MIN;darkred;0.2" }, + { Group_V, Group_VideoMax, "V AVG", "lavfi.signalstats.VAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "black", 1, "V LOW;darkred;0.8" }, + { Group_V, Group_VideoMax, "V HIGH", "lavfi.signalstats.VHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "pink", 1, "V AVG;darkred;0.8" }, + { Group_V, Group_VideoMax, "V MAX", "lavfi.signalstats.VMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "gray", 1, "V HIGH;darkred;0.2" }, //Diffs - { Group_VDiff, Group_Diffs, "V DIF", "lavfi.signalstats.VDIF", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_UDiff, Group_Diffs, "U DIF", "lavfi.signalstats.UDIF", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_YDiff, Group_Diffs, "Y DIF", "lavfi.signalstats.YDIF", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_VDiff, Group_Diffs, "V DIF", "lavfi.signalstats.VDIF", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkred", 1, "0;darkred;0.4" }, + { Group_UDiff, Group_Diffs, "U DIF", "lavfi.signalstats.UDIF", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkblue", 1, "0;darkblue;0.4" }, + { Group_YDiff, Group_Diffs, "Y DIF", "lavfi.signalstats.YDIF", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkgreen", 1, "0;teal;0.4" }, //Sat - { Group_Sat, Group_VideoMax, "SAT MIN", "lavfi.signalstats.SATMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_Sat, Group_VideoMax, "SAT LOW", "lavfi.signalstats.SATLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_Sat, Group_VideoMax, "SAT AVG", "lavfi.signalstats.SATAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_Sat, Group_VideoMax, "SAT HIGH", "lavfi.signalstats.SATHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_Sat, Group_VideoMax, "SAT MAX", "lavfi.signalstats.SATMAX", 0, true, 88.7, 118.2, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_Sat, Group_VideoMax, "SAT MIN", "lavfi.signalstats.SATMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "silver", 1, "0;white;1" }, + { Group_Sat, Group_VideoMax, "SAT LOW", "lavfi.signalstats.SATLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "lightred", 1, "SAT MIN;red;0.2" }, + { Group_Sat, Group_VideoMax, "SAT AVG", "lavfi.signalstats.SATAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "black", 1, "SAT LOW;red;0.4" }, + { Group_Sat, Group_VideoMax, "SAT HIGH", "lavfi.signalstats.SATHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkred", 1, "SAT AVG;red;0.6" }, + { Group_Sat, Group_VideoMax, "SAT MAX", "lavfi.signalstats.SATMAX", 0, true, 88.7, 118.2, ActiveFilter_Video_signalstats, "gray", 1, "SAT HIGH;red;0.8" }, //Hue - { Group_Hue, Group_VideoMax, "HUE MED", "lavfi.signalstats.HUEMED", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_Hue, Group_VideoMax, "HUE AVG", "lavfi.signalstats.HUEAVG", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_Hue, Group_VideoMax, "HUE MED", "lavfi.signalstats.HUEMED", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "orange", 1 }, + { Group_Hue, Group_VideoMax, "HUE AVG", "lavfi.signalstats.HUEAVG", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "purple", 1 }, //Others - { Group_TOUT, Group_VideoMax, "TOUT", "lavfi.signalstats.TOUT", 8, false, 0.005, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_VREP, Group_VideoMax, "VREP", "lavfi.signalstats.VREP", 8, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_BRNG, Group_VideoMax, "BRNG", "lavfi.signalstats.BRNG", 8, true, 0.05, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_TOUT, Group_VideoMax, "TOUT", "lavfi.signalstats.TOUT", 8, false, 0.005, DBL_MAX, ActiveFilter_Video_signalstats, "darkgray", 1, "0;whitesmoke;0.6" }, + { Group_VREP, Group_VideoMax, "VREP", "lavfi.signalstats.VREP", 8, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "purple", 1, "0;purple;0.6" }, + { Group_BRNG, Group_VideoMax, "BRNG", "lavfi.signalstats.BRNG", 8, true, 0.05, DBL_MAX, ActiveFilter_Video_signalstats, "black", 1, "0;yellow;0.6" }, //Bitdepths - { Group_YUVB, Group_VideoMax, "V Active Bits", "lavfi.signalstats.VBITDEPTH", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_YUVB, Group_VideoMax, "U Active Bits", "lavfi.signalstats.UBITDEPTH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, - { Group_YUVB, Group_VideoMax, "Y Active Bits", "lavfi.signalstats.YBITDEPTH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, + { Group_YUVB, Group_VideoMax, "V Active Bits", "lavfi.signalstats.VBITDEPTH", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkred", 1, "0;darkred;0.4" }, + { Group_YUVB, Group_VideoMax, "U Active Bits", "lavfi.signalstats.UBITDEPTH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkblue", 1, "0;darkblue;0.4" }, + { Group_YUVB, Group_VideoMax, "Y Active Bits", "lavfi.signalstats.YBITDEPTH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "darkgreen", 1, "0;teal;0.4" }, //Crop { Group_CropW, Group_VideoMax, "Crop Left", "lavfi.cropdetect.x1", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_cropdetect, nullptr, -1 }, { Group_CropW, Group_VideoMax, "Crop Right", "lavfi.cropdetect.x2", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_cropdetect, nullptr, -1 }, @@ -317,48 +317,48 @@ const struct per_item VideoPerItem [Item_VideoMax]= { Group_CropF, Group_VideoMax, "Crop Width", "lavfi.cropdetect.w", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_cropdetect, nullptr, -1 }, { Group_CropF, Group_VideoMax, "Crop Height", "lavfi.cropdetect.h", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_cropdetect, nullptr, -1 }, //MSEf - { Group_MSE, Group_VideoMax, "MSEf V", "lavfi.psnr.mse.v", 2, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, nullptr, -1 }, - { Group_MSE, Group_VideoMax, "MSEf U", "lavfi.psnr.mse.u", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, nullptr, -1 }, - { Group_MSE, Group_VideoMax, "MSEf Y", "lavfi.psnr.mse.y", 2, false, 1000, DBL_MAX, ActiveFilter_Video_Psnr, nullptr, -1 }, + { Group_MSE, Group_VideoMax, "MSEf V", "lavfi.psnr.mse.v", 2, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, "darkred", 1 }, + { Group_MSE, Group_VideoMax, "MSEf U", "lavfi.psnr.mse.u", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, "darkblue", 1 }, + { Group_MSE, Group_VideoMax, "MSEf Y", "lavfi.psnr.mse.y", 2, false, 1000, DBL_MAX, ActiveFilter_Video_Psnr, "darkgreen", 1 }, //PSNRf - { Group_PSNR, Group_VideoMax, "PSNRf V", "lavfi.psnr.psnr.v", 2, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, nullptr, -1 }, - { Group_PSNR, Group_VideoMax, "PSNRf U", "lavfi.psnr.psnr.u", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, nullptr, -1 }, - { Group_PSNR, Group_VideoMax, "PSNRf Y", "lavfi.psnr.psnr.y", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, nullptr, -1 }, + { Group_PSNR, Group_VideoMax, "PSNRf V", "lavfi.psnr.psnr.v", 2, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, "darkred", 1 }, + { Group_PSNR, Group_VideoMax, "PSNRf U", "lavfi.psnr.psnr.u", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, "darkblue", 1 }, + { Group_PSNR, Group_VideoMax, "PSNRf Y", "lavfi.psnr.psnr.y", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Psnr, "darkgreen", 1 }, //SSIMf - { Group_SSIM, Group_VideoMax, "SSIMf All", "lavfi.ssim.All", 2, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, nullptr, -1 }, - { Group_SSIM, Group_VideoMax, "SSIMf V", "lavfi.ssim.V", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, nullptr, -1 }, - { Group_SSIM, Group_VideoMax, "SSIMf U", "lavfi.ssim.U", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, nullptr, -1 }, - { Group_SSIM, Group_VideoMax, "SSIMf Y", "lavfi.ssim.Y", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, nullptr, -1 }, + { Group_SSIM, Group_VideoMax, "SSIMf All", "lavfi.ssim.All", 2, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, "black", 1 }, + { Group_SSIM, Group_VideoMax, "SSIMf V", "lavfi.ssim.V", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, "darkred", 1 }, + { Group_SSIM, Group_VideoMax, "SSIMf U", "lavfi.ssim.U", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, "darkblue", 1 }, + { Group_SSIM, Group_VideoMax, "SSIMf Y", "lavfi.ssim.Y", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Ssim, "darkgreen", 1 }, //IDET.single - { Group_IDET_S, Group_VideoMax, "s.bff", "lavfi.idet.single.bff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_S, Group_VideoMax, "s.tff", "lavfi.idet.single.tff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_S, Group_VideoMax, "s.prog", "lavfi.idet.single.progressive", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_S, Group_VideoMax, "s.und", "lavfi.idet.single.undetermined", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, + { Group_IDET_S, Group_VideoMax, "s.bff", "lavfi.idet.single.bff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "royalblue", 2, "0;royalblue;1" }, + { Group_IDET_S, Group_VideoMax, "s.tff", "lavfi.idet.single.tff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "gold", 2, "0;gold;1" }, + { Group_IDET_S, Group_VideoMax, "s.prog", "lavfi.idet.single.progressive", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "indigo", 2, "0;indigo;1" }, + { Group_IDET_S, Group_VideoMax, "s.und", "lavfi.idet.single.undetermined",2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "lightgray", 2, "0;lightgray;1" }, //IDET.multiple - { Group_IDET_M, Group_VideoMax, "m.bff", "lavfi.idet.multiple.bff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_M, Group_VideoMax, "m.tff", "lavfi.idet.multiple.tff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_M, Group_VideoMax, "m.prog", "lavfi.idet.multiple.progressive", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_M, Group_VideoMax, "m.und", "lavfi.idet.multiple.undetermined", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, + { Group_IDET_M, Group_VideoMax, "m.bff", "lavfi.idet.multiple.bff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "royalblue", 2, "0;royalblue;1" }, + { Group_IDET_M, Group_VideoMax, "m.tff", "lavfi.idet.multiple.tff", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "gold", 2, "0;gold;1" }, + { Group_IDET_M, Group_VideoMax, "m.prog", "lavfi.idet.multiple.progressive", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "indigo", 2, "0;indigo;1" }, + { Group_IDET_M, Group_VideoMax, "m.und", "lavfi.idet.multiple.undetermined",2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "lightgray", 2, "0;lightgray;1" }, //IDET.repeat - { Group_IDET_R, Group_VideoMax, "bottom", "lavfi.idet.repeated.bottom", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_R, Group_VideoMax, "top", "lavfi.idet.repeated.top", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, - { Group_IDET_R, Group_VideoMax, "neither", "lavfi.idet.repeated.neither", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, nullptr, -1 }, + { Group_IDET_R, Group_VideoMax, "bottom", "lavfi.idet.repeated.bottom",2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "royalblue", 2, "0;royalblue;1" }, + { Group_IDET_R, Group_VideoMax, "top", "lavfi.idet.repeated.top", 2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "gold", 2, "0;gold;1" }, + { Group_IDET_R, Group_VideoMax, "neither", "lavfi.idet.repeated.neither",2, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Idet, "lightgray", 2, "0;lightgray;1" }, //DEFL - { Group_DEFL, Group_VideoMax, "flicker", "lavfi.deflicker.relative_change", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Deflicker, nullptr, -1 }, + { Group_DEFL, Group_VideoMax, "flicker", "lavfi.deflicker.relative_change", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Deflicker, "olive", 1, "0;olive;0.6" }, //ENTR - { Group_ENTR, Group_VideoMax, "V ENT", "lavfi.entropy.normalized_entropy.normal.V", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Entropy, nullptr, -1 }, - { Group_ENTR, Group_VideoMax, "U ENT", "lavfi.entropy.normalized_entropy.normal.U", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Entropy, nullptr, -1 }, - { Group_ENTR, Group_VideoMax, "Y ENT", "lavfi.entropy.normalized_entropy.normal.Y", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_Entropy, nullptr, -1 }, + { Group_ENTR, Group_VideoMax, "V ENT", "lavfi.entropy.normalized_entropy.normal.V",5,false,DBL_MAX, DBL_MAX, ActiveFilter_Video_Entropy, "darkred", 1 }, + { Group_ENTR, Group_VideoMax, "U ENT", "lavfi.entropy.normalized_entropy.normal.U",5,false,DBL_MAX, DBL_MAX, ActiveFilter_Video_Entropy, "darkblue", 1 }, + { Group_ENTR, Group_VideoMax, "Y ENT", "lavfi.entropy.normalized_entropy.normal.Y",5,false,DBL_MAX, DBL_MAX, ActiveFilter_Video_Entropy, "darkgreen", 1 }, //ENTR-DIFF - { Group_ENTRD, Group_VideoMax, "V ENT DIF", "lavfi.entropy.normalized_entropy.diff.V", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_EntropyDiff, nullptr, -1 }, - { Group_ENTRD, Group_VideoMax, "U ENT DIF", "lavfi.entropy.normalized_entropy.diff.U", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_EntropyDiff, nullptr, -1 }, - { Group_ENTRD, Group_VideoMax, "Y ENT DIF", "lavfi.entropy.normalized_entropy.diff.Y", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_EntropyDiff, nullptr, -1 }, + { Group_ENTRD, Group_VideoMax,"V ENT DIF","lavfi.entropy.normalized_entropy.diff.V", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_EntropyDiff, "darkred", 1 }, + { Group_ENTRD, Group_VideoMax,"U ENT DIF","lavfi.entropy.normalized_entropy.diff.U", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_EntropyDiff, "darkblue", 1 }, + { Group_ENTRD, Group_VideoMax,"Y ENT DIF","lavfi.entropy.normalized_entropy.diff.Y", 5, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_EntropyDiff, "darkgreen", 1 }, // pkt_duration_time & pkt_size - { Group_pkt_duration_time, Group_VideoMax, "pkt_duration_time", "pkt_duration_time", 5, false, DBL_MAX, DBL_MAX, (activefilter) -1, nullptr, -1 }, - { Group_pkt_size, Group_VideoMax, "pkt_size", "pkt_size", 0, false, DBL_MAX, DBL_MAX, (activefilter) -1, nullptr, -1 }, + { Group_pkt_duration_time, Group_VideoMax, "pkt_duration_time", "pkt_duration_time", 5, false, DBL_MAX, DBL_MAX, (activefilter) -1, "black", 1, "0;lawngreen;0.6" }, + { Group_pkt_size, Group_VideoMax, "pkt_size", "pkt_size", 0, false, DBL_MAX, DBL_MAX, (activefilter) -1, "black", 1, "0;maroon;0.6" }, // block and blur detections - { Group_blockdetect, Group_VideoMax, "blockiness", "lavfi.block", 6, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_blockdetect, nullptr, -1 }, - { Group_blurdetect, Group_VideoMax, "blurriness", "lavfi.blur", 6, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_blurdetect, nullptr, -1 }, + { Group_blockdetect, Group_VideoMax, "blockiness", "lavfi.block", 6, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_blockdetect, "black", 1, "0;plum;0.6" }, + { Group_blurdetect, Group_VideoMax, "blurriness", "lavfi.blur", 6, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_blurdetect, "black", 1, "0;powderblue;0.6" }, // const std::size_t Group1; //Group // const std::size_t Group2; //Group diff --git a/Source/GUI/Plot.cpp b/Source/GUI/Plot.cpp index 2c0dbef7b..fdc1b0740 100644 --- a/Source/GUI/Plot.cpp +++ b/Source/GUI/Plot.cpp @@ -24,9 +24,11 @@ #include #include #include +#include #include "Core/FileInformation.h" #include +#include static double stepSize( double distance, int numSteps ) { @@ -250,7 +252,94 @@ class PlotCurve : public QwtPlotCurve { m_count = count; } + void setFillCurve(QwtPlotCurve* curve) { + m_fillCurve = curve; + } + + void setFillBaseLine(float value) { + m_fillBaseline = value; + } + + void setFillBrush(QBrush brush) { + m_fillBrush = brush; + } + protected: + virtual void drawCurve( QPainter* painter , int style, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& canvasRect, int from, int to ) const { + QwtPlotCurve::drawCurve(painter, style, xMap, yMap, canvasRect, from, to); + + if((m_fillBaseline || m_fillCurve) && !symbol()) + { + auto brush = m_fillBrush; + + if ( brush.style() == Qt::NoBrush ) + return; + + const bool doFit = ( testCurveAttribute( Fitted ) && curveFitter() ); + const bool doAlign = !doFit && QwtPainter::roundingAlignment( painter ); + + QwtPointMapper mapper; + + if ( doAlign ) + { + mapper.setFlag( QwtPointMapper::RoundPoints, true ); + mapper.setFlag( QwtPointMapper::WeedOutIntermediatePoints, + testPaintAttribute( FilterPointsAggressive ) ); + } + + mapper.setFlag( QwtPointMapper::WeedOutPoints, + testPaintAttribute( FilterPoints ) || + testPaintAttribute( FilterPointsAggressive ) ); + + mapper.setBoundingRect( canvasRect ); + QPolygonF polygon = mapper.toPolygonF( xMap, yMap, data(), from, to); + QPolygonF baselinePolygon; + if(m_fillCurve) + baselinePolygon = mapper.toPolygonF( xMap, yMap, m_fillCurve->data(), from, to); + else if(m_fillBaseline) { + const PlotSeriesData* plotSeriesData = static_cast(data()); + auto fromSample = plotSeriesData->sample(from); + auto toSample = plotSeriesData->sample(to); + + baselinePolygon += QPointF(xMap.transform(qreal(fromSample.x())), yMap.transform(m_fillBaseline.value())); + baselinePolygon += QPointF(xMap.transform(qreal(toSample.x())), yMap.transform(m_fillBaseline.value())); + } + + for(auto it = baselinePolygon.rbegin(); it != baselinePolygon.rend(); ++it) { + polygon += *it; + } + + if ( polygon.count() <= 2 ) // a line can't be filled + return; + + if ( !brush.color().isValid() ) + brush.setColor( this->pen().color() ); + + if ( testPaintAttribute(ClipPolygons) ) + { + const QRectF clipRect = qwtIntersectedClipRect( canvasRect, painter ); + QwtClipper::clipPolygonF( clipRect, polygon, true ); + } + + painter->save(); + + painter->setPen( Qt::NoPen ); + painter->setBrush( brush ); + + QwtPainter::drawPolygon( painter, polygon ); + + painter->restore(); + } + } + + virtual void fillCurve( QPainter *painter, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& canvasRect, QPolygonF& polygon) const { + QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon); + } + + virtual void drawLines(QPainter* p, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& canvasRect, int from, int to) const { + QwtPlotCurve::drawLines(p, xMap, yMap, canvasRect, from, to); + } + void drawSymbols(QPainter *p, const QwtSymbol &s, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const { QwtPointMapper mapper; @@ -287,6 +376,9 @@ class PlotCurve : public QwtPlotCurve { private: int m_index; int m_count; + QBrush m_fillBrush; + QwtPlotCurve* m_fillCurve { nullptr }; + std::optional m_fillBaseline; }; //*************************************************************************** @@ -506,6 +598,7 @@ Plot::Plot( size_t streamPos, size_t Type, size_t Group, const FileInformation* // curves m_curves.reserve(PerStreamType[m_type].PerGroup[m_group].Count); + QMap curvesByName; for( unsigned j = 0; j < PerStreamType[m_type].PerGroup[m_group].Count; ++j ) { @@ -536,6 +629,31 @@ Plot::Plot( size_t streamPos, size_t Type, size_t Group, const FileInformation* curve->attach( this ); m_curves += curve; + + curvesByName[item.Name] = curve; + } + + for( unsigned j = 0; j < PerStreamType[m_type].PerGroup[m_group].Count; ++j ) + { + auto item = PerStreamType[m_type].PerItem[PerStreamType[m_type].PerGroup[m_group].Start + j]; + if(item.fillInfo) { + auto splitted = QString(item.fillInfo).split(";"); + auto curveName = splitted[0]; + auto color = QColor(splitted[1]); + auto alpha = QString(splitted[2]).toFloat(); + + color.setAlphaF(alpha); + auto curve = curvesByName[item.Name]; + curve->setFillBrush(QBrush(color)); + + if(curvesByName.contains(curveName)) { + auto fillCurve = curvesByName[curveName]; + curve->setFillCurve(fillCurve); + } else { + auto fillValue = curveName.toFloat(); + curve->setFillBaseLine(fillValue); + } + } } PlotPicker* picker = new PlotPicker( this, &PerStreamType[m_type], m_group, &m_curves, fileInformation ); diff --git a/Source/GUI/PlotLegend.cpp b/Source/GUI/PlotLegend.cpp index 1f6d2eaf2..d61d73847 100644 --- a/Source/GUI/PlotLegend.cpp +++ b/Source/GUI/PlotLegend.cpp @@ -7,7 +7,9 @@ //--------------------------------------------------------------------------- #include "GUI/PlotLegend.h" +#include #include +#include #include #include @@ -23,9 +25,10 @@ PlotLegend::PlotLegend( QWidget *parent ): setMaxColumns( 1 ); setContentsMargins( 0, 0, 0, 0 ); - QLayout* layout = contentsWidget()->layout(); + QwtDynGridLayout* layout = qobject_cast (contentsWidget()->layout()); layout->setAlignment( Qt::AlignLeft | Qt::AlignTop ); - layout->setSpacing( 0 ); + layout->setSpacing(0); + layout->setExpandingDirections(Qt::Horizontal); QScrollArea *scrollArea = findChild(); if ( scrollArea ) @@ -51,11 +54,15 @@ PlotLegend::~PlotLegend() QWidget *PlotLegend::createWidget( const QwtLegendData &data ) const { QWidget *w = QwtLegend::createWidget( data ); + auto icon = data.icon(); + if(!icon.isNull()) + w->setMaximumHeight(10); QwtLegendLabel *label = dynamic_cast( w ); if ( label ) { label->setMargin( 0 ); + label->setContentsMargins(0, 0, 0, 0); } return w;