Hello devvvvs,
can we please have a template for streams?
that’s it, thx
Hello devvvvs,
can we please have a template for streams?
that’s it, thx
yes woei.
perhaps a small guide on how to port a node from spread to stream would be just too perfect.
if your plugin is strictly doing per slice operation you can pretty much just use the last code example on the blog post.
in case you have to lookup slices non sequentially or bin size around you’d better stick with ispread…
but yes, a template would be nice. a porting guide could be difficult tough since ispread is a more multipurpose than istream
i’m trying to speed up a purely sequential node. it works already (like described here), but i fail with writing the output into a IOutStream FStreamOut.
for testing, i’m experimenting with that thing: https://github.com/sebllll/Addons/blob/master/plugins/ValueRound/ValueRoundNode.cs
well basically it should be like this:
var numSlicesToRead = ...;
// First set the length of the output stream
FStreamOut.Length = numSlicesToRead ;
using (var reader1 = FStreamIn.GetCyclicReader())
using (var writer = FStreamOut.GetWriter())
{
while (numSlicesToRead > 0)
{
// Read chunks of data
// Call your basic op on the data chunks and put results
// in a result buffer
// Write the result buffer to the output
writer.Write(buffer, 0, chunkSize);
// Decrease the number of slices to read by our chunk size
numSlicesToRead -= chunkSize;
}
}
I guess what’s unclear to me is:
IStream versus IOutStream and IInStream
Also you didn’t define what FStreamOut should be.