Last active
May 21, 2016 09:18
-
-
Save John-K/476fec0a17c4625ef423c5dffa788439 to your computer and use it in GitHub Desktop.
Apertus cmv_snap3 flipped ordered pixel output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
664 union dpixel { | |
665 uint32_t p; | |
666 uint8_t b[4]; | |
667 } pix_out; | |
668 for (int frame = 0; frame < num_frames; frame++) { | |
669 for (int row = 0; row < 3072; row+=2) { | |
670 // | |
671 // pixel order is (1,0) (1,1) (0,0) (0,1) <16-bit overlay> when in flipped mode | |
672 // 52^ 40^ 28^ 16^ | |
673 for (int i = 0; i < 32*128*2/4; ++i) { | |
674 //uint16_t first = (dp[i] >> 28) & 0xFFF; // (0,0) | |
675 //uint16_t second = (dp[i] >> 16) & 0xFFF; // (0,1) | |
~ 676 pix_out.p = (dp[i] >> 16) & 0xFFFFFF; | |
677 buffer[out_index++] = pix_out.b[2]; | |
678 buffer[out_index++] = pix_out.b[1]; | |
679 buffer[out_index++] = pix_out.b[0]; | |
680 } | |
681 for (int i = 0; i < 32*128*2/4; ++i) { | |
682 //uint16_t first = (dp[i] >> 52) & 0xFFF; // (1,0) | |
683 //uint16_t second = (dp[i] >> 40) & 0xFFF; // (1,1) | |
~ 684 pix_out.p = (dp[i] >> 40) & 0xFFFFFF; | |
685 buffer[out_index++] = pix_out.b[2]; | |
686 buffer[out_index++] = pix_out.b[1]; | |
687 buffer[out_index++] = pix_out.b[0]; | |
688 } | |
689 //write_dline(dp, 32*128*2/4); | |
690 dp += 32*128*2/4; | |
691 } | |
692 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated with correct pixel order