Skip to content

Commit

Permalink
Merge pull request OpenKinect#334 from piedar/as3-bom
Browse files Browse the repository at this point in the history
AS3-server.c: Fix JPEG depth -- by bigorangemachine
  • Loading branch information
piedar committed Jul 13, 2013
2 parents 02d4309 + baa489a commit 35d1fc1
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions wrappers/actionscript/server/as3-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,29 @@ void sendDepth(){
depth = tmp_depth;
}

for (i=0; i< depth_mode.width * depth_mode.height; i++) {
buf_depth[4 * i + 0] = 0x00;
buf_depth[4 * i + 1] = 0x00;
buf_depth[4 * i + 2] = 0x00;
buf_depth[4 * i + 3] = 0xFF;
for (i=0; i< depth_mode.width * depth_mode.height; i++) {
if(_depth_compression != 0) {
buf_depth[3 * i + 0] = 0x00;
buf_depth[3 * i + 1] = 0x00;
buf_depth[3 * i + 2] = 0x00;
} else {
buf_depth[4 * i + 0] = 0x00;
buf_depth[4 * i + 1] = 0x00;
buf_depth[4 * i + 2] = 0x00;
buf_depth[4 * i + 3] = 0xFF;
}
if(depth[i] < _max_depth && depth[i] > _min_depth){
unsigned char l = 0xFF - ((depth[i] - _min_depth) & 0xFF);
buf_depth[4 * i + 0] = l;
buf_depth[4 * i + 1] = l;
buf_depth[4 * i + 2] = l;
buf_depth[4 * i + 3] = 0xFF;
if(_depth_compression != 0) {
buf_depth[3 * i + 0] = l;
buf_depth[3 * i + 1] = l;
buf_depth[3 * i + 2] = l;
} else {
buf_depth[4 * i + 0] = l;
buf_depth[4 * i + 1] = l;
buf_depth[4 * i + 2] = l;
buf_depth[4 * i + 3] = 0xFF;
}
}
}
if(_depth_compression != 0) {
Expand Down

0 comments on commit 35d1fc1

Please sign in to comment.