Elvis: D4***it3: http://pastie.org/10424796 will do a block copy.
Bloor: RonRichie, start with the base case. power3,0, the exponent is 0, then it return 1 at line 5.
Elvis: Http://pastie.org/10424797 will do a block copy and ensure the alpha is 255 http://pastie.org/10424797
Shoat: Ok i see whats going on
Benafield: Basically the origina imagedata is much denser
Barquera: I need to scale the src
Elvis: You’d need to implement bilinear or nearest neighbor downscaling
Elvis: You’ll have better performance if you actually just make the canvas2d methods do this
Elvis: Since it will be hardware accelerated
Zellmann: RonRichie, then lets call power3,1 , the exponent is not 0, then it return at line 12 return base * power3, 0. : base is 3, powerbase, exponent-1 is power3, 0 — we said that it was 1, so this mean it does return 3 * 1
Tocchio: Yansanmo thanks, let me attempt this see how it goes
Cosmo: Tcsc i have been tryign to find how
Lozada: Let me read this all yansanmo :
Ady: I have one isntance of actual imageData
Huxtable: But the other is just an array
Elvis: And what do you need to do?
Posse: I want to take the array which is supposed to be pixels
Lasane: And scale it to fit this canvas2d
Elvis: Do you know the dimensions of the pixel array?
Geddie: CV.Image {width: 375, height: 500, data: Array187500}
Jacka: Thats the array object
Elvis: Okay. you need to create a temporary canvas of that size
Elvis: Make it create an imagedata
Maedke: ImageData {data: Uint8ClampedArray750000}
Elvis: Copy the pixels over inot that imagedata
Elvis: No, it should be the same size as the CV.image
Elvis: This might be just a scratch canvas ou never use again
Elvis: It’s just for the resize
Samberg: CV.Image i just the alpha
Elvis: It’s just one component?
Tubertini: I should have realized
Elvis: And you want a black and white result?
Elvis: And it doesn’t need to be resized
Paolini: I just need to make all opaque pixesl white and transparent black
Staller: Could I just create a Uint8ClampedArray
Bolinder: Loop throught the source and for each iteration add 4 values to the array?
Seacrest: Tcsc: would this work then? http://pastie.org/10424808
Elvis: D4***it3: http://pastie.org/10424809 would be basically it
Elvis: You shouldn’t create the uint8clampedarray yourself, get it from createImageData
Elvis: D4***it3: generally, don’t create uint8clampedarrays. they’re slow and bad. use the other typed arrays.
Elvis: Very rarely do you need the clamping behavior
Schuber: What kind of loop is that
Elvis: It was a bad idea on the part of the canvas2d api designers.
Elvis: D4***it3: it’s just a loop
Elvis: It iterates over two properties at once
Elvis: So i split each part into its own line
Sorin: Ycon_, 1 to 99, 150 to 249, 1350 to 1399, 1450 to 1499
Elvis: This works in every version of js ever
Dibonaventura: I guess thats what the ***ert is for
Elvis: The ***ert is just a sanity check
Bettis: Yansanmo please, if you have a half minute, could you please fill upcontinue as how this whole thing will go on? what will be the next thing that will take place? https://repl.it/BIhG/1 would appreciate if you could do that
Elvis: To make sure you p***ed in the right kind of data
Chabez: Or things will get wacky