TEST(PaletteTranslator, BuildSortLuminance) { //uint32 y = r * 299 + g * 587 + b * 114; Color col0(0, 0, 10); Color col1(0, 0, 11); Color col2(10, 0, 0); Color col3(11, 0, 0); Color col4(0, 10, 0); Color col5(0, 11, 0); Palette pal; pal.m_count = 6; pal[0] = col3; pal[1] = col5; pal[2] = col1; pal[3] = col2; pal[4] = col4; pal[5] = col0; Palette exp; exp.m_count = 6; exp[0] = col0; exp[1] = col1; exp[2] = col2; exp[3] = col3; exp[4] = col4; exp[5] = col5; PaletteTranslator pt; pt.BuildSortLuminance(pal, nullptr); ASSERT_TRUE( pal == exp ); }
void door(void) { initLeds(); col1(); col4(); col7(); _delay_ms(200); col1(); col5(); col9(); _delay_ms(200); col1(); col2(); col3(); _delay_ms(200); }
void Board::Initialise() { float zbase = 400; // Variable to store how deep in the z axis the object is based. Vector4 temp1(-600, 800, 1200 + zbase, 1); Vector4 temp2(600, 800, 1200 + zbase, 1); Vector4 temp3(600, 800, 0 + zbase, 1); Vector4 temp4(-600,800,0 + zbase,1); top.Initialise(temp1, temp2, temp3, temp4); // Set individual vertex locations for the top face of the board Vector4 col1(70,50,4,1); Vector4 col2(92,67,5,1); Vector4 col3(102,75,6,1); Vector4 col4(119,77,0,1); Vector4 col5(69, 25, 18, 1); top.SetColours(col1, col2, col2, col3); // Set individual colour values of each of those vertices Vector4 temp5(-600, 800, 0 + zbase, 1); Vector4 temp6(600, 800, 0 + zbase, 1); Vector4 temp7(600, 1000, 0 + zbase, 1); Vector4 temp8(-600,1000, 0 + zbase,1); // Individual vertices for the front face Vector4 temp9(-800, 1000, 1200 + zbase + 300, 1); Vector4 temp10(800, 1000, 1200 + zbase + 300, 1); Vector4 temp11(800, 1000, 100, 1); Vector4 temp12(-800, 1000, 100,1); // Individual vertices for the base face table.Initialise(temp9, temp10, temp11, temp12); table.SetColours(col5, col5, col5, col5); // Set to one mat colour, no shading. Vector4 temp13(-600, 800, 1200 + zbase, 1); Vector4 temp14(-600, 800, 0 + zbase, 1); Vector4 temp15(-600, 1000, 0 + zbase, 1); Vector4 temp16(-600, 1000, 1200 + zbase, 1); // Set individual vertices for the left face Vector4 temp17(600, 800, 0 + zbase, 1); Vector4 temp18(600, 800, 1200 + zbase, 1); Vector4 temp19(600, 1000, 1200 + zbase, 1); Vector4 temp20(600, 1000, 0 + zbase, 1); // Set individual vertices for the right face sides[0].Initialise(temp5, temp6, temp7, temp8); sides[1].Initialise(temp13, temp14, temp15, temp16); sides[2].Initialise(temp17, temp18, temp19, temp20); sides[3].Initialise(temp2, temp1, temp16, temp19); // Use known vertices to initialise the side faces sides[0].SetColours(col3, col4, col4, col2); sides[1].SetColours(col1, col2, col2, col1); sides[2].SetColours(col2, col1, col1, col2); sides[3].SetColours(col4, col4, col4, col4); // Then set the colours float positionLocations[24][2] = {{-450, 1050 + zbase}, //1 An array holding the centre locations {-300, 900 + zbase}, //2 of each of the positions where pieces {-150, 750 + zbase}, //3 can be placed. { 0 , 750 + zbase}, //4 { 150, 750 + zbase}, //5 { 300, 900 + zbase}, //6 { 450, 1050 + zbase}, //7 { 0 , 900 + zbase}, //8 { 0 , 1050 + zbase}, //9 {-450, 600 + zbase}, //10 {-300, 600 + zbase}, //11 {-150, 600 + zbase}, //12 {-450, 150 + zbase}, //13 {-300, 300 + zbase}, //14 {-150, 450 + zbase}, //15 { 0 , 150 + zbase}, //16 { 0 , 300 + zbase}, //17 { 0 , 450 + zbase}, //18 { 450, 150 + zbase}, //19 { 300, 300 + zbase}, //20 { 150, 450 + zbase}, //21 { 450, 600 + zbase}, //22 { 300, 600 + zbase}, //23 { 150, 600 + zbase}}; //24 for (int i = 0; i < 24; i++) { boardpositions[i].Initialise(positionLocations[i][0], positionLocations[i][1]); // Create the individual graphical representations } // (class Position) and put in array for easy drawing. InitialiseLines(); // Ugly function to draw each and every line on the // board with individual hand-placed vertices. SetupMills(); // Set up the mills (groups of three) with pointers to the positions // as alternate referencing option }