Questions tagged [cgimageref]

The CGImageRef opaque type represents bitmap images and bitmap image masks, based on sample data supplied. This is part of the Core Graphics framework.

The CGImageRef opaque type represents bitmap images and bitmap image masks, based on sample data supplied. A bitmap (or sampled) image is a rectangular array of pixels, with each pixel representing a single sample or data point in a source image. This is part of the Core Graphics framework.

See and as well.

151 questions
5
votes
1 answer

Converting UIImage to CGImage cause rotation of Image

I am trying to crop image by my custom cropper. Not from the UIImagePickerController's. Now for that I am showing the Image captured from Image Picker in a UIImgeView by handling UIImagePicker's delegate: -…
Kapil Choubisa
  • 5,152
  • 9
  • 65
  • 100
5
votes
1 answer

how to convert NSData of image to CGImageRef with out memory leaks

i converted NSData of image to CGImage as below but i am getting memory leaks there but any one tell me how to convert that with out getting leaks: CFDataRef imgData; CGDataProviderRef imgDataProvider; CGImageRef image1; imgData = (CFDataRef)[array…
Steve Gear
  • 757
  • 2
  • 16
  • 44
4
votes
3 answers

CGImageRef property retain or not retain

I have a question on how to handle a CGImageRef as a synthesized property of a class. If I define an CGImageRef with @property (nonatomic, retain) CGImageRef image; then the compiler complains that "retain" cannot be used here. If I leave out the…
fishinear
  • 6,101
  • 3
  • 36
  • 84
4
votes
1 answer

How to release CGImageRef correctly?

My Code like this: CGImageRef ImageCreateWithFile(NSString *filePath) { if(NULL == filePath) return NULL; NSData *data = [[NSData alloc] initWithContentsOfFile:filePath]; if(NULL == data) return NULL; CGImageSourceRef isrc =…
henry wong
  • 89
  • 7
4
votes
0 answers

Error Missage When Loading Photo: CreateWrappedSurface() failed for a dataprovider-backed CGImageRef

I have an app I am creating, which uploads images to a server. I used GPUImage, and GKImagePicker libraries when cropping the image and adding filters. I am not adding any filters at this point, so I don't think the filters is the problem. I think…
hockeybro
  • 981
  • 1
  • 13
  • 41
4
votes
1 answer

CGImageRef faster way to access pixel data?

My current method is: CGDataProviderRef provider = CGImageGetDataProvider(imageRef); imageData.rawData = CGDataProviderCopyData(provider); imageData.imageData = (UInt8 *) CFDataGetBytePtr(imageData.rawData); I only get about 30 frames per second. I…
Gan
  • 99
  • 8
4
votes
0 answers

iOS Swift how to get an image capture on hls(http live stream)?

How to get image capture on hls(http live stream) with Swift on iOS? return nil at "capturedImage" on below code. func onCaptureButtonClick(sender : UIButton){ let generator = AVAssetImageGenerator(asset: avAsset) generator.maximumSize =…
user818992
  • 97
  • 1
  • 7
4
votes
1 answer

Creating NSImage from CGImageRef causes image pixel size to double

capture is a CGImageRef returned from a call to CGWindowListCreateImage(). When I try to turn it into an NSImage directly via initWithCGImage:size: it mysteriously doubles in size. If I instead manually create an NSBitmapImageRep from capture and…
jaz303
  • 1,136
  • 9
  • 11
4
votes
1 answer

Correct way to handle CGImageRef in containers under ARC

I am new to incorporating arc in my projects. I am trying to understand __bridge and its little friends so that I can properly cast my CGImageRef's when adding and removing them from containers. I am getting a "Potential leak of an object stored…"…
4
votes
0 answers

Conversion of CIImage to CGImageRef which could be used to create a GLK texture

I have a CIImage which is the result/output image of a CIFilter. Now I want to create a texture of that image using GLKTextureLoader. I am using the following function which requires a CGImageRef to achieve that. [GLKTextureLoader…
Anand
  • 115
  • 1
  • 12
4
votes
1 answer

UIImage from GRKPhoto using ALAsset

I'm using grabKit in order to allow users to import their Instagram, Facebook and local pictures to my app. The problem comes when the photo is local. In this case, I use a method that works when the user selects the photo. The standard code I…
IOS_DEV
  • 949
  • 3
  • 12
  • 33
3
votes
2 answers

Xcode Static Analyser reports one leak under ARC - CFImageRef - how to resolve

Out of some 2k lines of code, the Static Analyser has only one problem, thus: spellDetailModalViewController *detailVC = [[spellDetailModalViewController alloc]init]; UIImage *tempImage = self.spellImageView.image; CGRect newSize = CGRectMake(0.0,…
Skybird
  • 159
  • 1
  • 11
3
votes
1 answer

draw CGImageRef (not UIImage) into image context

Here's exactly how to draw a UIImage in to context: UIGraphicsBeginImageContextWithOptions(size, NO, 0.0f); [someUIImage drawInRect:CGRectMake(...)]; [someOtherUIImage drawInRect:CGRectMake(...)]; [someOtherUIImage…
Fattie
  • 27,874
  • 70
  • 431
  • 719
3
votes
1 answer

When is it appropriate to release CGImageRef?

When XCode analyzes my code, it finds potential memory leaks. I use ARC, but I learned that ARC doesn't handle C types. Since I use CGImageRef in order to create UIImage with it and assign to UIImageView.image property, When is it appropriate to…
neo
  • 1,952
  • 2
  • 19
  • 39
3
votes
2 answers

How to move the image on the CGContextRef

An image has been drawn on the CGContextRef: CGContextDrawImage(context, CGRectMake(0, 0, width, height), image); In another function, I want to move the image to the rect like CGRectMake(100, 100, width, height); How can I do? void…
KChen
  • 1,922
  • 14
  • 15
1
2
3
10 11