Some encode/decode practice.
This commit is contained in:
parent
8a41337e2d
commit
ff962a6b16
29 changed files with 727 additions and 305 deletions
|
@ -23,4 +23,19 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void drawAlternatingStrips(std::vector<unsigned char>& data, unsigned width, unsigned height, unsigned channels, unsigned bytesPerRow)
|
||||
{
|
||||
for(unsigned jdx=0;jdx<height;jdx++)
|
||||
{
|
||||
const auto heightOffset = jdx*bytesPerRow;
|
||||
for(unsigned idx=0;idx<width*channels;idx+=channels)
|
||||
{
|
||||
const auto index = heightOffset + idx;
|
||||
data[index] = (idx%2 == 0) ? 255*jdx/(height+1) : 0;
|
||||
data[index+1] = 0;
|
||||
data[index+2] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue