Skip to Main Content
WebGL Insights
book

WebGL Insights

by Patrick Cozzi
August 2015
Intermediate to advanced content levelIntermediate to advanced
416 pages
16h 58m
English
A K Peters/CRC Press
Content preview from WebGL Insights
312 19. Data VisualizationTechniques with WebGL
First we dene the histogram data structure: a long array that will represent the three-
dimensional matrix containing each RGB component in the graphic. We call this vari-
able ans. en we get the typed array containing pixels of the video frame. We call this
pixels. en we iterate through each RGBA component of the pixels array and convert
the [0-255] value of each RGB component in the pixels’ array to the [0-dim] domain
where dim is the dimension of our cube. Finally, we get the proper index of the histogram
array by generating it as one would do a lookup in a matrix. Once we get the index, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

James L. Williams

Publisher Resources

ISBN: 9781498716079