iphone Programming Glossary: cgdataproviderref
Any idea why this image masking code does not work? http://stackoverflow.com/questions/1133248/any-idea-why-this-image-masking-code-does-not-work CGContextDrawImage ctx CGRectMake 0 0 maskWidth maskHeight image CGContextRelease ctx now make a mask from the data. CGDataProviderRef dataProvider CGDataProviderCreateWithCFData dataBuffer CGImageRef mask CGImageMaskCreate maskWidth maskHeight 8 8 bytesPerRow..
fastest way to draw a screen buffer on the iphone http://stackoverflow.com/questions/2395650/fastest-way-to-draw-a-screen-buffer-on-the-iphone providerCallbacks 0 GetBytePointer ReleaseBytePointer GetBytesAtPosition 0 static CGImageRef cgIm static CGDataProviderRef dataProvider unsigned char imageData const size_t imageDataSize 320 480 4 NSTimer animationTimer NSTimeInterval animationInterval..
Extracting images from a PDF http://stackoverflow.com/questions/2475450/extracting-images-from-a-pdf renderingIntentName NULL CFDataRef imageDataPtr NULL CGImageRef cgImage maskImage NULL CGImageRef sourceImage NULL CGDataProviderRef dataProvider CGColorRenderingIntent renderingIntent CGFloat decodeValues NULL UIImage image if myStream NULL return nil..
iPhone SDK: accessing indexed color PNG images http://stackoverflow.com/questions/3251595/iphone-sdk-accessing-indexed-color-png-images img to see if the color space you end up with is an indexed one then use CGImageGetDataProvider to get a CGDataProviderRef which you can use with CGDataProviderCopyData to get to the actual bitmap data... edit a bounty always gets things going... path s n path UTF8String NSData file NSFileManager defaultManager contentsAtPath path if file printf file failed n CGDataProviderRef src CGDataProviderCreateWithCFData file if src printf image failed n CGImageRef img CGImageCreateWithPNGDataProvider src.. PNG image 2000 x 300 1 bit colormap non interlaced edit^2 This is how you access the bitmap data. ASCII art ftw CGDataProviderRef data CGImageGetDataProvider img NSData nsdata NSData CGDataProviderCopyData data char rawbuf malloc nsdata length if rawbuf..
Image processing Glamour filter in iphone http://stackoverflow.com/questions/3549396/image-processing-glamour-filter-in-iphone this question Here is the code for sepia image UIImage makeSepiaScale UIImage image CGImageRef cgImage image CGImage CGDataProviderRef provider CGImageGetDataProvider cgImage CFDataRef bitmapData CGDataProviderCopyData provider UInt8 data UInt8 CFDataGetBytePtr.. 255 outputGreen 255 if outputBlue 255 outputBlue 255 data i outputRed data i 1 outputGreen data i 2 outputBlue CGDataProviderRef provider2 CGDataProviderCreateWithData NULL data myDataLength NULL int bitsPerComponent 8 int bitsPerPixel 32 int bytesPerRow..
How exactly to make a CGImageRef from an image on disk http://stackoverflow.com/questions/3550201/how-exactly-to-make-a-cgimageref-from-an-image-on-disk you are pretty safe to use this on a background thread but to answer your question I believe the following would work. CGDataProviderRef dataProvider CGDataProviderCreateWithFilename file CGImageRef image CGImageCreateWithPNGDataProvider dataProvider NULL NO..
iOS SDK - Programmatically generate a PDF file http://stackoverflow.com/questions/4362734/ios-sdk-programmatically-generate-a-pdf-file 100 This code block will create an image that we then draw to the page const char picture Picture CGImageRef image CGDataProviderRef provider CFStringRef picturePath CFURLRef pictureURL picturePath CFStringCreateWithCString NULL picture kCFStringEncodingUTF8..
Creating UIImage from raw RGBA data http://stackoverflow.com/questions/4545237/creating-uiimage-from-raw-rgba-data i i f rawData 4 rawData 5 rawData 6 rawData 7 255.0f NSLog @ i i i f rawData 8 rawData 9 rawData 10 rawData 11 255.0f CGDataProviderRef provider CGDataProviderCreateWithData NULL rawData width height 4 NULL int bitsPerComponent 8 int bitsPerPixel..
CGPDFDocumentRef from NSData http://stackoverflow.com/questions/4875672/cgpdfdocumentref-from-nsdata this question You can create a PDF document using this function CGPDFDocumentRef CGPDFDocumentCreateWithProvider CGDataProviderRef provider To create the provider you can use this function CGDataProviderRef CGDataProviderCreateWithCFData CFDataRef data.. CGPDFDocumentCreateWithProvider CGDataProviderRef provider To create the provider you can use this function CGDataProviderRef CGDataProviderCreateWithCFData CFDataRef data and consider that NSData and CFDataRef are toll free bridged so you can use.. interchangeably. So summarizing try this NSData data ... my data from SQLite ... CFDataRef myPDFData CFDataRef data CGDataProviderRef provider CGDataProviderCreateWithCFData myPDFData CGPDFDocumentRef pdf CGPDFDocumentCreateWithProvider provider Don't forget..
How do I perform a fast pixellation filter on an image? http://stackoverflow.com/questions/5049041/how-do-i-perform-a-fast-pixellation-filter-on-an-image when needed I modify this data and have to update the image. This updating takes too long. This is how I am doing it CGDataProviderRef dataProvider CGProviderCrateWithData ..... CGImageRef cgImage CGImageCreate .... imageView setImage UIImage imageWithCGImage..
Getting RGB pixel data from CGImage http://stackoverflow.com/questions/6073259/getting-rgb-pixel-data-from-cgimage info kCGBitmapByteOrderMask kCGBitmapByteOrder16Big YES NO info kCGBitmapByteOrderMask kCGBitmapByteOrder32Big YES NO CGDataProviderRef provider CGImageGetDataProvider cgimage NSData data id CGDataProviderCopyData provider data autorelease const uint8_t bytes..
Convert html file to PDF Document in iOS using Cocoa-Touch http://stackoverflow.com/questions/6316192/convert-html-file-to-pdf-document-in-ios-using-cocoa-touch 100 This code block will create an image that we then draw to the page const char picture Picture CGImageRef image CGDataProviderRef provider CFStringRef picturePath CFURLRef pictureURL picturePath CFStringCreateWithCString NULL picture kCFStringEncodingUTF8..
How to make one color transparent on a UIImage? http://stackoverflow.com/questions/633722/how-to-make-one-color-transparent-on-a-uiimage CGRect rect 0 0 mWidth mHeight CGContextDrawImage cgctx rect ref bufferdata CGBitmapContextGetData cgctx CGDataProviderRef provider CGDataProviderCreateWithData NULL bufferdata mWidth mHeight 4 NULL CGImageRef savedimageref CGImageCreate mWidth..
Dispelling the UIImage imageNamed: FUD http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud originalImage uiImage.CGImage CFDataRef imageData CGDataProviderCopyData CGImageGetDataProvider originalImage CGDataProviderRef imageDataProvider CGDataProviderCreateWithCFData imageData CFRelease imageData CGImageRef image CGImageCreate CGImageGetWidth..
|