¡@

Home 

2014/10/15 ¤U¤È 10:11:44

iphone Programming Glossary: mydatalength

Image processing Glamour filter in iphone

http://stackoverflow.com/questions/3549396/image-processing-glamour-filter-in-iphone

UInt8 data UInt8 CFDataGetBytePtr bitmapData int width image.size.width int height image.size.height NSInteger myDataLength width height 4 for int i 0 i myDataLength i 4 UInt8 r_pixel data i UInt8 g_pixel data i 1 UInt8 b_pixel data i 2 int outputRed.. bitmapData int width image.size.width int height image.size.height NSInteger myDataLength width height 4 for int i 0 i myDataLength i 4 UInt8 r_pixel data i UInt8 g_pixel data i 1 UInt8 b_pixel data i 2 int outputRed r_pixel .393 g_pixel .769 b_pixel.. outputRed data i 1 outputGreen data i 2 outputBlue CGDataProviderRef provider2 CGDataProviderCreateWithData NULL data myDataLength NULL int bitsPerComponent 8 int bitsPerPixel 32 int bytesPerRow 4 width CGColorSpaceRef colorSpaceRef CGColorSpaceCreateDeviceRGB..

take screen Programmatically of UIview+glview

http://stackoverflow.com/questions/6197137/take-screen-programmatically-of-uiviewglview

i know how to take scrrenshot of glview nt width glView.frame.size.width int height glView.frame.size.height NSInteger myDataLength width height 4 allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 width.. NSInteger myDataLength width height 4 allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 width height GL_RGBA GL_UNSIGNED_BYTE buffer gl renders upside down so swap top to bottom into new array... so swap top to bottom into new array. there's gotta be a better way but this works. GLubyte buffer2 GLubyte malloc myDataLength for int y 0 y height y for int x 0 x width 4 x buffer2 height 1 y width 4 x buffer y 4 width x make data provider with..

GLPaint save image

http://stackoverflow.com/questions/946700/glpaint-save-image

iphone objective c opengl es quartz graphics share improve this question UIImage saveImageFromGLView NSInteger myDataLength 320 480 4 allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 320 480 GL_RGBA.. NSInteger myDataLength 320 480 4 allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 320 480 GL_RGBA GL_UNSIGNED_BYTE buffer gl renders upside down so swap top to bottom into new array. there's.. so swap top to bottom into new array. there's gotta be a better way but this works. GLubyte buffer2 GLubyte malloc myDataLength for int y 0 y 480 y for int x 0 x 320 4 x buffer2 479 y 320 4 x buffer y 4 320 x make data provider with data. CGDataProviderRef..

Save OpenGL Drawn item as a Image

http://stackoverflow.com/questions/9660723/save-opengl-drawn-item-as-a-image

UIImage image self glToUIImage UIImageWriteToSavedPhotosAlbum image self nil nil UIImage glToUIImage NSInteger myDataLength 320 480 4 allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 320 480 GL_RGBA.. glToUIImage NSInteger myDataLength 320 480 4 allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 320 480 GL_RGBA GL_UNSIGNED_BYTE buffer gl renders upside down so swap top to bottom into new array. there's.. so swap top to bottom into new array. there's gotta be a better way but this works. GLubyte buffer2 GLubyte malloc myDataLength for int y 0 y 480 y for int x 0 x 320 4 x buffer2 479 y 320 4 x buffer y 4 320 x make data provider with data. CGDataProviderRef..

Saving imageRef from GLPaint creates completely black image

http://stackoverflow.com/questions/9857912/saving-imageref-from-glpaint-creates-completely-black-image

scale s int screen scale const int w self.frame.size.width const int h self.frame.size.height const NSInteger myDataLength w h 4 s s allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 w s h s GL_RGBA.. const NSInteger myDataLength w h 4 s s allocate array and read pixels into it. GLubyte buffer GLubyte malloc myDataLength glReadPixels 0 0 w s h s GL_RGBA GL_UNSIGNED_BYTE buffer gl renders upside down so swap top to bottom into new array. there's.. so swap top to bottom into new array. there's gotta be a better way but this works. GLubyte buffer2 GLubyte malloc myDataLength for int y 0 y h s y memcpy buffer2 h s 1 y w 4 s buffer y 4 w s w 4 s free buffer work with the flipped buffer so get rid..