Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use pointers rather than coordinates

  • Loading branch information...
commit 1acbf8b14679ef0d38c5b8cd1c1602f129542e99 1 parent 3273837
Peteris Krumins authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/stacked_video.cpp
10 src/stacked_video.cpp
View
@@ -94,11 +94,13 @@ StackedVideo::EndPush(unsigned long timeStamp)
const Update &update = *it;
int start = (update.y)*width*3 + (update.x)*3;
+ const unsigned char *updatep = &(update.rect[0]);
for (int i = 0; i < update.h; i++) {
- for (int j = 0; j < 3*(update.w); j+=3) {
- lastFrame[start + i*width*3 + j] = update.rect[i*(update.w)*3 + j];
- lastFrame[start + i*width*3 + j + 1] = update.rect[i*(update.w)*3 + j + 1];
- lastFrame[start + i*width*3 + j + 2] = update.rect[i*(update.w)*3 + j + 2];
+ unsigned char *framep = lastFrame + start + i*width*3;
+ for (int j = 0; j < update.w; j++) {
+ *framep++ = *updatep++;
+ *framep++ = *updatep++;
+ *framep++ = *updatep++;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.