Click here to Skip to main content
16,022,362 members

Comments by Armando Martínez González (Top 3 by date)

Armando Martínez González 26-Apr-12 2:14am View    
si matcom (Katrib Somoza Iskander) de que año tu eres?
Armando Martínez González 24-Apr-12 23:15pm View    
what i had in mind was to substitute the double for for a parallel for and call the following method instead i wasn't able to find out how to call a method inside a parallel for other than those who are void and accept a single int parameter as i said in the other reply to Leonardo Paneque i am almost certain i am missing something but i cat find what it is and also it si possible you just told me what to do but again my english is not that good

<pre lang="c#"> void CopyDepthToTexture(int x, ref int d, short[] data, CustomPixels.ARGB[,] depthBuffer, ref float lessSignificant, ref float middleSignificant, ref float moreSignificant)
{
//d = data[y * depthBuffer.GetLength(1) + x] >> DepthImageFrame.PlayerIndexBitmaskWidth;

d = data[x] >> DepthImageFrame.PlayerIndexBitmaskWidth;

lessSignificant = 0;
middleSignificant = 0;
moreSignificant = 0;

if (d != unknownDepth && d != tooFarDepth && d != tooNearDepth)
{
lessSignificant = (d % 64) / 64f;
middleSignificant = ((d / 64) % 64) / 64f;
moreSignificant = ((d / (64 * 64)) % 64) / 64f;
}

depthBuffer[x % depthBuffer.GetLength(0), x / depthBuffer.GetLength(0)] = new CustomPixels.ARGB(moreSignificant, middleSignificant, lessSignificant, 1);
}
}</pre>
Armando Martínez González 24-Apr-12 22:58pm View    
I tried to use parallel for but it can be done as far as i know only with a task<int> and i use alot of variables to do the code inside the for and task are static so no fields either i dont know how to get the variables i need in static method with just an int as a parameter i am almost certain i am missing something but i cat find what it is