Lines Matching refs:tresh
618 /// Cuts the parts having less than tresh coverage.
619 void FloatLigne::Min(FloatLigne *a, float tresh, bool addIt)
632 if ( runA.vst <= tresh ) {
633 if ( runA.ven <= tresh ) {
639 AddRun(lastStart, lastEnd, tresh, tresh);
650 float cutPos = (runA.st * (tresh - runA.ven) + runA.en * (runA.vst - tresh)) / (runA.vst - runA.ven);
654 AddRun(lastStart, cutPos, tresh, tresh);
656 AddRun(cutPos,runA.en, tresh, runA.ven);
659 AddRun(lastStart, lastEnd, tresh, tresh);
662 AddRun(runA.st, cutPos, tresh, tresh);
664 AddRun(cutPos, runA.en, tresh, runA.ven);
668 AddRun(runA.st, cutPos, tresh, tresh);
670 AddRun(cutPos, runA.en, tresh, runA.ven);
677 if ( runA.ven <= tresh ) {
678 float cutPos = (runA.st * (runA.ven - tresh) + runA.en * (tresh - runA.vst)) / (runA.ven - runA.vst);
681 AddRun(lastStart, lastEnd, tresh, tresh);
684 AddRun(runA.st, cutPos, runA.vst, tresh);
691 AddRun(lastStart, lastEnd, tresh, tresh);
702 AddRun(lastStart, lastEnd, tresh, tresh);
710 * over will receive the parts where coverage > tresh, while the present
711 * FloatLigne will receive the parts where coverage <= tresh.
713 void FloatLigne::Split(FloatLigne *a, float tresh, FloatLigne *over)
722 if ( runA.vst >= tresh ) {
723 if ( runA.ven >= tresh ) {
728 float cutPos = (runA.st * (tresh - runA.ven) + runA.en * (runA.vst - tresh)) / (runA.vst - runA.ven);
730 over->AddRun(runA.st, cutPos, runA.vst, tresh);
732 AddRun(cutPos, runA.en, tresh, runA.ven);
735 if ( runA.ven >= tresh ) {
736 float cutPos = (runA.st * (runA.ven - tresh) + runA.en * (tresh-runA.vst)) / (runA.ven - runA.vst);
737 AddRun(runA.st, cutPos, runA.vst, tresh);
739 over->AddRun(cutPos, runA.en, tresh, runA.ven);
749 * Clips the coverage runs to tresh.
752 * tresh. If addIt == true, it's the coverage clamped to tresh.
754 void FloatLigne::Max(FloatLigne *a, float tresh, bool addIt)
766 if ( runA.vst >= tresh ) {
767 if ( runA.ven >= tresh ) {
773 AddRun(lastStart,lastEnd,tresh,tresh);
784 float cutPos = (runA.st * (tresh - runA.ven) + runA.en * (runA.vst - tresh)) / (runA.vst - runA.ven);
788 AddRun(lastStart, cutPos, tresh, tresh);
790 AddRun(cutPos, runA.en, tresh, runA.ven);
793 AddRun(lastStart, lastEnd, tresh, tresh);
796 AddRun(runA.st, cutPos, tresh, tresh);
798 AddRun(cutPos, runA.en, tresh, runA.ven);
802 AddRun(runA.st, cutPos, tresh, tresh);
804 AddRun(cutPos, runA.en, tresh, runA.ven);
811 if ( runA.ven >= tresh ) {
812 float cutPos = (runA.st * (runA.ven - tresh) + runA.en * (tresh - runA.vst)) / (runA.ven - runA.vst);
815 AddRun(lastStart,lastEnd,tresh,tresh);
818 AddRun(runA.st, cutPos, runA.vst, tresh);
825 AddRun(lastStart,lastEnd,tresh,tresh);
836 AddRun(lastStart, lastEnd, tresh, tresh);
841 /// Extract the parts where coverage > tresh.
842 void FloatLigne::Over(FloatLigne *a, float tresh)
855 if ( runA.vst >= tresh ) {
856 if ( runA.ven >= tresh ) {
861 AddRun(lastStart, lastEnd, tresh, tresh);
873 float cutPos = (runA.st * (tresh - runA.ven) + runA.en * (runA.vst - tresh)) / (runA.vst - runA.ven);
876 AddRun(lastStart, cutPos, tresh, tresh);
878 AddRun(lastStart, lastEnd, tresh, tresh);
879 AddRun(runA.st, cutPos, tresh, tresh);
882 AddRun(runA.st, cutPos, tresh, tresh);
888 if ( runA.ven >= tresh ) {
889 float cutPos = (runA.st * (runA.ven - tresh) + runA.en * (tresh - runA.vst)) / (runA.ven - runA.vst);
891 AddRun(lastStart, lastEnd, tresh, tresh);
898 AddRun(lastStart, lastEnd, tresh, tresh);
906 AddRun(lastStart, lastEnd, tresh, tresh);