is there any way of specifying a coordinate (texture/raster/anything) and retrieving the corresponding color (index/rgba) value?? i need various color values for input into a neural network (final year project). please help!!
Posted on 2001-05-03 09:52:00 by annemarie
i dont know about OpenGl but in DirectX/ Directdraw or Direct3D there sure is: Steep 1. =========== lock your surface (and obtain a pointer to it and a lPitch) Steep 2. ========== use the pointer as a base address, multiply current_Y with lPitch instead of your image_DX add Current_X to that all multiply with pixel_size (1 for indexed pallete, 2 for 16 bits, 3 for 24 bits,4 for 32 bits) and get the value of the pixel data from that address.... eventually do some modifications and them write it back...not your case if you want to feed it to a NN ;) Steep 3. ======== just Unlock the surface just dont do it in a video memory surface because its slow (it will still work) use a system memory surface instead OpenGl should have some similar functions i hope ;) i have heard something about RAS only operations mode...but is just hear talk i never used OpenGl for 2D operations ... Happy image recognition ;)
Posted on 2001-05-04 23:39:00 by BogdanOntanu