Search in sources :

Example 96 with XYZPoint

use of org.jwildfire.create.tina.base.XYZPoint in project JWildfire by thargor6.

the class CannabisCurveDOFBlurShape method prepare.

@Override
public void prepare(FlameTransformationContext pFlameTransformationContext, AbstractRandomGenerator pRandGen, double pCamDOF_10) {
    super.prepare(pFlameTransformationContext, pRandGen, pCamDOF_10);
    s = new XYZPoint();
    d = new XYZPoint();
    xform = new XForm();
    fnc = new CannabisCurveWFFunc();
    fnc.setParameter(CannabisCurveWFFunc.PARAM_FILLED, 1.0);
    fnc.init(pFlameTransformationContext, new Layer(), xform, 1.0);
}
Also used : XForm(org.jwildfire.create.tina.base.XForm) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) CannabisCurveWFFunc(org.jwildfire.create.tina.variation.CannabisCurveWFFunc) Layer(org.jwildfire.create.tina.base.Layer)

Example 97 with XYZPoint

use of org.jwildfire.create.tina.base.XYZPoint in project JWildfire by thargor6.

the class CloverleafDOFBlurShape method prepare.

@Override
public void prepare(FlameTransformationContext pFlameTransformationContext, AbstractRandomGenerator pRandGen, double pCamDOF_10) {
    super.prepare(pFlameTransformationContext, pRandGen, pCamDOF_10);
    s = new XYZPoint();
    d = new XYZPoint();
    xform = new XForm();
    fnc = new CloverLeafWFFunc();
    fnc.setParameter(CloverLeafWFFunc.PARAM_FILLED, 1.0);
    fnc.init(pFlameTransformationContext, new Layer(), xform, 1.0);
}
Also used : XForm(org.jwildfire.create.tina.base.XForm) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) CloverLeafWFFunc(org.jwildfire.create.tina.variation.CloverLeafWFFunc) Layer(org.jwildfire.create.tina.base.Layer)

Example 98 with XYZPoint

use of org.jwildfire.create.tina.base.XYZPoint in project JWildfire by thargor6.

the class FlowerDOFBlurShape method prepare.

@Override
public void prepare(FlameTransformationContext pFlameTransformationContext, AbstractRandomGenerator pRandGen, double pCamDOF_10) {
    super.prepare(pFlameTransformationContext, pRandGen, pCamDOF_10);
    s = new XYZPoint();
    d = new XYZPoint();
    xform = new XForm();
    fnc = new FlowerFunc();
    for (String paramName : getParamNames()) {
        fnc.setParameter(paramName, params.get(paramName));
    }
    fnc.init(pFlameTransformationContext, new Layer(), xform, 1.0);
}
Also used : FlowerFunc(org.jwildfire.create.tina.variation.FlowerFunc) XForm(org.jwildfire.create.tina.base.XForm) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) Layer(org.jwildfire.create.tina.base.Layer)

Example 99 with XYZPoint

use of org.jwildfire.create.tina.base.XYZPoint in project JWildfire by thargor6.

the class NBlurDOFBlurShape method prepare.

@Override
public void prepare(FlameTransformationContext pFlameTransformationContext, AbstractRandomGenerator pRandGen, double pCamDOF_10) {
    super.prepare(pFlameTransformationContext, pRandGen, pCamDOF_10);
    s = new XYZPoint();
    d = new XYZPoint();
    xform = new XForm();
    fnc = new NBlurFunc();
    for (String paramName : getParamNames()) {
        fnc.setParameter(paramName, params.get(paramName));
    }
    fnc.init(pFlameTransformationContext, new Layer(), xform, 1.0);
}
Also used : XForm(org.jwildfire.create.tina.base.XForm) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) Layer(org.jwildfire.create.tina.base.Layer) NBlurFunc(org.jwildfire.create.tina.variation.NBlurFunc)

Example 100 with XYZPoint

use of org.jwildfire.create.tina.base.XYZPoint in project JWildfire by thargor6.

the class AbstractColorMapWFFunc method transform.

public void transform(FlameTransformationContext pContext, XForm pXForm, XYZPoint pAffineTP, XYZPoint pVarTP, double pAmount, double pInputX, double pInputY) {
    double x = (pInputX - (offsetX + 0.5) + 1.0) / scaleX * (double) (imgWidth - 2);
    double y = (pInputY - (offsetY + 0.5) + 1.0) / scaleY * (double) (imgHeight - 2);
    int ix, iy;
    if (blend_colormap > 0) {
        ix = (int) MathLib.trunc(x);
        iy = (int) MathLib.trunc(y);
    } else {
        ix = Tools.FTOI(x);
        iy = Tools.FTOI(y);
    }
    if (this.tileX == 1) {
        if (ix < 0) {
            int nx = ix / imgWidth - 1;
            ix -= nx * imgWidth;
        } else if (ix >= imgWidth) {
            int nx = ix / imgWidth;
            ix -= nx * imgWidth;
        }
    }
    if (this.tileY == 1) {
        if (iy < 0) {
            int ny = iy / imgHeight - 1;
            iy -= ny * imgHeight;
        } else if (iy >= imgHeight) {
            int ny = iy / imgHeight;
            iy -= ny * imgHeight;
        }
    }
    double r, g, b;
    if (ix >= 0 && ix < imgWidth && iy >= 0 && iy < imgHeight) {
        if (colorMap instanceof SimpleImage) {
            if (blend_colormap > 0) {
                double iufrac = MathLib.frac(x);
                double ivfrac = MathLib.frac(y);
                toolPixel.setARGBValue(((SimpleImage) colorMap).getARGBValue(ix, iy));
                int lur = toolPixel.r;
                int lug = toolPixel.g;
                int lub = toolPixel.b;
                toolPixel.setARGBValue(((SimpleImage) colorMap).getARGBValue(ix + 1, iy));
                int rur = toolPixel.r;
                int rug = toolPixel.g;
                int rub = toolPixel.b;
                toolPixel.setARGBValue(((SimpleImage) colorMap).getARGBValue(ix, iy + 1));
                int lbr = toolPixel.r;
                int lbg = toolPixel.g;
                int lbb = toolPixel.b;
                toolPixel.setARGBValue(((SimpleImage) colorMap).getARGBValue(ix + 1, iy + 1));
                int rbr = toolPixel.r;
                int rbg = toolPixel.g;
                int rbb = toolPixel.b;
                r = GfxMathLib.blerp(lur, rur, lbr, rbr, iufrac, ivfrac);
                g = GfxMathLib.blerp(lug, rug, lbg, rbg, iufrac, ivfrac);
                b = GfxMathLib.blerp(lub, rub, lbb, rbb, iufrac, ivfrac);
            } else {
                toolPixel.setARGBValue(((SimpleImage) colorMap).getARGBValue(ix, iy));
                r = toolPixel.r;
                g = toolPixel.g;
                b = toolPixel.b;
            }
            if (dc_color > 0) {
                pVarTP.rgbColor = true;
                pVarTP.redColor = r;
                pVarTP.greenColor = g;
                pVarTP.blueColor = b;
            }
        } else {
            if (blend_colormap > 0) {
                double iufrac = MathLib.frac(x);
                double ivfrac = MathLib.frac(y);
                ((SimpleHDRImage) colorMap).getRGBValues(rgbArray, ix, iy);
                double lur = rgbArray[0];
                double lug = rgbArray[1];
                double lub = rgbArray[2];
                ((SimpleHDRImage) colorMap).getRGBValues(rgbArray, ix + 1, iy);
                double rur = rgbArray[0];
                double rug = rgbArray[1];
                double rub = rgbArray[2];
                ((SimpleHDRImage) colorMap).getRGBValues(rgbArray, ix, iy + 1);
                double lbr = rgbArray[0];
                double lbg = rgbArray[1];
                double lbb = rgbArray[2];
                ((SimpleHDRImage) colorMap).getRGBValues(rgbArray, ix + 1, iy + 1);
                double rbr = rgbArray[0];
                double rbg = rgbArray[1];
                double rbb = rgbArray[2];
                r = GfxMathLib.blerp(lur, rur, lbr, rbr, iufrac, ivfrac);
                g = GfxMathLib.blerp(lug, rug, lbg, rbg, iufrac, ivfrac);
                b = GfxMathLib.blerp(lub, rub, lbb, rbb, iufrac, ivfrac);
            } else {
                ((SimpleHDRImage) colorMap).getRGBValues(rgbArray, ix, iy);
                r = rgbArray[0];
                g = rgbArray[1];
                b = rgbArray[2];
            }
            if (dc_color > 0) {
                pVarTP.rgbColor = true;
                pVarTP.redColor = r;
                pVarTP.greenColor = g;
                pVarTP.blueColor = b;
            }
        }
    } else {
        r = g = b = 0.0;
        if (dc_color > 0) {
            pVarTP.rgbColor = true;
            pVarTP.redColor = r;
            pVarTP.greenColor = g;
            pVarTP.blueColor = b;
        }
    }
    double dz = this.offsetZ;
    if (fabs(scaleZ) > EPSILON) {
        double intensity = (0.299 * r + 0.588 * g + 0.113 * b) / 255.0;
        dz += scaleZ * intensity;
    }
    if (resetZ != 0) {
        pVarTP.z = dz;
    } else {
        pVarTP.z += dz;
    }
    if (dc_color > 0) {
        pVarTP.color = getColorIdx(Tools.FTOI(r), Tools.FTOI(g), Tools.FTOI(b));
    }
}
Also used : SimpleHDRImage(org.jwildfire.image.SimpleHDRImage) SimpleImage(org.jwildfire.image.SimpleImage) XYZPoint(org.jwildfire.create.tina.base.XYZPoint)

Aggregations

XYZPoint (org.jwildfire.create.tina.base.XYZPoint)102 XForm (org.jwildfire.create.tina.base.XForm)16 Layer (org.jwildfire.create.tina.base.Layer)13 Test (org.junit.Test)4 VectorD (org.jwildfire.base.mathlib.VecMathLib.VectorD)4 Flame (org.jwildfire.create.tina.base.Flame)4 ZigguratRandomGenerator (org.jwildfire.create.tina.random.ZigguratRandomGenerator)4 FlameRenderer (org.jwildfire.create.tina.render.FlameRenderer)4 SimpleHDRImage (org.jwildfire.image.SimpleHDRImage)4 SimpleImage (org.jwildfire.image.SimpleImage)4 Complex (org.jwildfire.base.mathlib.Complex)2 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)2 Face (org.jwildfire.create.tina.variation.mesh.Face)2 Vertex (org.jwildfire.create.tina.variation.mesh.Vertex)2 VertexWithUV (org.jwildfire.create.tina.variation.mesh.VertexWithUV)2 RenderColor (org.jwildfire.create.tina.palette.RenderColor)1 CannabisCurveWFFunc (org.jwildfire.create.tina.variation.CannabisCurveWFFunc)1 CloverLeafWFFunc (org.jwildfire.create.tina.variation.CloverLeafWFFunc)1 DCPerlinFunc (org.jwildfire.create.tina.variation.DCPerlinFunc)1 FlowerFunc (org.jwildfire.create.tina.variation.FlowerFunc)1