¡@

Home 

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

iphone Programming Glossary: buffer

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

drawing the image since you want the image's alpha value not the one which was in the context's buffer before CGContextSetBlendMode context kCGBlendModeCopy Edit after thinking You could do the lookup much..

How do I wrap text in a UITableViewCell without a custom cell

http://stackoverflow.com/questions/129502/how-do-i-wrap-text-in-a-uitableviewcell-without-a-custom-cell

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

docs self setBitmapData CGDataProviderCopyData CGImageGetDataProvider self CGImage Create a buffer to store bitmap data unitialized memory as long as the data self setPixelBitData malloc CFDataGetLength.. as the data self setPixelBitData malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the..

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

to fill in a lot of blanks but I think that the only really hard remaining part is getting a pixel buffer from a CGImage CVPixelBufferRef newPixelBufferFromCGImage CGImageRef image NSDictionary options NSDictionary.. NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault frameSize.width frameSize.height kCVPixelFormatType_32ARGB.. frameSize.width frameSize.height kCVPixelFormatType_32ARGB CFDictionaryRef options pxbuffer NSParameterAssert status kCVReturnSuccess pxbuffer NULL CVPixelBufferLockBaseAddress pxbuffer 0 void..

Make movie file with picture Array and song file, using AVAsset

http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset

startWriting videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage.. CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage m_PictArray objectAtIndex i CGImage andSize size BOOL append_ok NO int j.. int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool buffer append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool..

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

alternative to glReadPixels in iPhone OpenGL ES 2.0 Is there any faster way to access the frame buffer than using glReadPixels I would need read only access to a small rectangular rendering area in the frame.. glReadPixels I would need read only access to a small rectangular rendering area in the frame buffer to process the data further in CPU. Performance is important because I have to perform this operation.. You can take advantage of this to grab the pixels for an OpenGL ES rendering by using a framebuffer object FBO with an attached texture with that texture having been supplied from the texture cache. Once..

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

code You also want to set the blend mode to replace before drawing the image since you want the image's alpha value not the one which was in the context's buffer before CGContextSetBlendMode context kCGBlendModeCopy Edit after thinking You could do the lookup much more efficient by building the smallest possible CGBitmapContext..

How do I wrap text in a UITableViewCell without a custom cell

http://stackoverflow.com/questions/129502/how-do-i-wrap-text-in-a-uitableviewcell-without-a-custom-cell

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

data Get the bitmap data from the receiver's CGImage see UIImage docs self setBitmapData CGDataProviderCopyData CGImageGetDataProvider self CGImage Create a buffer to store bitmap data unitialized memory as long as the data self setPixelBitData malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes.. a buffer to store bitmap data unitialized memory as long as the data self setPixelBitData malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the first element of pixelByteData Essentially what we're doing..

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

¦] videoWriter finishWriting You ™ll still have to fill in a lot of blanks but I think that the only really hard remaining part is getting a pixel buffer from a CGImage CVPixelBufferRef newPixelBufferFromCGImage CGImageRef image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool.. numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault frameSize.width frameSize.height kCVPixelFormatType_32ARGB CFDictionaryRef options pxbuffer NSParameterAssert.. pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault frameSize.width frameSize.height kCVPixelFormatType_32ARGB CFDictionaryRef options pxbuffer NSParameterAssert status kCVReturnSuccess pxbuffer NULL CVPixelBufferLockBaseAddress pxbuffer 0 void pxdata CVPixelBufferGetBaseAddress pxbuffer NSParameterAssert..

Make movie file with picture Array and song file, using AVAsset

http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset

addInput videoWriterInput Start a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage m_PictArray objectAtIndex i CGImage andSize size BOOL append_ok.. videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage m_PictArray objectAtIndex i CGImage andSize size BOOL append_ok NO int j 0 while append_ok j 30 if adaptor.assetWriterInput.readyForMoreMediaData.. d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool buffer append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool adaptor.pixelBufferPool NSParameterAssert bufferPool..

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

alternative to glReadPixels in iPhone OpenGL ES 2.0 Is there any faster way to access the frame buffer than using glReadPixels I would need read only access to a small rectangular rendering area in the frame buffer to process the data further in CPU. Performance.. Is there any faster way to access the frame buffer than using glReadPixels I would need read only access to a small rectangular rendering area in the frame buffer to process the data further in CPU. Performance is important because I have to perform this operation repeatedly. I have searched the web and found some approach.. get quick access to the raw pixels within an OpenGL ES texture. You can take advantage of this to grab the pixels for an OpenGL ES rendering by using a framebuffer object FBO with an attached texture with that texture having been supplied from the texture cache. Once you render your scene into that FBO the BGRA pixels for..

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

mode to replace before drawing the image since you want the image's alpha value not the one which was in the context's buffer before CGContextSetBlendMode context kCGBlendModeCopy Edit after thinking You could do the lookup much more efficient by..

How do I wrap text in a UITableViewCell without a custom cell

http://stackoverflow.com/questions/129502/how-do-i-wrap-text-in-a-uitableviewcell-without-a-custom-cell

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

CGImage see UIImage docs self setBitmapData CGDataProviderCopyData CGImageGetDataProvider self CGImage Create a buffer to store bitmap data unitialized memory as long as the data self setPixelBitData malloc CFDataGetLength bitmapData Copy.. memory as long as the data self setPixelBitData malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the first element of..

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

You ™ll still have to fill in a lot of blanks but I think that the only really hard remaining part is getting a pixel buffer from a CGImage CVPixelBufferRef newPixelBufferFromCGImage CGImageRef image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys.. NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault frameSize.width frameSize.height kCVPixelFormatType_32ARGB.. kCFAllocatorDefault frameSize.width frameSize.height kCVPixelFormatType_32ARGB CFDictionaryRef options pxbuffer NSParameterAssert status kCVReturnSuccess pxbuffer NULL CVPixelBufferLockBaseAddress pxbuffer 0 void pxdata CVPixelBufferGetBaseAddress..

Make movie file with picture Array and song file, using AVAsset

http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset

a session videoWriter startWriting videoWriter startSessionAtSourceTime kCMTimeZero Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage m_PictArray objectAtIndex.. Video encoding CVPixelBufferRef buffer NULL convert uiimage to CGImage. int frameCount 0 for int i 0 i 20 i buffer self pixelBufferFromCGImage m_PictArray objectAtIndex i CGImage andSize size BOOL append_ok NO int j 0 while append_ok j.. CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool buffer append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool adaptor.pixelBufferPool..

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

alternative to glReadPixels in iPhone OpenGL ES 2.0 Is there any faster way to access the frame buffer than using glReadPixels I would need read only access to a small rectangular rendering area in the frame buffer to process.. frame buffer than using glReadPixels I would need read only access to a small rectangular rendering area in the frame buffer to process the data further in CPU. Performance is important because I have to perform this operation repeatedly. I have.. an OpenGL ES texture. You can take advantage of this to grab the pixels for an OpenGL ES rendering by using a framebuffer object FBO with an attached texture with that texture having been supplied from the texture cache. Once you render your..

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

declared with corresponding synthesized properties Reference to Quartz CGImage for receiver self CFDataRef bitmapData Buffer holding raw pixel data copied from Quartz CGImage held in receiver self UInt8 pixelByteData A pointer to the first pixel..

ASSETWriterInput for making Video from UIImages on Iphone Issues

http://stackoverflow.com/questions/3983882/assetwriterinput-for-making-video-from-uiimages-on-iphone-issues

. Everything looks good except there's No data in the video file. What's wrong 1 Adaptor class AVAssetWriterInputPixelBufferAdaptor avAdaptor AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput writerInput.. in the video file. What's wrong 1 Adaptor class AVAssetWriterInputPixelBufferAdaptor avAdaptor AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput writerInput sourcePixelBufferAttributes NULL avAdaptor appendPixelBufferixelBuffer.. Adaptor class AVAssetWriterInputPixelBufferAdaptor avAdaptor AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput writerInput sourcePixelBufferAttributes NULL avAdaptor appendPixelBufferixelBuffer withPresentationTime..

Use of VAO around VBO in Open ES iPhone app Causes EXC_BAD_ACCESS When Call to glDrawElements

http://stackoverflow.com/questions/6240863/use-of-vao-around-vbo-in-open-es-iphone-app-causes-exc-bad-access-when-call-to-g

the next level. Following some best practices from Apple I'm trying to implement Vertex Array Objects around my Vertex Buffer Objects VBO . I setup my VBOs and VAOs like this void setupVBOs glBindBuffer GL_ARRAY_BUFFER 0 glBindBuffer GL_ELEMENT_ARRAY_BUFFER.. Vertex Array Objects around my Vertex Buffer Objects VBO . I setup my VBOs and VAOs like this void setupVBOs glBindBuffer GL_ARRAY_BUFFER 0 glBindBuffer GL_ELEMENT_ARRAY_BUFFER 0 glBindVertexArrayOES 0 glGenVertexArraysOES 1 directArrayObject.. my Vertex Buffer Objects VBO . I setup my VBOs and VAOs like this void setupVBOs glBindBuffer GL_ARRAY_BUFFER 0 glBindBuffer GL_ELEMENT_ARRAY_BUFFER 0 glBindVertexArrayOES 0 glGenVertexArraysOES 1 directArrayObject glBindVertexArrayOES directArrayObject..

UITableView with dynamic cell heights — what do I need to do to fix scrolling down?

http://stackoverflow.com/questions/680067/uitableview-with-dynamic-cell-heights-what-do-i-need-to-do-to-fix-scrolling-d

the height of the cell based on the text quite fine CGFloat heightForTweetCellWithString NSString text CGFloat height Buffer text sizeWithFont Font constrainedToSize Size lineBreakMode LineBreakMode .height return MAX height MinHeight CGFloat tableView..

AVCaptureSession only got video buffer

http://stackoverflow.com/questions/9257052/avcapturesession-only-got-video-buffer

I have inspected AVCaptureSession delegate method void captureOutput AVCaptureOutput captureOutput didOutputSampleBuffer CMSampleBufferRef sampleBuffer fromConnection AVCaptureConnection connection it seems only the delegate method only got.. AVCaptureSession delegate method void captureOutput AVCaptureOutput captureOutput didOutputSampleBuffer CMSampleBufferRef sampleBuffer fromConnection AVCaptureConnection connection it seems only the delegate method only got one video sample.. delegate method void captureOutput AVCaptureOutput captureOutput didOutputSampleBuffer CMSampleBufferRef sampleBuffer fromConnection AVCaptureConnection connection it seems only the delegate method only got one video sample buffer at the..

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

because I have to perform this operation repeatedly. I have searched the web and found some approach like using Pixel Buffer Object and glMapBuffer but it seems that OpenGL ES 2.0 does not support them. iphone ios opengl es opengl es 2.0 share.. this operation repeatedly. I have searched the web and found some approach like using Pixel Buffer Object and glMapBuffer but it seems that OpenGL ES 2.0 does not support them. iphone ios opengl es opengl es 2.0 share improve this question.. 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 . This is much much faster than using glReadPixels in my..