Revision 2fce34f4
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/DistortedObject.java | ||
---|---|---|
493 | 493 |
return mM.add(EffectNames.SCALE,scale); |
494 | 494 |
} |
495 | 495 |
|
496 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
497 |
/** |
|
498 |
* Scales the Object by one uniform factor in all 3 dimensions. Convenience function. |
|
499 |
* |
|
500 |
* @param scale The factor to scale all 3 dimensions with. |
|
501 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
502 |
*/ |
|
503 |
public long scale(float scale) |
|
504 |
{ |
|
505 |
return mM.add(EffectNames.SCALE, new Static3D(scale,scale,scale)); |
|
506 |
} |
|
507 |
|
|
496 | 508 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
497 | 509 |
/** |
498 | 510 |
* Rotates the Object by 'angle' degrees around the center. |
... | ... | |
511 | 523 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
512 | 524 |
/** |
513 | 525 |
* Rotates the Object by 'angle' degrees around the center. |
514 |
* Static axis of rotation is given by the last parameter.
|
|
526 |
* Here both angle and axis can dynamically change.
|
|
515 | 527 |
* |
516 | 528 |
* @param center Coordinates of the Point we are rotating around. |
517 | 529 |
* @param angleaxis Combined 4-tuple representing the (angle,axisX,axisY,axisZ). |
... | ... | |
551 | 563 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
552 | 564 |
// Fragment-based effects |
553 | 565 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
554 |
// MACROBLOCK |
|
555 | 566 |
/** |
556 |
* Creates macroblocks at and around point defined by the Dynamic2D and the Region. |
|
557 |
* Size of the macroblocks at any given time is returned by the Dynamic1D. |
|
567 |
* Creates macroblocks at and around point defined by the Region. |
|
558 | 568 |
* |
559 | 569 |
* @param size 1-dimensional Dynamic which, at any given time, returns the size of the macroblocks. |
560 | 570 |
* @param region Region this Effect is limited to. |
561 |
* Null here means 'apply the effect to the whole Object'. |
|
562 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the |
|
563 |
* current center of the effect. |
|
564 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
565 |
*/ |
|
566 |
public long macroblock(Dynamic1D size, Static4D region, Dynamic2D center) |
|
567 |
{ |
|
568 |
return mF.add(EffectNames.MACROBLOCK, size, region, center); |
|
569 |
} |
|
570 |
|
|
571 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
572 |
/** |
|
573 |
* Creates macroblocks at and around point defined by the Point2D and the Region. |
|
574 |
* Size of the macroblocks at any given time is returned by the Dynamic1D. |
|
575 |
* <p> |
|
576 |
* The difference between this and the previous method is that here the center of the Effect stays constant. |
|
577 |
* |
|
578 |
* @param size 1-dimensional Dynamic which, at any given time, returns the size of the macroblocks. |
|
579 |
* @param region Region this Effect is limited to. |
|
580 |
* Null here means 'apply the effect to the whole Object'. |
|
581 |
* @param center Center of the Effect. |
|
582 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
583 |
*/ |
|
584 |
public long macroblock(Dynamic1D size, Static4D region, Static2D center) |
|
585 |
{ |
|
586 |
return mF.add(EffectNames.MACROBLOCK, size, region, center); |
|
587 |
} |
|
588 |
|
|
589 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
590 |
/** |
|
591 |
* Creates macroblocks at and around point defined by the Dynamic2D and the Region. |
|
592 |
* <p> |
|
593 |
* The macroblocks change in size; at time 0 there are none, and after 'duration/2' milliseconds |
|
594 |
* they are of (pixels X pixels) size; after 'duration' milliseconds there are again none (i.e. their |
|
595 |
* size is 1X1, i.e. 1 pixel). |
|
596 |
* |
|
597 |
* @param pixels Maximum size, in pixels, of the Macroblocks we want to see. |
|
598 |
* @param region Region this Effect is limited to. |
|
599 |
* Null here means 'apply the effect to the whole Object'. |
|
600 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the |
|
601 |
* current center of the effect. |
|
602 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
603 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
604 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
605 |
*/ |
|
606 |
public long macroblock(int pixels, Static4D region, Dynamic2D center, int duration, float count) |
|
607 |
{ |
|
608 |
Dynamic1D di = new Dynamic1D(); |
|
609 |
di.setCount(count); |
|
610 |
di.setDuration(duration); |
|
611 |
di.add(new Static1D(1)); |
|
612 |
di.add(new Static1D(pixels)); |
|
613 |
|
|
614 |
return mF.add(EffectNames.MACROBLOCK, di, region, center); |
|
615 |
} |
|
616 |
|
|
617 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
618 |
/** |
|
619 |
* Creates macroblocks at and around point defined by the Point2D and the Region. |
|
620 |
* <p> |
|
621 |
* The macroblocks change in size; at time 0 there are none, and after 'duration/2' milliseconds |
|
622 |
* they are of (pixels X pixels) size; after 'duration' milliseconds there are again none (i.e. their |
|
623 |
* size is 1X1, i.e. 1 pixel). |
|
624 |
* <p> |
|
625 |
* The difference between this and the previous method is that here the center of the Effect stays constant. |
|
626 |
* |
|
627 |
* @param pixels Maximum size, in pixels, of the Macroblocks we want to see. |
|
628 |
* @param region Region this Effect is limited to. |
|
629 |
* Null here means 'apply the effect to the whole Object'. |
|
630 |
* @param center Center of the Effect. |
|
631 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
632 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
633 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
571 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
634 | 572 |
*/ |
635 |
public long macroblock(int pixels, Static4D region, Static2D center, int duration, float count)
|
|
573 |
public long macroblock(Data1D size, Data4D region)
|
|
636 | 574 |
{ |
637 |
Dynamic1D di = new Dynamic1D(); |
|
638 |
di.setCount(count); |
|
639 |
di.setDuration(duration); |
|
640 |
di.add(new Static1D(1)); |
|
641 |
di.add(new Static1D(pixels)); |
|
642 |
|
|
643 |
return mF.add(EffectNames.MACROBLOCK, di, region, center); |
|
575 |
return mF.add(EffectNames.MACROBLOCK, size, region); |
|
644 | 576 |
} |
645 | 577 |
|
646 | 578 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
647 | 579 |
/** |
648 | 580 |
* Creates macroblocks on the whole Object. |
649 |
* <p> |
|
650 |
* The macroblocks change in size; at time 0 there are none, and after 'duration/2' milliseconds |
|
651 |
* they are of (pixels X pixels) size; after 'duration' milliseconds there are again none (i.e. their |
|
652 |
* size is 1X1, i.e. 1 pixel). |
|
653 |
* <p> |
|
654 |
* The difference between this and the previous method is that here there is no masking Region; thus |
|
655 |
* there is also no center of the Effect. |
|
656 |
* |
|
657 |
* @param pixels Maximum size, in pixels, of the Macroblocks we want to see. |
|
658 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
659 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
660 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
581 |
* |
|
582 |
* @param size 1-dimensional Data which, at any given time, returns the size of the macroblocks. |
|
583 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
661 | 584 |
*/ |
662 |
public long macroblock(int pixels, int duration, float count)
|
|
585 |
public long macroblock(Data1D size)
|
|
663 | 586 |
{ |
664 |
Dynamic1D di = new Dynamic1D(); |
|
665 |
di.setCount(count); |
|
666 |
di.setDuration(duration); |
|
667 |
di.add(new Static1D(1)); |
|
668 |
di.add(new Static1D(pixels)); |
|
669 |
|
|
670 |
return mF.add(EffectNames.MACROBLOCK, di, null, mZero2D); |
|
587 |
return mF.add(EffectNames.MACROBLOCK, size); |
|
671 | 588 |
} |
672 | 589 |
|
673 | 590 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
674 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
675 |
// CHROMA |
|
676 | 591 |
/** |
677 | 592 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
678 | 593 |
* |
679 |
* @param blend 1-dimensional Dynamic that returns the level of blend a given pixel will be
|
|
594 |
* @param blend 1-dimensional Data that returns the level of blend a given pixel will be
|
|
680 | 595 |
* mixed with the next parameter 'color': pixel = (1-level)*pixel + level*color |
681 | 596 |
* @param color Color to mix. (1,0,0) is RED. |
682 |
* @param region Region this Effect is limited to. |
|
683 |
* Null here means 'apply the Effect to the whole Object'. |
|
684 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing |
|
685 |
* the current center of the effect. |
|
686 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
597 |
* @param region Region this Effect is limited to. |
|
598 |
* @param smooth If true, the level of 'blend' will smoothly fade out towards the edges of the region. |
|
599 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
687 | 600 |
*/ |
688 |
public long chroma(Dynamic1D blend, Static3D color, Static4D region, Dynamic2D center)
|
|
601 |
public long chroma(Data1D blend, Static3D color, Data4D region, boolean smooth)
|
|
689 | 602 |
{ |
690 |
return mF.add(EffectNames.CHROMA, blend, color, region, center);
|
|
603 |
return mF.add( smooth? EffectNames.SMOOTH_CHROMA:EffectNames.CHROMA, blend, color, region);
|
|
691 | 604 |
} |
692 | 605 |
|
693 | 606 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
694 | 607 |
/** |
695 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
696 |
* <p> |
|
697 |
* Here the center of the Effect stays constant. |
|
698 |
* |
|
699 |
* @param blend 1-dimensional Dynamic that returns the level of blend a given pixel will be |
|
608 |
* Makes the whole Object smoothly change all three of its RGB components. |
|
609 |
* |
|
610 |
* @param blend 1-dimensional Data that returns the level of blend a given pixel will be |
|
700 | 611 |
* mixed with the next parameter 'color': pixel = (1-level)*pixel + level*color |
701 | 612 |
* @param color Color to mix. (1,0,0) is RED. |
702 |
* @param region Region this Effect is limited to. |
|
703 |
* Null here means 'apply the Effect to the whole Object'. |
|
704 |
* @param center Center of the Effect. |
|
705 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
613 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
706 | 614 |
*/ |
707 |
public long chroma(Dynamic1D blend, Static3D color, Static4D region, Static2D center)
|
|
615 |
public long chroma(Data1D blend, Static3D color)
|
|
708 | 616 |
{ |
709 |
return mF.add(EffectNames.CHROMA, blend, color, region, center);
|
|
617 |
return mF.add(EffectNames.CHROMA, blend, color); |
|
710 | 618 |
} |
711 | 619 |
|
712 | 620 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
713 | 621 |
/** |
714 | 622 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
715 | 623 |
* |
716 |
* @param blend Level of blend a given pixel will be mixed with the next parameter 'color':
|
|
717 |
* pixel = (1-t)*pixel + t*color
|
|
718 |
* @param color Color to mix. (1,0,0) is RED.
|
|
624 |
* @param blendcolor 4-dimensional Data returning the 4-tuple (blend,R,G,B).
|
|
625 |
* Level of blend a given pixel will be mixed with the next parameter 'color':
|
|
626 |
* pixel = (1-t)*pixel + t*color
|
|
719 | 627 |
* @param region Region this Effect is limited to. |
720 |
* Null here means 'apply the Effect to the whole Object'. |
|
721 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the |
|
722 |
* current center of the effect. |
|
723 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
724 |
*/ |
|
725 |
public long chroma(float blend, Static3D color, Static4D region, Dynamic2D center) |
|
726 |
{ |
|
727 |
return mF.add(EffectNames.CHROMA, blend, color, region, center); |
|
728 |
} |
|
729 |
|
|
730 |
///// ////////////////////////////////////////////////////////////////////////////////////////////// |
|
731 |
/** |
|
732 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
733 |
* <p> |
|
734 |
* Here the center of the Effect stays constant. |
|
735 |
* |
|
736 |
* @param blend Level of blend a given pixel will be mixed with the next parameter 'color': |
|
737 |
* pixel = (1-t)*pixel + t*color |
|
738 |
* @param color Color to mix. (1,0,0) is RED. |
|
739 |
* @param region The Region this Effect is limited to. |
|
740 |
* Null here means 'apply the Effect to the whole Object'. |
|
741 |
* @param center Center of the Effect. |
|
742 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
743 |
*/ |
|
744 |
public long chroma(float blend, Static3D color, Static4D region, Static2D center) |
|
745 |
{ |
|
746 |
return mF.add(EffectNames.CHROMA, blend, color, region, center); |
|
747 |
} |
|
748 |
|
|
749 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
750 |
/** |
|
751 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
752 |
* <p> |
|
753 |
* Here the Effect applies to the whole Object. |
|
754 |
* |
|
755 |
* @param blend Level of blend a given pixel will be mixed with the next parameter 'color': |
|
756 |
* pixel = (1-t)*pixel + t*color |
|
757 |
* @param color Color to mix. (1,0,0) is RED. |
|
758 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
759 |
*/ |
|
760 |
public long chroma(float blend, Static3D color) |
|
761 |
{ |
|
762 |
return mF.add(EffectNames.CHROMA, blend, color, null, mZero2D); |
|
763 |
} |
|
764 |
|
|
765 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
766 |
/** |
|
767 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
768 |
* |
|
769 |
* See {@link #chroma(Dynamic1D, Static3D, Static4D, Dynamic2D)} |
|
628 |
* @param smooth If true, the level of 'blend' will smoothly fade out towards the edges of the region. |
|
629 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
770 | 630 |
*/ |
771 |
public long smooth_chroma(Dynamic1D blend, Static3D color, Static4D region, Dynamic2D center)
|
|
631 |
public long chroma(Data4D blendcolor, Data4D region, boolean smooth )
|
|
772 | 632 |
{ |
773 |
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center);
|
|
633 |
return mF.add( smooth? EffectNames.SMOOTH_CHROMA:EffectNames.CHROMA, blendcolor, region );
|
|
774 | 634 |
} |
775 | 635 |
|
776 | 636 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
777 | 637 |
/** |
778 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
779 |
* |
|
780 |
* See {@link #chroma(Dynamic1D, Static3D, Static4D, Static2D)} |
|
781 |
*/ |
|
782 |
public long smooth_chroma(Dynamic1D blend, Static3D color, Static4D region, Static2D center) |
|
783 |
{ |
|
784 |
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center); |
|
785 |
} |
|
786 |
|
|
787 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
788 |
/** |
|
789 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
790 |
* |
|
791 |
* See {@link #chroma(float, Static3D, Static4D, Dynamic2D)} |
|
638 |
* Makes the whole Object smoothly change all three of its RGB components. |
|
639 |
* |
|
640 |
* @param blendcolor 4-dimensional Data returning the 4-tuple (blend,R,G,B). |
|
641 |
* Level of blend a given pixel will be mixed with the next parameter 'color': |
|
642 |
* pixel = (1-t)*pixel + t*color |
|
643 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
792 | 644 |
*/ |
793 |
public long smooth_chroma(float blend, Static3D color, Static4D region, Dynamic2D center)
|
|
645 |
public long chroma(Data4D blendcolor)
|
|
794 | 646 |
{ |
795 |
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center);
|
|
647 |
return mF.add(EffectNames.CHROMA, blendcolor);
|
|
796 | 648 |
} |
797 | 649 |
|
798 | 650 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
799 |
/** |
|
800 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
801 |
* |
|
802 |
* See {@link #chroma(float, Static3D, Static4D, Static2D)} |
|
803 |
*/ |
|
804 |
public long smooth_chroma(float blend, Static3D color, Static4D region, Static2D center) |
|
805 |
{ |
|
806 |
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center); |
|
807 |
} |
|
808 |
|
|
809 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
810 |
/** |
|
811 |
* Makes a certain sub-region of the Object smoothly change all three of its RGB components. |
|
812 |
* |
|
813 |
* See {@link #chroma(float, Static3D)} |
|
814 |
*/ |
|
815 |
public long smooth_chroma(float blend, Static3D color) |
|
816 |
{ |
|
817 |
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, null, mZero2D); |
|
818 |
} |
|
819 |
|
|
820 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
821 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
822 |
// ALPHA |
|
823 | 651 |
/** |
824 | 652 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
825 | 653 |
* |
826 |
* @param alpha 1-dimensional Dynamic that returns the level of transparency we want to have at any given
|
|
654 |
* @param alpha 1-dimensional Data that returns the level of transparency we want to have at any given
|
|
827 | 655 |
* moment. |
828 | 656 |
* @param region Region this Effect is limited to. |
829 |
* Null here means 'apply the Effect to the whole Object'. |
|
830 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the |
|
831 |
* current center of the effect. |
|
657 |
* @param smooth If true, the level of 'alpha' will smoothly fade out towards the edges of the region. |
|
832 | 658 |
* @return ID of the effect added, or -1 if we failed to add one. |
833 | 659 |
*/ |
834 |
public long alpha(Dynamic1D alpha, Static4D region, Dynamic2D center)
|
|
660 |
public long alpha(Data1D alpha, Data4D region, boolean smooth)
|
|
835 | 661 |
{ |
836 |
return mF.add(EffectNames.ALPHA, alpha, region, center);
|
|
662 |
return mF.add( smooth? EffectNames.SMOOTH_ALPHA:EffectNames.ALPHA, alpha, region);
|
|
837 | 663 |
} |
838 | 664 |
|
839 | 665 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
840 | 666 |
/** |
841 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
842 |
* <p> |
|
843 |
* Here the center of the Effect stays constant. |
|
844 |
* |
|
845 |
* @param alpha 1-dimensional Dynamic that returns the level of transparency we want to have at any given |
|
846 |
* moment. |
|
847 |
* @param region Region this Effect is limited to. |
|
848 |
* Null here means 'apply the Effect to the whole Object'. |
|
849 |
* @param center Center of the Effect. |
|
850 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
667 |
* Makes the whole Object smoothly change its transparency level. |
|
668 |
* |
|
669 |
* @param alpha 1-dimensional Data that returns the level of transparency we want to have at any |
|
670 |
* given moment. |
|
671 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
851 | 672 |
*/ |
852 |
public long alpha(Dynamic1D alpha, Static4D region, Static2D center)
|
|
673 |
public long alpha(Data1D alpha)
|
|
853 | 674 |
{ |
854 |
return mF.add(EffectNames.ALPHA, alpha, region, center);
|
|
675 |
return mF.add(EffectNames.ALPHA, alpha); |
|
855 | 676 |
} |
856 | 677 |
|
857 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
678 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
858 | 679 |
/** |
859 |
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
|
680 |
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
|
860 | 681 |
* |
861 |
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to. |
|
862 |
* @param region Region this Effect is limited to. |
|
863 |
* Null here means 'apply the Effect to the whole Object'. |
|
864 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the |
|
865 |
* current center of the effect. |
|
866 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
867 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
868 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
682 |
* @param brightness 1-dimensional Data that returns the level of brightness we want to have |
|
683 |
* at any given moment. |
|
684 |
* @param region Region this Effect is limited to. |
|
685 |
* @param smooth If true, the level of 'brightness' will smoothly fade out towards the edges of the region. |
|
686 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
869 | 687 |
*/ |
870 |
public long alpha(float alpha, Static4D region, Dynamic2D center, int duration, float count)
|
|
688 |
public long brightness(Data1D brightness, Data4D region, boolean smooth)
|
|
871 | 689 |
{ |
872 |
Dynamic1D di = new Dynamic1D(); |
|
873 |
di.setCount(count); |
|
874 |
di.setDuration(duration); |
|
875 |
di.add(new Static1D(1)); |
|
876 |
di.add(new Static1D(alpha)); |
|
877 |
|
|
878 |
return mF.add(EffectNames.ALPHA, di, region, center); |
|
690 |
return mF.add( smooth ? EffectNames.SMOOTH_BRIGHTNESS: EffectNames.BRIGHTNESS, brightness, region); |
|
879 | 691 |
} |
880 | 692 |
|
881 | 693 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
882 | 694 |
/** |
883 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
884 |
* <p> |
|
885 |
* Here the center of the Effect stays constant. |
|
886 |
* |
|
887 |
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to. |
|
888 |
* @param region Region this Effect is limited to. |
|
889 |
* Null here means 'apply the Effect to the whole Object'. |
|
890 |
* @param center Center of the Effect. |
|
891 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
892 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
893 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
695 |
* Makes the whole Object smoothly change its brightness level. |
|
696 |
* |
|
697 |
* @param brightness 1-dimensional Data that returns the level of brightness we want to have |
|
698 |
* at any given moment. |
|
699 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
894 | 700 |
*/ |
895 |
public long alpha(float alpha, Static4D region, Static2D center, int duration, float count)
|
|
701 |
public long brightness(Data1D brightness)
|
|
896 | 702 |
{ |
897 |
Dynamic1D di = new Dynamic1D(); |
|
898 |
di.setCount(count); |
|
899 |
di.setDuration(duration); |
|
900 |
di.add(new Static1D(1)); |
|
901 |
di.add(new Static1D(alpha)); |
|
902 |
|
|
903 |
return mF.add(EffectNames.ALPHA, di, region, center); |
|
703 |
return mF.add(EffectNames.BRIGHTNESS, brightness); |
|
904 | 704 |
} |
905 | 705 |
|
906 | 706 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
907 | 707 |
/** |
908 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
909 |
* <p> |
|
910 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
911 |
* |
|
912 |
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to. |
|
913 |
* @param region Region this Effect is limited to. |
|
914 |
* Null here means 'apply the Effect to the whole Object'. |
|
915 |
* @param center Center of the Effect. |
|
916 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
917 |
*/ |
|
918 |
public long alpha(float alpha, Static4D region, Static2D center) |
|
919 |
{ |
|
920 |
Dynamic1D di = new Dynamic1D(); |
|
921 |
di.setCount(0.5f); |
|
922 |
di.setDuration(0); |
|
923 |
di.add(new Static1D(1)); |
|
924 |
di.add(new Static1D(alpha)); |
|
925 |
|
|
926 |
return mF.add(EffectNames.ALPHA, di, region, center); |
|
927 |
} |
|
928 |
|
|
929 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
930 |
/** |
|
931 |
* Makes the whole Object change its transparency level. |
|
932 |
* |
|
933 |
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to. |
|
934 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
935 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
936 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
937 |
*/ |
|
938 |
public long alpha(float alpha, int duration, float count) |
|
939 |
{ |
|
940 |
Dynamic1D di = new Dynamic1D(); |
|
941 |
di.setCount(count); |
|
942 |
di.setDuration(duration); |
|
943 |
di.add(new Static1D(1)); |
|
944 |
di.add(new Static1D(alpha)); |
|
945 |
|
|
946 |
return mF.add(EffectNames.ALPHA, di,null, mZero2D); |
|
947 |
} |
|
948 |
|
|
949 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
950 |
/** |
|
951 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
952 |
* |
|
953 |
* See {@link #alpha(Dynamic1D, Static4D, Dynamic2D)} |
|
708 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
709 |
* |
|
710 |
* @param contrast 1-dimensional Data that returns the level of contrast we want to have |
|
711 |
* at any given moment. |
|
712 |
* @param region Region this Effect is limited to. |
|
713 |
* @param smooth If true, the level of 'contrast' will smoothly fade out towards the edges of the region. |
|
714 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
954 | 715 |
*/ |
955 |
public long smooth_alpha(Dynamic1D alpha, Static4D region, Dynamic2D center)
|
|
716 |
public long contrast(Data1D contrast, Data4D region, boolean smooth)
|
|
956 | 717 |
{ |
957 |
return mF.add(EffectNames.SMOOTH_ALPHA, alpha, region, center);
|
|
718 |
return mF.add( smooth ? EffectNames.SMOOTH_CONTRAST:EffectNames.CONTRAST, contrast, region);
|
|
958 | 719 |
} |
959 | 720 |
|
960 | 721 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
961 | 722 |
/** |
962 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
963 |
* |
|
964 |
* See {@link #alpha(Dynamic1D, Static4D, Static2D)} |
|
965 |
*/ |
|
966 |
public long smooth_alpha(Dynamic1D alpha, Static4D region, Static2D center) |
|
967 |
{ |
|
968 |
return mF.add(EffectNames.SMOOTH_ALPHA, alpha, region, center); |
|
969 |
} |
|
970 |
|
|
971 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
972 |
/** |
|
973 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
974 |
* |
|
975 |
* See {@link #alpha(float, Static4D, Dynamic2D, int, float)} |
|
723 |
* Makes the whole Object smoothly change its contrast level. |
|
724 |
* |
|
725 |
* @param contrast 1-dimensional Data that returns the level of contrast we want to have |
|
726 |
* at any given moment. |
|
727 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
976 | 728 |
*/ |
977 |
public long smooth_alpha(float alpha, Static4D region, Dynamic2D center, int duration, float count)
|
|
729 |
public long contrast(Data1D contrast)
|
|
978 | 730 |
{ |
979 |
Dynamic1D di = new Dynamic1D(); |
|
980 |
di.setCount(count); |
|
981 |
di.setDuration(duration); |
|
982 |
di.add(new Static1D(1)); |
|
983 |
di.add(new Static1D(alpha)); |
|
984 |
|
|
985 |
return mF.add(EffectNames.SMOOTH_ALPHA, di, region, center); |
|
731 |
return mF.add(EffectNames.CONTRAST, contrast); |
|
986 | 732 |
} |
987 | 733 |
|
988 | 734 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
989 | 735 |
/** |
990 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
991 |
* |
|
992 |
* See {@link #alpha(float, Static4D, Static2D, int, float)} |
|
736 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
737 |
* |
|
738 |
* @param saturation 1-dimensional Data that returns the level of saturation we want to have |
|
739 |
* at any given moment. |
|
740 |
* @param region Region this Effect is limited to. |
|
741 |
* @param smooth If true, the level of 'saturation' will smoothly fade out towards the edges of the region. |
|
742 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
993 | 743 |
*/ |
994 |
public long smooth_alpha(float alpha, Static4D region, Static2D center, int duration, float count)
|
|
744 |
public long saturation(Data1D saturation, Data4D region, boolean smooth)
|
|
995 | 745 |
{ |
996 |
Dynamic1D di = new Dynamic1D(); |
|
997 |
di.setCount(count); |
|
998 |
di.setDuration(duration); |
|
999 |
di.add(new Static1D(1)); |
|
1000 |
di.add(new Static1D(alpha)); |
|
1001 |
|
|
1002 |
return mF.add(EffectNames.SMOOTH_ALPHA, di, region, center); |
|
746 |
return mF.add( smooth ? EffectNames.SMOOTH_SATURATION:EffectNames.SATURATION, saturation, region); |
|
1003 | 747 |
} |
1004 |
|
|
748 |
|
|
1005 | 749 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
1006 | 750 |
/** |
1007 |
* Makes a certain sub-region of the Object smoothly change its transparency level. |
|
1008 |
* |
|
1009 |
* See {@link #alpha(float, Static4D, Static2D)} |
|
751 |
* Makes the whole Object smoothly change its saturation level. |
|
752 |
* |
|
753 |
* @param saturation 1-dimensional Data that returns the level of saturation we want to have |
|
754 |
* at any given moment. |
|
755 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1010 | 756 |
*/ |
1011 |
public long smooth_alpha(float alpha, Static4D region, Static2D center)
|
|
757 |
public long saturation(Data1D saturation)
|
|
1012 | 758 |
{ |
1013 |
Dynamic1D di = new Dynamic1D(); |
|
1014 |
di.setCount(0.5f); |
|
1015 |
di.setDuration(0); |
|
1016 |
di.add(new Static1D(1)); |
|
1017 |
di.add(new Static1D(alpha)); |
|
1018 |
|
|
1019 |
return mF.add(EffectNames.SMOOTH_ALPHA, di, region, center); |
|
1020 |
} |
|
1021 |
|
|
1022 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1023 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1024 |
// BRIGHTNESS |
|
1025 |
/** |
|
1026 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1027 |
* |
|
1028 |
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have |
|
1029 |
* at any given moment. |
|
1030 |
* @param region Region this Effect is limited to. |
|
1031 |
* Null here means 'apply the Effect to the whole Object'. |
|
1032 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing |
|
1033 |
* the current center of the effect. |
|
1034 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1035 |
*/ |
|
1036 |
public long brightness(Dynamic1D brightness, Static4D region, Dynamic2D center) |
|
1037 |
{ |
|
1038 |
return mF.add(EffectNames.BRIGHTNESS, brightness, region, center); |
|
1039 |
} |
|
1040 |
|
|
1041 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1042 |
/** |
|
1043 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1044 |
* <p> |
|
1045 |
* Here the center of the Effect stays constant. |
|
1046 |
* |
|
1047 |
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have |
|
1048 |
* at any given moment. |
|
1049 |
* @param region Region this Effect is limited to. |
|
1050 |
* Null here means 'apply the Effect to the whole Object'. |
|
1051 |
* @param center Center of the Effect. |
|
1052 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1053 |
*/ |
|
1054 |
public long brightness(Dynamic1D brightness, Static4D region, Static2D center) |
|
1055 |
{ |
|
1056 |
return mF.add(EffectNames.BRIGHTNESS, brightness, region, center); |
|
1057 |
} |
|
1058 |
|
|
1059 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1060 |
/** |
|
1061 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1062 |
* |
|
1063 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1064 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1065 |
* anything more than 1- lighten it up. |
|
1066 |
* @param region Region this Effect is limited to. |
|
1067 |
* Null here means 'apply the Effect to the whole Object'. |
|
1068 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1069 |
* representing the current center of the effect. |
|
1070 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1071 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1072 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1073 |
*/ |
|
1074 |
public long brightness(float brightness, Static4D region, Dynamic2D center, int duration, float count) |
|
1075 |
{ |
|
1076 |
Dynamic1D di = new Dynamic1D(); |
|
1077 |
di.setCount(count); |
|
1078 |
di.setDuration(duration); |
|
1079 |
di.add(new Static1D(1)); |
|
1080 |
di.add(new Static1D(brightness)); |
|
1081 |
|
|
1082 |
return mF.add(EffectNames.BRIGHTNESS, di, region, center); |
|
1083 |
} |
|
1084 |
|
|
1085 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1086 |
/** |
|
1087 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1088 |
* <p> |
|
1089 |
* Here the center of the Effect stays constant. |
|
1090 |
* |
|
1091 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1092 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1093 |
* anything more than 1 - lighten it up. |
|
1094 |
* @param region Region this Effect is limited to. |
|
1095 |
* Null here means 'apply the Effect to the whole Object'. |
|
1096 |
* @param center Center of the Effect. |
|
1097 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1098 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1099 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1100 |
*/ |
|
1101 |
public long brightness(float brightness, Static4D region, Static2D center, int duration, float count) |
|
1102 |
{ |
|
1103 |
Dynamic1D di = new Dynamic1D(); |
|
1104 |
di.setCount(count); |
|
1105 |
di.setDuration(duration); |
|
1106 |
di.add(new Static1D(1)); |
|
1107 |
di.add(new Static1D(brightness)); |
|
1108 |
|
|
1109 |
return mF.add(EffectNames.BRIGHTNESS, di, region, center); |
|
1110 |
} |
|
1111 |
|
|
1112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1113 |
/** |
|
1114 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1115 |
* <p> |
|
1116 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
1117 |
* |
|
1118 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1119 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1120 |
* anything more than 1 - lighten it up. |
|
1121 |
* @param region Region this Effect is limited to. |
|
1122 |
* Null here means 'apply the Effect to the whole Object'. |
|
1123 |
* @param center Center of the Effect. |
|
1124 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1125 |
*/ |
|
1126 |
public long brightness(float brightness, Static4D region, Static2D center) |
|
1127 |
{ |
|
1128 |
Dynamic1D di = new Dynamic1D(); |
|
1129 |
di.setCount(0.5f); |
|
1130 |
di.setDuration(0); |
|
1131 |
di.add(new Static1D(1)); |
|
1132 |
di.add(new Static1D(brightness)); |
|
1133 |
|
|
1134 |
return mF.add(EffectNames.BRIGHTNESS, di, region, center); |
|
1135 |
} |
|
1136 |
|
|
1137 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1138 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1139 |
// SMOOTH BRIGHTNESS |
|
1140 |
/** |
|
1141 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1142 |
* |
|
1143 |
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have |
|
1144 |
* at any given moment. |
|
1145 |
* @param region Region this Effect is limited to. |
|
1146 |
* Null here means 'apply the Effect to the whole Object'. |
|
1147 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1148 |
* representing the current center of the effect. |
|
1149 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1150 |
*/ |
|
1151 |
public long smooth_brightness(Dynamic1D brightness, Static4D region, Dynamic2D center) |
|
1152 |
{ |
|
1153 |
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, brightness, region, center); |
|
1154 |
} |
|
1155 |
|
|
1156 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1157 |
/** |
|
1158 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1159 |
* <p> |
|
1160 |
* Here the center of the Effect stays constant. |
|
1161 |
* |
|
1162 |
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have |
|
1163 |
* at any given moment. |
|
1164 |
* @param region Region this Effect is limited to. |
|
1165 |
* Null here means 'apply the Effect to the whole Object'. |
|
1166 |
* @param center Center of the Effect. |
|
1167 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1168 |
*/ |
|
1169 |
public long smooth_brightness(Dynamic1D brightness, Static4D region, Static2D center) |
|
1170 |
{ |
|
1171 |
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, brightness, region, center); |
|
1172 |
} |
|
1173 |
|
|
1174 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1175 |
/** |
|
1176 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1177 |
* |
|
1178 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1179 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1180 |
* anything more than 1 - lighten it up. |
|
1181 |
* @param region Region this Effect is limited to. |
|
1182 |
* Null here means 'apply the Effect to the whole Object'. |
|
1183 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1184 |
* represention the current center of the effect. |
|
1185 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1186 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1187 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1188 |
*/ |
|
1189 |
public long smooth_brightness(float brightness, Static4D region, Dynamic2D center, int duration, float count) |
|
1190 |
{ |
|
1191 |
Dynamic1D di = new Dynamic1D(); |
|
1192 |
di.setCount(count); |
|
1193 |
di.setDuration(duration); |
|
1194 |
di.add(new Static1D(1)); |
|
1195 |
di.add(new Static1D(brightness)); |
|
1196 |
|
|
1197 |
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di, region, center); |
|
1198 |
} |
|
1199 |
|
|
1200 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1201 |
/** |
|
1202 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1203 |
* <p> |
|
1204 |
* Here the center of the Effect stays constant. |
|
1205 |
* |
|
1206 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1207 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1208 |
* anything more than 1 - lighten it up. |
|
1209 |
* @param region Region this Effect is limited to. |
|
1210 |
* Null here means 'apply the Effect to the whole Object'. |
|
1211 |
* @param center Center of the Effect. |
|
1212 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1213 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1214 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1215 |
*/ |
|
1216 |
public long smooth_brightness(float brightness, Static4D region, Static2D center, int duration, float count) |
|
1217 |
{ |
|
1218 |
Dynamic1D di = new Dynamic1D(); |
|
1219 |
di.setCount(count); |
|
1220 |
di.setDuration(duration); |
|
1221 |
di.add(new Static1D(1)); |
|
1222 |
di.add(new Static1D(brightness)); |
|
1223 |
|
|
1224 |
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di, region, center); |
|
1225 |
} |
|
1226 |
|
|
1227 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1228 |
/** |
|
1229 |
* Makes a certain sub-region of the Object smoothly change its brightness level. |
|
1230 |
* <p> |
|
1231 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
1232 |
* |
|
1233 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1234 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1235 |
* anything more than 1 - lighten it up. |
|
1236 |
* @param region Region this Effect is limited to. |
|
1237 |
* Null here means 'apply the Effect to the whole Object'. |
|
1238 |
* @param center Center of the Effect. |
|
1239 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1240 |
*/ |
|
1241 |
public long smooth_brightness(float brightness, Static4D region, Static2D center) |
|
1242 |
{ |
|
1243 |
Dynamic1D di = new Dynamic1D(); |
|
1244 |
di.setCount(0.5f); |
|
1245 |
di.setDuration(0); |
|
1246 |
di.add(new Static1D(1)); |
|
1247 |
di.add(new Static1D(brightness)); |
|
1248 |
|
|
1249 |
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di, region, center); |
|
1250 |
} |
|
1251 |
|
|
1252 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1253 |
/** |
|
1254 |
* Makes the whole Object change its brightness level. |
|
1255 |
* |
|
1256 |
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to. |
|
1257 |
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image', |
|
1258 |
* anything more than 1- lighten it up. |
|
1259 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1260 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1261 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1262 |
*/ |
|
1263 |
public long smooth_brightness(float brightness, int duration, float count) |
|
1264 |
{ |
|
1265 |
Dynamic1D di = new Dynamic1D(); |
|
1266 |
di.setCount(count); |
|
1267 |
di.setDuration(duration); |
|
1268 |
di.add(new Static1D(1)); |
|
1269 |
di.add(new Static1D(brightness)); |
|
1270 |
|
|
1271 |
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di,null, mZero2D); |
|
1272 |
} |
|
1273 |
|
|
1274 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1275 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1276 |
// CONTRAST |
|
1277 |
/** |
|
1278 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1279 |
* |
|
1280 |
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have |
|
1281 |
* at any given moment. |
|
1282 |
* @param region Region this Effect is limited to. |
|
1283 |
* Null here means 'apply the Effect to the whole Object'. |
|
1284 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1285 |
* representing the current center of the effect. |
|
1286 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1287 |
*/ |
|
1288 |
public long contrast(Dynamic1D contrast, Static4D region, Dynamic2D center) |
|
1289 |
{ |
|
1290 |
return mF.add(EffectNames.CONTRAST, contrast, region, center); |
|
1291 |
} |
|
1292 |
|
|
1293 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1294 |
/** |
|
1295 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1296 |
* <p> |
|
1297 |
* Here the center of the Effect stays constant. |
|
1298 |
* |
|
1299 |
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have |
|
1300 |
* at any given moment. |
|
1301 |
* @param region Region this Effect is limited to. |
|
1302 |
* Null here means 'apply the Effect to the whole Object'. |
|
1303 |
* @param center Center of the Effect. |
|
1304 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1305 |
*/ |
|
1306 |
public long contrast(Dynamic1D contrast, Static4D region, Static2D center) |
|
1307 |
{ |
|
1308 |
return mF.add(EffectNames.CONTRAST, contrast, region, center); |
|
1309 |
} |
|
1310 |
|
|
1311 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1312 |
/** |
|
1313 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1314 |
* |
|
1315 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1316 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1317 |
* anything more than 1 - increase the contrast. |
|
1318 |
* @param region Region this Effect is limited to. |
|
1319 |
* Null here means 'apply the Effect to the whole Object'. |
|
1320 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1321 |
* represention the current center of the effect. |
|
1322 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1323 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1324 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1325 |
*/ |
|
1326 |
public long contrast(float contrast, Static4D region, Dynamic2D center, int duration, float count) |
|
1327 |
{ |
|
1328 |
Dynamic1D di = new Dynamic1D(); |
|
1329 |
di.setCount(count); |
|
1330 |
di.setDuration(duration); |
|
1331 |
di.add(new Static1D(1)); |
|
1332 |
di.add(new Static1D(contrast)); |
|
1333 |
|
|
1334 |
return mF.add(EffectNames.CONTRAST, di, region, center); |
|
1335 |
} |
|
1336 |
|
|
1337 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1338 |
/** |
|
1339 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1340 |
* <p> |
|
1341 |
* Here the center of the Effect stays constant. |
|
1342 |
* |
|
1343 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1344 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1345 |
* anything more than 1 -increase the contrast. |
|
1346 |
* @param region Region this Effect is limited to. |
|
1347 |
* Null here means 'apply the Effect to the whole Object'. |
|
1348 |
* @param center Center of the Effect. |
|
1349 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1350 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1351 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1352 |
*/ |
|
1353 |
public long contrast(float contrast, Static4D region, Static2D center, int duration, float count) |
|
1354 |
{ |
|
1355 |
Dynamic1D di = new Dynamic1D(); |
|
1356 |
di.setCount(count); |
|
1357 |
di.setDuration(duration); |
|
1358 |
di.add(new Static1D(1)); |
|
1359 |
di.add(new Static1D(contrast)); |
|
1360 |
|
|
1361 |
return mF.add(EffectNames.CONTRAST, di, region, center); |
|
1362 |
} |
|
1363 |
|
|
1364 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1365 |
/** |
|
1366 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1367 |
* <p> |
|
1368 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
1369 |
* |
|
1370 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1371 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1372 |
* anything more than 1 - increase the contrast. |
|
1373 |
* @param region Region this Effect is limited to. |
|
1374 |
* Null here means 'apply the Effect to the whole Object'. |
|
1375 |
* @param center Center of the Effect. |
|
1376 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1377 |
*/ |
|
1378 |
public long contrast(float contrast, Static4D region, Static2D center) |
|
1379 |
{ |
|
1380 |
Dynamic1D di = new Dynamic1D(); |
|
1381 |
di.setCount(0.5f); |
|
1382 |
di.setDuration(0); |
|
1383 |
di.add(new Static1D(1)); |
|
1384 |
di.add(new Static1D(contrast)); |
|
1385 |
|
|
1386 |
return mF.add(EffectNames.CONTRAST, di, region, center); |
|
1387 |
} |
|
1388 |
|
|
1389 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1390 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1391 |
// SMOOTH CONTRAST |
|
1392 |
/** |
|
1393 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1394 |
* |
|
1395 |
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have |
|
1396 |
* at any given moment. |
|
1397 |
* @param region Region this Effect is limited to. |
|
1398 |
* Null here means 'apply the Effect to the whole Object'. |
|
1399 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1400 |
* representing the current center of the effect. |
|
1401 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1402 |
*/ |
|
1403 |
public long smooth_contrast(Dynamic1D contrast, Static4D region, Dynamic2D center) |
|
1404 |
{ |
|
1405 |
return mF.add(EffectNames.SMOOTH_CONTRAST, contrast, region, center); |
|
1406 |
} |
|
1407 |
|
|
1408 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1409 |
/** |
|
1410 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1411 |
* <p> |
|
1412 |
* Here the center of the Effect stays constant. |
|
1413 |
* |
|
1414 |
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have |
|
1415 |
* at any given moment. |
|
1416 |
* @param region Region this Effect is limited to. |
|
1417 |
* Null here means 'apply the Effect to the whole Object'. |
|
1418 |
* @param center Center of the Effect. |
|
1419 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1420 |
*/ |
|
1421 |
public long smooth_contrast(Dynamic1D contrast, Static4D region, Static2D center) |
|
1422 |
{ |
|
1423 |
return mF.add(EffectNames.SMOOTH_CONTRAST, contrast, region, center); |
|
759 |
return mF.add(EffectNames.SATURATION, saturation); |
|
1424 | 760 |
} |
1425 | 761 |
|
1426 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1427 |
/** |
|
1428 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1429 |
* |
|
1430 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1431 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1432 |
* anything more than 1 - increase the contrast. |
|
1433 |
* @param region Region this Effect is limited to. |
|
1434 |
* Null here means 'apply the Effect to the whole Object'. |
|
1435 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1436 |
* representing the current center of the effect. |
|
1437 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1438 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1439 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1440 |
*/ |
|
1441 |
public long smooth_contrast(float contrast, Static4D region, Dynamic2D center, int duration, float count) |
|
1442 |
{ |
|
1443 |
Dynamic1D di = new Dynamic1D(); |
|
1444 |
di.setCount(count); |
|
1445 |
di.setDuration(duration); |
|
1446 |
di.add(new Static1D(1)); |
|
1447 |
di.add(new Static1D(contrast)); |
|
1448 |
|
|
1449 |
return mF.add(EffectNames.SMOOTH_CONTRAST, di, region, center); |
|
1450 |
} |
|
1451 |
|
|
1452 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1453 |
/** |
|
1454 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1455 |
* <p> |
|
1456 |
* Here the center of the Effect stays constant. |
|
1457 |
* |
|
1458 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1459 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1460 |
* anything more than 1 - increase the contrast. |
|
1461 |
* @param region Region this Effect is limited to. |
|
1462 |
* Null here means 'apply the Effect to the whole Object'. |
|
1463 |
* @param center Center of the Effect. |
|
1464 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1465 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1466 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1467 |
*/ |
|
1468 |
public long smooth_contrast(float contrast, Static4D region, Static2D center, int duration, float count) |
|
1469 |
{ |
|
1470 |
Dynamic1D di = new Dynamic1D(); |
|
1471 |
di.setCount(count); |
|
1472 |
di.setDuration(duration); |
|
1473 |
di.add(new Static1D(1)); |
|
1474 |
di.add(new Static1D(contrast)); |
|
1475 |
|
|
1476 |
return mF.add(EffectNames.SMOOTH_CONTRAST, di, region, center); |
|
1477 |
} |
|
1478 |
|
|
1479 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1480 |
/** |
|
1481 |
* Makes a certain sub-region of the Object smoothly change its contrast level. |
|
1482 |
* <p> |
|
1483 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
1484 |
* |
|
1485 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1486 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1487 |
* anything more than 1 - increase the contrast. |
|
1488 |
* @param region Region this Effect is limited to. |
|
1489 |
* Null here means 'apply the Effect to the whole Object'. |
|
1490 |
* @param center Center of the Effect. |
|
1491 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1492 |
*/ |
|
1493 |
public long smooth_contrast(float contrast, Static4D region, Static2D center) |
|
1494 |
{ |
|
1495 |
Dynamic1D di = new Dynamic1D(); |
|
1496 |
di.setCount(0.5f); |
|
1497 |
di.setDuration(0); |
|
1498 |
di.add(new Static1D(1)); |
|
1499 |
di.add(new Static1D(contrast)); |
|
1500 |
|
|
1501 |
return mF.add(EffectNames.SMOOTH_CONTRAST, di, region, center); |
|
1502 |
} |
|
1503 |
|
|
1504 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1505 |
/** |
|
1506 |
* Makes the whole Object change its contrast level. |
|
1507 |
* |
|
1508 |
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to. |
|
1509 |
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast, |
|
1510 |
* anything more than 1 - increase the contrast. |
|
1511 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1512 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1513 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1514 |
*/ |
|
1515 |
public long smooth_contrast(float contrast, int duration, float count) |
|
1516 |
{ |
|
1517 |
Dynamic1D di = new Dynamic1D(); |
|
1518 |
di.setCount(count); |
|
1519 |
di.setDuration(duration); |
|
1520 |
di.add(new Static1D(1)); |
|
1521 |
di.add(new Static1D(contrast)); |
|
1522 |
|
|
1523 |
return mF.add(EffectNames.SMOOTH_CONTRAST, di,null, mZero2D); |
|
1524 |
} |
|
1525 |
|
|
1526 |
|
|
1527 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1528 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1529 |
// SATURATION |
|
1530 |
/** |
|
1531 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1532 |
* |
|
1533 |
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have |
|
1534 |
* at any given moment. |
|
1535 |
* @param region Region this Effect is limited to. |
|
1536 |
* Null here means 'apply the Effect to the whole Object'. |
|
1537 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1538 |
* representing the current center of the effect. |
|
1539 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1540 |
*/ |
|
1541 |
public long saturation(Dynamic1D saturation, Static4D region, Dynamic2D center) |
|
1542 |
{ |
|
1543 |
return mF.add(EffectNames.SATURATION, saturation, region, center); |
|
1544 |
} |
|
1545 |
|
|
1546 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1547 |
/** |
|
1548 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1549 |
* <p> |
|
1550 |
* Here the center of the Effect stays constant. |
|
1551 |
* |
|
1552 |
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have |
|
1553 |
* at any given moment. |
|
1554 |
* @param region Region this Effect is limited to. |
|
1555 |
* Null here means 'apply the Effect to the whole Object'. |
|
1556 |
* @param center Center of the Effect. |
|
1557 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1558 |
*/ |
|
1559 |
public long saturation(Dynamic1D saturation, Static4D region, Static2D center) |
|
1560 |
{ |
|
1561 |
return mF.add(EffectNames.SATURATION, saturation, region, center); |
|
1562 |
} |
|
1563 |
|
|
1564 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1565 |
/** |
|
1566 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1567 |
* |
|
1568 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1569 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1570 |
* anything more than 1 - increase the saturation. |
|
1571 |
* @param region Region this Effect is limited to. |
|
1572 |
* Null here means 'apply the Effect to the whole Object'. |
|
1573 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1574 |
* representing the current center of the effect. |
|
1575 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1576 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1577 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1578 |
*/ |
|
1579 |
public long saturation(float saturation, Static4D region, Dynamic2D center, int duration, float count) |
|
1580 |
{ |
|
1581 |
Dynamic1D di = new Dynamic1D(); |
|
1582 |
di.setCount(count); |
|
1583 |
di.setDuration(duration); |
|
1584 |
di.add(new Static1D(1)); |
|
1585 |
di.add(new Static1D(saturation)); |
|
1586 |
|
|
1587 |
return mF.add(EffectNames.SATURATION, di, region, center); |
|
1588 |
} |
|
1589 |
|
|
1590 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1591 |
/** |
|
1592 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1593 |
* <p> |
|
1594 |
* Here the center of the Effect stays constant. |
|
1595 |
* |
|
1596 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1597 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1598 |
* anything more than 1 - increase the saturation. |
|
1599 |
* @param region Region this Effect is limited to. |
|
1600 |
* Null here means 'apply the Effect to the whole Object'. |
|
1601 |
* @param center Center of the Effect. |
|
1602 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1603 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1604 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1605 |
*/ |
|
1606 |
public long saturation(float saturation, Static4D region, Static2D center, int duration, float count) |
|
1607 |
{ |
|
1608 |
Dynamic1D di = new Dynamic1D(); |
|
1609 |
di.setCount(count); |
|
1610 |
di.setDuration(duration); |
|
1611 |
di.add(new Static1D(1)); |
|
1612 |
di.add(new Static1D(saturation)); |
|
1613 |
|
|
1614 |
return mF.add(EffectNames.SATURATION, di, region, center); |
|
1615 |
} |
|
1616 |
|
|
1617 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1618 |
/** |
|
1619 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1620 |
* <p> |
|
1621 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
1622 |
* |
|
1623 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1624 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1625 |
* anything more than 1- increase the saturation. |
|
1626 |
* @param region Region this Effect is limited to. |
|
1627 |
* Null here means 'apply the Effect to the whole Object'. |
|
1628 |
* @param center Center of the Effect. |
|
1629 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1630 |
*/ |
|
1631 |
public long saturation(float saturation, Static4D region, Static2D center) |
|
1632 |
{ |
|
1633 |
Dynamic1D di = new Dynamic1D(); |
|
1634 |
di.setCount(0.5f); |
|
1635 |
di.setDuration(0); |
|
1636 |
di.add(new Static1D(1)); |
|
1637 |
di.add(new Static1D(saturation)); |
|
1638 |
|
|
1639 |
return mF.add(EffectNames.SATURATION, di, region, center); |
|
1640 |
} |
|
1641 |
|
|
1642 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1643 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1644 |
// SMOOTH_SATURATION |
|
1645 |
/** |
|
1646 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1647 |
* |
|
1648 |
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have |
|
1649 |
* at any given moment. |
|
1650 |
* @param region Region this Effect is limited to. |
|
1651 |
* Null here means 'apply the Effect to the whole Object'. |
|
1652 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1653 |
* representing the current center of the effect. |
|
1654 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1655 |
*/ |
|
1656 |
public long smooth_saturation(Dynamic1D saturation, Static4D region, Dynamic2D center) |
|
1657 |
{ |
|
1658 |
return mF.add(EffectNames.SMOOTH_SATURATION, saturation, region, center); |
|
1659 |
} |
|
1660 |
|
|
1661 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1662 |
/** |
|
1663 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1664 |
* <p> |
|
1665 |
* Here the center of the Effect stays constant. |
|
1666 |
* |
|
1667 |
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have |
|
1668 |
* at any given moment. |
|
1669 |
* @param region Region this Effect is limited to. |
|
1670 |
* Null here means 'apply the Effect to the whole Object'. |
|
1671 |
* @param center Center of the Effect. |
|
1672 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1673 |
*/ |
|
1674 |
public long smooth_saturation(Dynamic1D saturation, Static4D region, Static2D center) |
|
1675 |
{ |
|
1676 |
return mF.add(EffectNames.SMOOTH_SATURATION, saturation, region, center); |
|
1677 |
} |
|
1678 |
|
|
1679 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1680 |
/** |
|
1681 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1682 |
* |
|
1683 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1684 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1685 |
* anything more than 1 -increase the saturation. |
|
1686 |
* @param region Region this Effect is limited to. |
|
1687 |
* Null here means 'apply the Effect to the whole Object'. |
|
1688 |
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D |
|
1689 |
* representing the current center of the effect. |
|
1690 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1691 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1692 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1693 |
*/ |
|
1694 |
public long smooth_saturation(float saturation, Static4D region, Dynamic2D center, int duration, float count) |
|
1695 |
{ |
|
1696 |
Dynamic1D di = new Dynamic1D(); |
|
1697 |
di.setCount(count); |
|
1698 |
di.setDuration(duration); |
|
1699 |
di.add(new Static1D(1)); |
|
1700 |
di.add(new Static1D(saturation)); |
|
1701 |
|
|
1702 |
return mF.add(EffectNames.SMOOTH_SATURATION, di, region, center); |
|
1703 |
} |
|
1704 |
|
|
1705 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1706 |
/** |
|
1707 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1708 |
* <p> |
|
1709 |
* Here the center of the Effect stays constant. |
|
1710 |
* |
|
1711 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1712 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1713 |
* anything more than 1 - increase the saturation. |
|
1714 |
* @param region Region this Effect is limited to. |
|
1715 |
* Null here means 'apply the Effect to the whole Object'. |
|
1716 |
* @param center Center of the Effect. |
|
1717 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1718 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1719 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1720 |
*/ |
|
1721 |
public long smooth_saturation(float saturation, Static4D region, Static2D center, int duration, float count) |
|
1722 |
{ |
|
1723 |
Dynamic1D di = new Dynamic1D(); |
|
1724 |
di.setCount(count); |
|
1725 |
di.setDuration(duration); |
|
1726 |
di.add(new Static1D(1)); |
|
1727 |
di.add(new Static1D(saturation)); |
|
1728 |
|
|
1729 |
return mF.add(EffectNames.SMOOTH_SATURATION, di, region, center); |
|
1730 |
} |
|
1731 |
|
|
1732 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1733 |
/** |
|
1734 |
* Makes a certain sub-region of the Object smoothly change its saturation level. |
|
1735 |
* <p> |
|
1736 |
* Here the center of the Effect stays constant and the effect for now change in time. |
|
1737 |
* |
|
1738 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1739 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1740 |
* anything more than 1 - increase the saturation. |
|
1741 |
* @param region Region this Effect is limited to. |
|
1742 |
* Null here means 'apply the Effect to the whole Object'. |
|
1743 |
* @param center Center of the Effect. |
|
1744 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1745 |
*/ |
|
1746 |
public long smooth_saturation(float saturation, Static4D region, Static2D center) |
|
1747 |
{ |
|
1748 |
Dynamic1D di = new Dynamic1D(); |
|
1749 |
di.setCount(0.5f); |
|
1750 |
di.setDuration(0); |
|
1751 |
di.add(new Static1D(1)); |
|
1752 |
di.add(new Static1D(saturation)); |
|
1753 |
|
|
1754 |
return mF.add(EffectNames.SMOOTH_SATURATION, di, region, center); |
|
1755 |
} |
|
1756 |
|
|
1757 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1758 |
/** |
|
1759 |
* Makes the whole Object change its saturation level. |
|
1760 |
* |
|
1761 |
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to. |
|
1762 |
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation, |
|
1763 |
* anything more than 1 - increase the saturation. |
|
1764 |
* @param duration Time, in milliseconds, it takes to do one full interpolation. |
|
1765 |
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)} |
|
1766 |
* @return ID of the effect added, or -1 if we failed to add one. |
|
1767 |
*/ |
|
1768 |
public long smooth_saturation(float saturation, int duration, float count) |
|
1769 |
{ |
|
1770 |
Dynamic1D di = new Dynamic1D(); |
|
1771 |
di.setCount(count); |
|
1772 |
di.setDuration(duration); |
|
1773 |
di.add(new Static1D(1)); |
|
1774 |
di.add(new Static1D(saturation)); |
|
1775 |
|
|
1776 |
return mF.add(EffectNames.SMOOTH_SATURATION, di,null, mZero2D); |
|
1777 |
} |
|
1778 |
|
|
1779 | 762 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
1780 | 763 |
// Vertex-based effects |
1781 | 764 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Major push towards simplifying DistortedObject's public API.
All Fragment effects are using the new API - the 'DataND' marker interfaces.