c# - How to reverse that function -


I have already asked the opposite of bitworth (& amp; nbsp;) and you said it is impossible to reverse.

OK, this is the situation: The server sends an image, which is encoded with the function that I want to reverse, then it is encoded with zlib.

In this way I get an image from the server:

  UInt32 [] image = new UInt32 [200 * 64]; Int imgIndex = 0; Byte [imgdata = new byte [compressed]; Byte [] imgdataout = new byte [uncompressed]; Array.Copy (Data, 17, IMGData, 0, Compressed); Imgdataout = zlib.Decompress (imgdata); For (int h = 0; h & lt; height; h ++) {for (int w = 0; w  3)])) & Gt; {} [IMGIDx] = 0xFFFFFFFF; Width, height, image decomposed and image compressed length are always the same.  

When this function is done, I put the image (UInt32 [] array) and I got it in bitmap.

Now I want to be a server and I will send that image. I have to do two things:

Reverse that function and then compress it with Zlib.

How do I change that function so that I can encode the picture?

 for  (int h = 0; h & lt; height; h ++) {for (int w = 0; w  3)])) & Gt; {} [IMGIDx] = 0xFFFFFFFF; }}}  

Edit: Format is 32bppRGB

assumption That the and operator is always irreversible.

Yes, if you have a general

  c = a & amp; B  

and you all know that the value of c is , you do not know which value is a or B was before hand.

Although & amp; Too much normal for extract , some bits with a long value, where those bits were first | was added to the operator and where each 'bit field' is independent of each other; generic & amp; or | The basic difference with the operator who makes this reversal is that the original bits all zeroes were already, and the other bits are left unchanged in the word Ie:

  0xc0 | 0x03 = 0xc3 // two nibs 0xc3 & amp; alliance; 0xf0 = 0xc0 / / 0xc3 Remove top enBubble & amp; 0x0f = 0x03 // Remove nibble below  

In this case, your current function starts extracting 1 bit-per-pixel (monochrome image) and converts it to 32-bit RGBA

You'll need something:

  int source_image []; Byte dist_image []; For (int h = 0; h & lt; height; ++ h) {for (int weight = 0; w  

NB: Assume that the image is a wide of 8 pixels, that the dest_image array was previously all zero I had that internal The test is used by % and / because it is easy to understand and should convert / automatically convert the compiler into the should mask I usually use masking Doing and wanting to change yourself.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -