public static FLBuffer ComputeUrnd(bool isArray, int size, bool initializeOnStart)
        {
            LazyLoadingFLBuffer info = null;

            if (!isArray)
            {
                info = new LazyLoadingFLBuffer(
                    root =>
                {
                    FLBuffer buf = new FLBuffer(
                        root.Instance,
                        CLAPI.CreateRandom(
                            root.InputSize,
                            new byte[] { 1, 1, 1, 1 },
                            RandomInstructionHelper
                            .Randombytesource,
                            true
                            ),
                        root.Dimensions.x,
                        root.Dimensions.y,
                        root.Dimensions.z,
                        "RandomBuffer"
                        );
                    buf.SetRoot(root);
                    return(buf);
                },
                    initializeOnStart
                    );
            }
            else
            {
                info = new LazyLoadingFLBuffer(
                    root =>
                {
                    FLBuffer buf = new FLBuffer(
                        root.Instance,
                        CLAPI.CreateRandom(
                            size,
                            new byte[] { 1, 1, 1, 1 },
                            RandomInstructionHelper
                            .Randombytesource,
                            true
                            ),
                        size,
                        1,
                        1,
                        "RandomBuffer"
                        );
                    buf.SetRoot(root);
                    return(buf);
                },
                    initializeOnStart
                    );
            }


            return(info);
        }
Ejemplo n.º 2
0
        public static FLBuffer ComputeRnd()
        {
            LazyLoadingFLBuffer info = new LazyLoadingFLBuffer(root =>
            {
                FLBuffer buf = new FLBuffer(root.Instance, CLAPI.CreateRandom(root.InputSize, new byte[] { 1, 1, 1, 1 },
                                                                              RandomInstructionHelper.Randombytesource, false), root.Dimensions.x, root.Dimensions.y,
                                            "RandomBuffer");
                buf.SetRoot(root);
                return(buf);
            });

            return(info);
        }