R0b0t1
2007-11-20 21:48:54
Its simply a color finding procedure, but I would like some input on it. I do hope to include some ObjectFinding also.
So: It can search 32 bit color, RGB, and HSL. I want to know if I should make a different function for each of these, or include them in one.
Something like this, with the "mode" being the use of RGB, HSL, or Color 32. The color input would be an array, the length depending on the mode. For example, if you used the HSL mode, the array would be three floating point values, but for Color 32 it would be just one value. I'm also thinking of making a last slot in the array for tolerance.
I hope you can imagine the other ways. Post which you think is best.
Oh yeah. Also, in the final example, I will not be using strings to save time. Also, for those who are concerned with speed, it most likely would be faster to have different functions for each… Oh, and its in C++.
So: It can search 32 bit color, RGB, and HSL. I want to know if I should make a different function for each of these, or include them in one.
Something like this, with the "mode" being the use of RGB, HSL, or Color 32. The color input would be an array, the length depending on the mode. For example, if you used the HSL mode, the array would be three floating point values, but for Color 32 it would be just one value. I'm also thinking of making a last slot in the array for tolerance.
//With tol in different variable using 32bit color
FindColorEx(x, y, 'C32', {32 bit color}[2551], {tolerance}25, X1, Y1, X2, Y2);
//Tol in array, using color 32.
FindColorEx(x, y, 'C32', [2551, 25], X1, Y1, X2, Y2);
//Tol in different variable, using RGB.
FindColorEx(x, y, 'RGB', {colors}[255, 103, 10], {tol}[5, 5, 5], X1, Y1, X2, Y2);
I hope you can imagine the other ways. Post which you think is best.
Oh yeah. Also, in the final example, I will not be using strings to save time. Also, for those who are concerned with speed, it most likely would be faster to have different functions for each… Oh, and its in C++.