Search in sources :

Example 11 with Envelope

use of org.jwildfire.envelope.Envelope in project JWildfire by thargor6.

the class MotionCurve method toEnvelope.

public Envelope toEnvelope() {
    Envelope res = new Envelope();
    res.setViewXMin(viewXMin);
    res.setViewXMax(viewXMax);
    res.setViewYMin(viewYMin);
    res.setViewYMax(viewYMax);
    res.setInterpolation(interpolation);
    res.setSelectedIdx(selectedIdx);
    res.setLocked(locked);
    int[] newX = new int[x.length];
    System.arraycopy(x, 0, newX, 0, x.length);
    double[] newY = new double[y.length];
    System.arraycopy(y, 0, newY, 0, y.length);
    res.setValues(newX, newY);
    return res;
}
Also used : Envelope(org.jwildfire.envelope.Envelope)

Example 12 with Envelope

use of org.jwildfire.envelope.Envelope in project JWildfire by thargor6.

the class ChannelMixerPanelDelegate method editCurve.

protected void editCurve(ActionEvent e) {
    Flame flame = owner.getOwner().getCurrFlame();
    MotionCurve curve = getCurve(flame);
    Envelope envelope = curve.toEnvelope();
    EnvelopeDialog dlg = new EnvelopeDialog(SwingUtilities.getWindowAncestor(rootPanel), owner.getErrorHandler(), envelope, false);
    dlg.setFlameToPreview(EnvelopeDialogFlamePreviewType.COLOR_CURVE, flame, curve);
    dlg.setTitle("Editing motion curve");
    dlg.setModal(true);
    dlg.setVisible(true);
    if (dlg.isConfirmed()) {
        if (owner.isUseUndoManager()) {
            owner.getOwner().undoManager.saveUndoPoint(flame);
        }
        curve.assignFromEnvelope(envelope);
        owner.getOwner().refreshFlameImage(true, false, 1, true, true);
        refreshCurve(flame);
    }
}
Also used : MotionCurve(org.jwildfire.create.tina.base.motion.MotionCurve) Envelope(org.jwildfire.envelope.Envelope) Flame(org.jwildfire.create.tina.base.Flame)

Aggregations

Envelope (org.jwildfire.envelope.Envelope)12 MotionCurve (org.jwildfire.create.tina.base.motion.MotionCurve)3 Parameter (org.jwildfire.script.Parameter)3 Flame (org.jwildfire.create.tina.base.Flame)2 File (java.io.File)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 SimpleImage (org.jwildfire.image.SimpleImage)1 Action (org.jwildfire.script.Action)1 ActionList (org.jwildfire.script.ActionList)1 ErrorHandler (org.jwildfire.swing.ErrorHandler)1