Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8397375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:46:21+00:00 2026-06-09T20:46:21+00:00

Edited: Thanks for the previous answers and help! I’ve decided to edit this question

  • 0

Edited: Thanks for the previous answers and help! I’ve decided to edit this question into what I need exactly, sorry for not being as specific earlier.

Basically the title is all the information, this is currently what I’m working with:

int channels = 4;
int length = width * height;
int[] data = new int[length * channels];
int[][] channelPixels = new int[4][length];

for (int c = 0; c < channels; c++) {
    for (int i = 0; i < length; i++) {
        channelPixels[c][i] = readByte();
    }
}

Unfortunately, the colors don’t seem to match up to the originals.

Is there something I’m doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:46:23+00:00Added an answer on June 9, 2026 at 8:46 pm

    This code flips rectangular buffer and changes RGBA byte order to BGRA (or vice versa) like this:

    a b c d e f g h
    i j k l m n o p
    =>
    k j i l o n m p
    c b a d g f e h
    

    Rough analog with c/java-like pseudocode:

    src = array of byte with length (RawHdr.Width * RawHdr.Height * 4)
    dst = array of byte with the same length
    
    dstindex = 0
    
    for (i = RawHdr.Height - 1; i >= 0; i--)
        {
         srcstartindex = i * RawHdr.Width * 4;
         for (j = 0; j < RawHdr.Width; j++)
             {  
               si = srcstartindex + j * 4;
               dst[dstindex] = src[si + 2];
               dst[dstindex + 1] = src[si + 1];
               dst[dstindex + 2] = src[si];
               dst[dstindex + 3] = src[si + 3];
               dstindex +=4;
             }
         } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDITED SO THE CODE IS CORRECT (THANKS TO ta.speot.is) - NEW QUESTION AT BOTTOM
EDITED I'm using Twitter Bootstrap and need to move navbar right( not float:right, but
Edited Question: This should be clear. using System; namespace UpdateDateTimeFields { class Program {
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
This is related to a previous question I asked with Jquery. If I have
I edited the question after David Hanak's answer (thanks btw!). He helped with the
EDIT: Thank you all for your help. I edited my Database class to contain
Edited at the request of commenters. I hope this is compliant. First post! Trying
First time poster so sorry if this is too long, but I've hit a
This does not always happen, but sometimes when I try to build a (large)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.