Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS3-server.c Needs Patch #334

Merged
merged 1 commit into from
Jul 13, 2013
Merged

AS3-server.c Needs Patch #334

merged 1 commit into from
Jul 13, 2013

Conversation

piedar
Copy link
Contributor

@piedar piedar commented Jul 11, 2013

In wrappers/as3-server.c
function - sendDepth() (line 107)

From:

    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;
        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;
        }
    }

To:


    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);
            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;
            }
        }
    }

Whats happening is that there is no depth compression set it sends 4 colour bytes to the RPG_JPEG function. It should be 3.

Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
@piedar
Copy link
Contributor

piedar commented Jul 11, 2013

Thank you for the patch - I converted it to a pull request in my fork. I would call for testers, but you may be the only person actually using the actionscript wrapper.

@bigorangemachine
Copy link
Author

Thanks piedar! I don't know how to do a proper request. I think right now I am the only person using AS3 to :).

@piedar
Copy link
Contributor

piedar commented Jul 11, 2013

For future reference, there are excellent guides on repo forking and pull requests.

piedar added a commit that referenced this pull request Jul 13, 2013
AS3-server.c: Fix JPEG depth -- by bigorangemachine
@piedar piedar merged commit 35d1fc1 into OpenKinect:unstable Jul 13, 2013
@piedar piedar mentioned this pull request Jul 24, 2013
@piedar piedar deleted the as3-bom branch August 6, 2013 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants