Skip to content

color() function is not thread-safe #3077

@mattlathrop

Description

@mattlathrop

The following code:

    for(int j=0; j < dimention; j++) {
      color current = ledImage[i].pixels[j];
      ledImage[i].pixels[j] = color(red(current), green(current), blue(current)); //multiply color correction here
    }

Was acting as a place holder. The plan was to multiply the Red, Green, Blue by color correction values for each pixel of an LED Wall. This function occasionally returned the wrong color value when threading (each thread handles a different i). I reimplemented it using bit shifting and it worked fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions