¡@

Home 

2014/10/15 ¤U¤È 10:04:34

iphone Programming Glossary: bgra

OpenGL ES 2d rendering into image

http://stackoverflow.com/questions/10455329/opengl-es-2d-rendering-into-image

renderTarget CVPixelBufferCreate kCFAllocatorDefault int imageSize.width int imageSize.height kCVPixelFormatType_32BGRA attrs renderTarget CVOpenGLESTextureRef renderTexture CVOpenGLESTextureCacheCreateTextureFromImage kCFAllocatorDefault.. NULL texture attributes GL_TEXTURE_2D GL_RGBA opengl format int imageSize.width int imageSize.height GL_BGRA native iOS format GL_UNSIGNED_BYTE 0 renderTexture CFRelease attrs CFRelease empty glBindTexture CVOpenGLESTextureGetTarget.. CVOpenGLESTextureGetName renderTexture 0 and then you can just read directly from the bytes that back this texture in BGRA format not the RGBA of glReadPixels using something like CVPixelBufferLockBaseAddress renderTarget 0 _rawBytesForImage GLubyte..

iOS: Get pixel-by-pixel data from camera

http://stackoverflow.com/questions/10865100/ios-get-pixel-by-pixel-data-from-camera

for the raw pixel data representing your camera frame. This can be in a few different formats but the most common are BGRA and planar YUV. I have an example application that uses this here but I'd recommend that you also take a look at my open..

iPhone: AVCaptureSession capture output crashing (AVCaptureVideoDataOutput)

http://stackoverflow.com/questions/3331644/iphone-avcapturesession-capture-output-crashing-avcapturevideodataoutput

YES videoOut setVideoSettings NSDictionary dictionaryWithObject NSNumber numberWithInt kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey BGRA is necessary for manual preview dispatch_queue_t my_queue dispatch_queue_create.. dictionaryWithObject NSNumber numberWithInt kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey BGRA is necessary for manual preview dispatch_queue_t my_queue dispatch_queue_create com.example.subsystem.taskXYZ NULL videoOut..

iPhone SDK 4 AVFoundation - How to use captureStillImageAsynchronouslyFromConnection correctly?

http://stackoverflow.com/questions/3847140/iphone-sdk-4-avfoundation-how-to-use-capturestillimageasynchronouslyfromconnec

key NSString kCVPixelBufferPixelFormatTypeKey NSNumber value NSNumber numberWithUnsignedInt kCVPixelFormatType_32BGRA NSDictionary videoSettings NSDictionary dictionaryWithObject value forKey key captureOutput setVideoSettings videoSettings.. AVCaptureSessionPresetPhoto otherwise you effectively get JPEG encoded video frames. Might as well use higher quality BGRA frames incidentally the camera's native output appears to be BGRA it doesn't appear to have the colour subsampling of 2vuy.. video frames. Might as well use higher quality BGRA frames incidentally the camera's native output appears to be BGRA it doesn't appear to have the colour subsampling of 2vuy 420v . The video everything that isn't Photo and Photo presets..

OpenGL ES (IPhone) alpha blending looks weird

http://stackoverflow.com/questions/4012035/opengl-es-iphone-alpha-blending-looks-weird

I found on the web that what's going on is that the pixel ordering in PNG image format files is converted from RGBA to BGRA and the color values are pre multiplied by the alpha channel value as well by a compression utility 'pngcrush' for device..

Reading samples via AVAssetReader

http://stackoverflow.com/questions/4049207/reading-samples-via-avassetreader

formats just will not work and if you're doing something real time certain video formats perform better than others BGRA is faster than ARGB for instance . Construct the actual track output and add it to the asset reader AVAssetReaderTrackOutput..

How to get the Y component from CMSampleBuffer resulted from the AVCaptureSession?

http://stackoverflow.com/questions/4085474/how-to-get-the-y-component-from-cmsamplebuffer-resulted-from-the-avcapturesessio

following videoOutput setVideoSettings NSDictionary dictionaryWithObject NSNumber numberWithInt kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey In this case a BGRA pixel format is specified I used this for matching a color.. NSNumber numberWithInt kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey In this case a BGRA pixel format is specified I used this for matching a color format for an OpenGL ES texture . Each pixel in that format has.. that coordinate. Apple's FindMyiCone sample from WWDC 2010 accessible along with the videos shows how to process raw BGRA data from each frame. I also created a sample application which you can download the code for here that performs color based..

iOS CVImageBuffer distorted from AVCaptureSessionDataOutput with AVCaptureSessionPresetPhoto

http://stackoverflow.com/questions/6540710/ios-cvimagebuffer-distorted-from-avcapturesessiondataoutput-with-avcapturesessio

alloc init stillOutput setOutputSettings NSDictionary dictionaryWithObject NSNumber numberWithInt kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey captureSession addOutput stillOutput 4 Hook up an AVCaptureVideoDataOutput to.. alloc init videoOutput setVideoSettings NSDictionary dictionaryWithObject NSNumber numberWithInt kCVPixelFormatType_32BGRA forKey id kCVPixelBufferPixelFormatTypeKey videoOutput setSampleBufferDelegate self queue dispatch_get_main_queue captureSession.. GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP_TO_EDGE glTexImage2D GL_TEXTURE_2D 0 GL_RGBA bufferWidth bufferHeight 0 GL_BGRA GL_UNSIGNED_BYTE CVPixelBufferGetBaseAddress cameraFrame glBindBuffer GL_ARRAY_BUFFER self vertexBuffer glBindBuffer GL_ELEMENT_ARRAY_BUFFER..

Is programmatically inverting the colors of an image possible?

http://stackoverflow.com/questions/6672517/is-programmatically-inverting-the-colors-of-an-image-possible

CGSize size self.size int width size.width int height size.height Create a suitable RGB alpha bitmap context in BGRA colour space CGColorSpaceRef colourSpace CGColorSpaceCreateDeviceRGB unsigned char memoryPool unsigned char calloc width..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

texture with that texture having been supplied from the texture cache. Once you render your scene into that FBO the BGRA pixels for that scene will be contained within your CVPixelBufferRef so there will be no need to pull them down using glReadPixels.. NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithInt kCVPixelFormatType_32BGRA kCVPixelBufferPixelFormatTypeKey NSNumber numberWithInt videoSize.width kCVPixelBufferWidthKey NSNumber numberWithInt.. NULL texture attributes GL_TEXTURE_2D GL_RGBA opengl format int videoSize.width int videoSize.height GL_BGRA native iOS format GL_UNSIGNED_BYTE 0 renderTexture glBindTexture CVOpenGLESTextureGetTarget renderTexture CVOpenGLESTextureGetName..

How can I mute the capture sound in AVFoundation?

http://stackoverflow.com/questions/9557081/how-can-i-mute-the-capture-sound-in-avfoundation

captureOutput setSampleBufferDelegate self queue queue dispatch_release queue Set the video output to store frame in BGRA It is supposed to be faster NSString key NSString kCVPixelBufferPixelFormatTypeKey NSNumber value NSNumber numberWithUnsignedInt.. key NSString kCVPixelBufferPixelFormatTypeKey NSNumber value NSNumber numberWithUnsignedInt kCVPixelFormatType_32BGRA NSDictionary videoSettings NSDictionary dictionaryWithObject value forKey key captureOutput setVideoSettings videoSettings..

Record the drawing as a m4v video file - OpenGL

http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl

an AVAssetWriter for this. In order to get decent recording performance you'll need to provide frames to the writer in BGRA format not the RGBA you get from reading the screen using glReadPixels . In my case I used a color swizzling shader to convert.. get from reading the screen using glReadPixels . In my case I used a color swizzling shader to convert from RGBA to BGRA before reading but you don't have that option with OpenGL ES 1.1. I'm not sure what you can do to work around this and still.. to work around this and still get decent recording speeds with RGBA frames I was seeing 3 5 FPS recording where with BGRA I get a solid 30 FPS . I set up the writer using code like the following frameData GLubyte malloc int videoSize.width int..