jobject vector_Ptr_Layer_to_List(JNIEnv* env, std::vector<cv::Ptr<cv::dnn::Layer> >& vs) { static jclass juArrayList = ARRAYLIST(env); static jmethodID m_create = CONSTRUCTOR(env, juArrayList); jmethodID m_add = LIST_ADD(env, juArrayList); static jclass jLayerClass = LAYER(env); static jmethodID m_create_layer = LAYER_CONSTRUCTOR(env, jLayerClass); jobject result = env->NewObject(juArrayList, m_create, vs.size()); for (std::vector< cv::Ptr<cv::dnn::Layer> >::iterator it = vs.begin(); it != vs.end(); ++it) { jobject element = env->NewObject(jLayerClass, m_create_layer, (*it).get()); env->CallBooleanMethod(result, m_add, element); env->DeleteLocalRef(element); } return result; }
static void show_item_layer(PcbItem *item, int layer) { if (!pcb.layer->olay) return; hide_item_layer(item, layer); if (!(item->layers & LAYER(layer))) return; switch (item->type) { case PCB_POINT: show_point(item, layer); break; case PCB_LINE: show_line(item, layer); break; } }
std::vector<cv::Ptr<cv::dnn::Layer> > List_to_vector_Ptr_Layer(JNIEnv* env, jobject list) { static jclass juArrayList = ARRAYLIST(env); jmethodID m_size = LIST_SIZE(env, juArrayList); jmethodID m_get = LIST_GET(env, juArrayList); static jclass jLayerClass = LAYER(env); jint len = env->CallIntMethod(list, m_size); std::vector< cv::Ptr<cv::dnn::Layer> > result; result.reserve(len); for (jint i=0; i<len; i++) { jobject element = static_cast<jobject>(env->CallObjectMethod(list, m_get, i)); cv::Ptr<cv::dnn::Layer>* layer_ptr = (cv::Ptr<cv::dnn::Layer>*) GETNATIVEOBJ(env, jLayerClass, element) ; cv::Ptr<cv::dnn::Layer> layer = *(layer_ptr); result.push_back(layer); env->DeleteLocalRef(element); } return result; }
int main() { lif::init(); lif::Cutscene cut(sf::Vector2u(640, 480), { LAYER("bands.png", 0), LAYER("1_-1.png", 4), LAYER("1_0.png", 5), LAYER("1_0_5.png", 8), LAYER("1_1.png", 10), LAYER("1_2.png", 15), LAYER("1_3.png", 30), }, { SUB("It was a dark and gloomy night...", 3), SUB("And I felt the hatred of ten thousand years...", 3), SUB("Yet...", 2), SUB("My vengeance was just at its commencement...", 4), SUB("My enemies would soon suffer...", 2.5), SUB("Like I am.", 5), }); sf::RenderWindow window(sf::VideoMode(640, 480), "test_cutscene"); window.setFramerateLimit(120); lif::options.vsync = true; lif::options.showFPS = false; lif::WindowContext *cur_context = &cut; while (window.isOpen() && !lif::terminated) { cur_context->handleEvents(window); cur_context->update(); window.clear(); window.draw(*cur_context); lif::maybeShowFPS(window); window.display(); } if (window.isOpen()) window.close(); }
A661_INTERNAL int a661_com_layer_1(buffer_el msg[], outC_OperationalScenario* scade_ctx, extern_out_ctx_t * extern_ctx){ int size = 0; int n16 = 0; int n15 = 0; int n14 = 0; int n13 = 0; int n12 = 0; int n11 = 0; int n10 = 0; int n9 = 0; int n8 = 0; int n7 = 0; int n6 = 0; int n5 = 0; int n4 = 0; int n3 = 0; int n2 = 0; int n1 = 0; int n0 = 0; if (scade_ctx->Emit2CDS || scade_ctx->Layer1Active || scade_ctx->Layer1Visible){ LAYER("DF_TS02#1"); n0 = 8 /*include block_size*/; a661_msg_cmd_header(msg, 1, DEFAULT_CONTEXT_NUMBER); if (scade_ctx->Emit2CDS){ WIDGET("GpArcCircle_Ground#15"); n1 = a661_com_csp_widget_GpArcCircle(msg + n0, 15, scade_ctx->Emit2CDS, scade_ctx->ColorIndex2); } if (scade_ctx->Emit2CDS){ WIDGET("GpArcCircle_Launch#16"); n2 = a661_com_csp_widget_GpArcCircle(msg + n0 + n1, 16, scade_ctx->Emit2CDS, scade_ctx->ColorIndex); } if (scade_ctx->Emit2CDS){ WIDGET("GpArcCircle_Attitude#17"); n3 = a661_com_csp_widget_GpArcCircle(msg + n0 + n1 + n2, 17, scade_ctx->Emit2CDS, scade_ctx->ColorIndex3); } if (scade_ctx->Emit2CDS){ WIDGET("GpArcCircle_Normal#18"); n4 = a661_com_csp_widget_GpArcCircle(msg + n0 + n1 + n2 + n3, 18, scade_ctx->Emit2CDS, scade_ctx->ColorIndex4); } if (scade_ctx->Emit2CDS){ WIDGET("Ground_Label#22"); n5 = a661_com_csp_widget_Label(msg + n0 + n1 + n2 + n3 + n4, 22, scade_ctx->Emit2CDS, scade_ctx->GroundVisible); } if (scade_ctx->Emit2CDS){ WIDGET("Launch_Label#23"); n6 = a661_com_csp_widget_Label(msg + n0 + n1 + n2 + n3 + n4 + n5, 23, scade_ctx->Emit2CDS, scade_ctx->LaunchVisible); } if (scade_ctx->Emit2CDS){ WIDGET("AttitudeAcquisition_Label#24"); n7 = a661_com_csp_widget_Label(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6, 24, scade_ctx->Emit2CDS, scade_ctx->AttitudeVisible); } if (scade_ctx->Emit2CDS){ WIDGET("NormalPhase_Label#25"); n8 = a661_com_csp_widget_Label(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7, 25, scade_ctx->Emit2CDS, scade_ctx->NormalPhaseVisible); } if (scade_ctx->Emit2CDS){ WIDGET("GpArcCircle_AtAcquired#27"); n9 = a661_com_csp_widget_GpArcCircle(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8, 27, scade_ctx->Emit2CDS, scade_ctx->ColorIndex5); } if (scade_ctx->Emit2CDS){ WIDGET("AcRd_EditBoxNumeric#43"); n10 = a661_com_csp_widget_EditBoxNumeric(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9, 43, scade_ctx->Emit2CDS, scade_ctx->AcRdValue); } if (scade_ctx->Emit2CDS){ WIDGET("FuelMeter_EditBoxNumeric#57"); n11 = a661_com_csp_widget_EditBoxNumeric(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10, 57, scade_ctx->Emit2CDS, scade_ctx->FuelMeter); } if (scade_ctx->Emit2CDS){ WIDGET("Fuel#59"); n12 = a661_com_csp_widget_GpRectangle(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11, 59, scade_ctx->Emit2CDS, scade_ctx->FuelMeterGraphic); } if (scade_ctx->Emit2CDS){ WIDGET("Longitude_EditBoxNumeric#70"); n13 = a661_com_csp_widget_EditBoxNumeric(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11 + n12, 70, scade_ctx->Emit2CDS, scade_ctx->SAT_Longitude_Value); } if (scade_ctx->Emit2CDS){ WIDGET("Latitude_EditBoxNumeric#71"); n14 = a661_com_csp_widget_EditBoxNumeric(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11 + n12 + n13, 71, scade_ctx->Emit2CDS, scade_ctx->SAT_Latitude_Value); } if (scade_ctx->Layer1Active || scade_ctx->Layer1Visible){ n15 = a661_com_A661_CMD_UA_REQUEST_layer_1(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11 + n12 + n13 + n14, scade_ctx, extern_ctx); } n16 = 4; WRITE_ULONG(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11 + n12 + n13 + n14 + n15, A661_END_BLOCK); size = n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11 + n12 + n13 + n14 + n15 + n16; WRITE_ULONG(msg + 4, size); } return n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10 + n11 + n12 + n13 + n14 + n15 + n16 ; }
A661_INTERNAL int a661_com_layer_1(buffer_el msg[], outC_ts05* scade_ctx, extern_out_ctx_t * extern_ctx){ int size = 0; int n9 = 0; int n8 = 0; int n7 = 0; int n6 = 0; int n5 = 0; int n4 = 0; int n3 = 0; int n2 = 0; int n1 = 0; int n0 = 0; if (scade_ctx->CDS_Emit || scade_ctx->CDS_Layer_Req_Active || scade_ctx->CDS_Layer_Req_Visible){ LAYER("ts05_layer#1"); n0 = 8 /*include block_size*/; a661_msg_cmd_header(msg, 1, DEFAULT_CONTEXT_NUMBER); if (scade_ctx->CDS_Emit){ WIDGET("Auto_Verify#1503"); n1 = a661_com_csp_widget_GpArcEllipse(msg + n0, 1503, scade_ctx->CDS_Emit, scade_ctx->Test_Auto_Verify); } if (scade_ctx->CDS_Emit){ WIDGET("Output#1513"); n2 = a661_com_csp_widget_GpArcEllipse(msg + n0 + n1, 1513, scade_ctx->CDS_Emit, scade_ctx->TEST_SAT_GyroscopeState_Signal); } if (scade_ctx->CDS_Emit){ WIDGET("Output#1523"); n3 = a661_com_csp_widget_GpArcEllipse(msg + n0 + n1 + n2, 1523, scade_ctx->CDS_Emit, scade_ctx->TEST_SAT_HorizonSensorState_Signal); } if (scade_ctx->CDS_Emit){ WIDGET("Output#1533"); n4 = a661_com_csp_widget_GpArcEllipse(msg + n0 + n1 + n2 + n3, 1533, scade_ctx->CDS_Emit, scade_ctx->TEST_SAT_PropellersState_Signal); } if (scade_ctx->CDS_Emit){ WIDGET("Output#1543"); n5 = a661_com_csp_widget_GpArcEllipse(msg + n0 + n1 + n2 + n3 + n4, 1543, scade_ctx->CDS_Emit, scade_ctx->TEST_SAT_CameraState_Signal); } if (scade_ctx->CDS_Emit){ WIDGET("PedidoEnviaFoto#5104"); n6 = a661_com_csp_widget_GpArcEllipse(msg + n0 + n1 + n2 + n3 + n4 + n5, 5104, scade_ctx->CDS_Emit, scade_ctx->display_picture_resquest_state); } if (scade_ctx->CDS_Emit){ WIDGET("Initialize#7505"); n7 = a661_com_csp_widget_GpArcEllipse(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6, 7505, scade_ctx->CDS_Emit, scade_ctx->TEST_SAT_Initialize_Signal); } if (scade_ctx->CDS_Layer_Req_Active || scade_ctx->CDS_Layer_Req_Visible){ n8 = a661_com_A661_CMD_UA_REQUEST_layer_1(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7, scade_ctx, extern_ctx); } n9 = 4; WRITE_ULONG(msg + n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8, A661_END_BLOCK); size = n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9; WRITE_ULONG(msg + 4, size); } return n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 ; }