• [^] # Re: Les chinois du FBI...

    Posté par . En réponse au journal Backdoor dans OpenBSD ?. Évalué à 2.

    Allez, au pif, remplacer chaque pixel d’une image par sa distance avec la moyenne de la matrice :


    float *data;
    int width, height;

    float avg = 0;
    int pos, x, y;
    for(y = 0, pos = 0; y < height; ++y, pos += pitch) {
    for(x = 0; x < width; ++x, ++pos) {
    moy += data[pos];
    }
    }
    avg /= width * height;
    for(y = 0, pos = 0; y < height; ++y, pos += pitch) {
    for(x = 0; x < width; ++x, ++pos) {
    data[pos] -= avg;
    }
    }


    (oui, je sais, tu peux faire une macro, mais c’est encore plus moche)