void plugin::execute ( const QVariantMap& data) { Q_UNUSED(sessionid); if ( ServiceData::isMethod(data, "pulsechannelmute" ) ) { set_sink_muted(DATA("sinkid").toUtf8().constData(), INTDATA ( "mute" ) ); } else if ( ServiceData::isMethod(data, "pulsechannelvolume" ) ) { if (BOOLDATA ( "relative" )) { set_sink_volume_relative(DATA("sinkid").toUtf8(), DOUBLEDATA ( "volume" )); } else { set_sink_volume(DATA("sinkid").toUtf8(), DOUBLEDATA ( "volume" )); } } }
/* Calcul de Stream par un algo mixant exploration en profondeur et largeur d'abord des chemins de plus grande pente */ int32_t StreamGADouble(struct xvimage *ga, int32_t x, Lifo *L, Lifo *B,int32_t *psi, double *G) #undef F_NAME #define F_NAME "LPEGrapheAreteValuee" { int32_t rs = rowsize(ga); /* taille ligne */ int32_t cs = colsize(ga); /* taille colonne */ int32_t N = rs * cs; /* taille image */ double *F = DOUBLEDATA(ga); int32_t y, k, u, z; uint8_t breadth_first; LifoPush(L,x); psi[x] = IN_PROCESS; LifoPush(B,x); while(!LifoVide(B)){ y = LifoPop(B); breadth_first = TRUE; for(k = 0; (k < 4) && (breadth_first == TRUE); k++) if((u = incidente(y, k, rs, N)) != -1) if(F[u] == G[y]){ switch(k){ case 0: z = y+1; break; /* EST */ case 1: z = y-rs; break; /* NORD */ case 2: z = y-1; break; /* OUEST */ case 3: z = y+rs; break; /* SUD */ } if(psi[z] != IN_PROCESS) { if(psi[z] != NO_LABEL){ /* There is an inf-stream under L */ LifoFlush(B); return psi[z]; } else { if(G[z] < G[y]){ LifoPush(L,z); psi[z] = IN_PROCESS; /* z is now the only bottom of L */ LifoFlush(B); LifoPush(B,z); /* hence, switch to depth first */ breadth_first = FALSE; } else{ psi[z] = IN_PROCESS; LifoPush(L,z); /* G[z] == G[y], then z is also a bottom of L */ LifoPush(B,z); } } } } } LifoFlush(B); return NO_LABEL; }
double altitudePointDouble(struct xvimage *ga, int32_t i) { int32_t rs = rowsize(ga); /* taille ligne */ int32_t cs = colsize(ga); /* taille colonne */ int32_t N = rs * cs; /* taille image */ double *F = DOUBLEDATA(ga); /* l'image de depart */ int32_t k, u; //double min = 956036423.000000; double min = 1000000000000000000000000000000.0; // En theorie ca peut aller bien plus haut attention !!! MAX_FLOAT for(k = 0; k < 4; k++) if( (u = incidente(i, k, rs, N)) != -1) { if(F[u] < min) min = F[u]; } return min; }