Xtensity
2010-07-11 00:41:05
Basically I'm taking a T2DIntegerArray of an image. The reason I don't use a T2DPointArray is because I need to store the color located at each pixel.
I'm having trouble creating a function that sorts the T2DIntegerArray; based on a specific value in each TIntegerArray;…..
Meaning, I want to make it so, all points of the same color are grouped together in the array…. So when I run through the array, it does all of the same colors at once so it isn't changing. If you still don't understand what I'm saying… I want this:
T2DIA:T2DIntegerArray;
to be resorted like this:
Except on a larger scale of around 40,000+ pixels… the above example only has 5 for simplicity of comprehension. I've been trying to create a function to do this for the past 7 or so hours but all my attempts have failed. One method I was thinking of was trying to integrate bubblesort into the function somehow, though it is really stumping me.
Any clues?
I'm having trouble creating a function that sorts the T2DIntegerArray; based on a specific value in each TIntegerArray;…..
Meaning, I want to make it so, all points of the same color are grouped together in the array…. So when I run through the array, it does all of the same colors at once so it isn't changing. If you still don't understand what I'm saying… I want this:
T2DIA:T2DIntegerArray;
T2DIA[0][0]:=52991
T2DIA[0][1]:=30
T2DIA[0][2]:=40
T2DIA[1][0]:=9230079
T2DIA[1][1]:=30
T2DIA[1][2]:=41
T2DIA[2][0]:=52991
T2DIA[2][1]:=30
T2DIA[2][2]:=42
T2DIA[3][0]:=9230079
T2DIA[3][1]:=30
T2DIA[3][2]:=43
T2DIA[4][0]:=52991
T2DIA[4][1]:=30
T2DIA[4][2]:=44
to be resorted like this:
T2DIA[0][0]:=52991
T2DIA[0][1]:=30
T2DIA[0][2]:=40
T2DIA[1][0]:=52991
T2DIA[1][1]:=30
T2DIA[1][2]:=42
T2DIA[2][0]:=52991
T2DIA[2][1]:=30
T2DIA[2][2]:=44
T2DIA[3][0]:=9230079
T2DIA[3][1]:=30
T2DIA[3][2]:=41
T2DIA[4][0]:=9230079
T2DIA[4][1]:=30
T2DIA[4][2]:=43
Except on a larger scale of around 40,000+ pixels… the above example only has 5 for simplicity of comprehension. I've been trying to create a function to do this for the past 7 or so hours but all my attempts have failed. One method I was thinking of was trying to integrate bubblesort into the function somehow, though it is really stumping me.
Any clues?