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
1
vote
0 answers

UIImage from imageWithCGImage doesn't retain pointer (EXC_BAD_ACCESS)

I have a custom class Frame that gets image data from multiple sources. The class can generate an UIImage. The problem is when a generated UIImage is drawn on the screen, it crashes with EXC_BAD_ACCESS. Callstack is empty, it ends at…
nbroby
  • 83
  • 1
  • 5
1
vote
1 answer

UIImage save to PNG cause memory leak

I'd like to save UIImage in NSArray to local as PNG. However, When I used UIImagePNGRepresentation in a for-loop, memory grew up greatly even though there is already a @autoreleasepool. for (int i = 0; i < array.count; i++) { @autoreleasepool…
M.J. Zhuo
  • 11
  • 2
1
vote
1 answer

HJImagesToVideo with Swift 2

I am using the source of HJImagesToVideo https://github.com/HarrisonJackson/HJImagesToVideo When I compiled the sample code provided by him, it is working fine with Xcode 7.2 but when I am using this in my swift project it is not working and showing…
Muhammad Raza
  • 952
  • 7
  • 24
1
vote
1 answer

iOS - CGImageRef Potential Leak

I have this code: CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], rect); UIImage *outputimage = [UIImage imageWithCGImage:imageRef scale:image.scale …
sooon
  • 4,718
  • 8
  • 63
  • 116
1
vote
1 answer

CGImageDestination not taking properties

I am exporting an animated gif using swift targeting Mac OS, which works but the properties I've set aren't being applied. I have set up my properties and when I log them they show up like so: { HasGlobalColorMap = 1; LoopCount = 0; } In a loop I…
Jay
  • 902
  • 2
  • 12
  • 27
1
vote
0 answers

Getting EX_BAD_ACCESS while printing object of CGImageRef

In my app I am getting bed access error while printing the object of CGImageRef. So please look into my below code and help me out - (CGImageRef)cachedImageForPageIndex:(NSUInteger)pageIndex { NSNumber *pageIndexNumber = [NSNumber…
Arvind
  • 450
  • 1
  • 4
  • 11
1
vote
2 answers

IOS: How to split an UIImage into parts

In one of my application I need to split UIImage into multiple parts. The following was the code I am using to split. Here my problem is I am unable to load the image view by adding the image to UIImageView. - (void)viewDidLoad { UIImage* image…
Sekhar Bhetalam
  • 4,501
  • 6
  • 33
  • 52
1
vote
1 answer

CGImageDestination saves CMYK color space as RGB

I have a CGImage in CMYK color space (i.e. CGColorSpaceGetModel returns kCGColorSpaceModelCMYK when queried via CGImageGetColorSpace). However, when I try saving it via CGImageDestination, it gets converted to RGBColorSpace. I've tried to set the…
cfx Chris
  • 51
  • 6
1
vote
1 answer

How can I manipulate the pixel values in a CGImageRef in Xcode

I have some CGImageRef cgImage = "something" Is there a way to manipulate the pixel values of this cgImage? For example if this image contains values between 0.0001 and 3000 thus when I try to view or release the image this way in an NSImageView…
joseamck
  • 39
  • 5
1
vote
0 answers

What does this iOS UIImage - CGImageRef statement do?

In plain words, what does this statement do : [self.searchBar setBackgroundImage:[UIImage imageWithCGImage:self.searchBar.backgroundImage.CGImage]]; The reason why I am asking this is because I have the following problem. I have a search bar linked…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
1
vote
3 answers

Release CGImageRef to avoid memory leak

I want call multiple times per second the method of image but I have a memory leak. I tried to do CFRelease(rawImageRef); but returns the next error: -[Not A Type retain]: message sent to deallocated instance 0x14dd3770 Update with code: -…
mhergon
  • 1,688
  • 1
  • 18
  • 39
1
vote
0 answers

CGImage to NSBitmapImageRep on OSX

I'm pretty sure that this topic has been discussed here several times, but I have a very weird issue related to conversion of a CGImage to a NSBitmapImageRep on OSX (10.8 and 10.9). The CGImage object comes from AVAssetImageGenerator…
1
vote
2 answers

How to get PNG base64 encoded from CGImageRef?

i have CGImageRef object (var quartzImage). How convert this object to format PNG data for web: "data:image/png;base64,"+ base64 data image my code: - (void)captureOutput:(AVCaptureOutput *)captureOutput…
Seryh
  • 3,144
  • 1
  • 16
  • 18
1
vote
0 answers

iOS Best way to draw multiple small images on a large UIView

I have a very, very large UIView, which uses a CATiledLayer. I need to render a lot of small images onto it. These small images are stored in one large image (1024x1024). They may have transparency. At the moment, I use CGImageCreateWithImageInRect…
PhilipG
  • 113
  • 6
1
vote
1 answer

Converting CVImageBufferRef YUV 420 to cv::Mat RGB and displaying it in a CALayer?

Once that I can't get successfully anything different of YCbCr 420 from the camera (https://stackoverflow.com/questions/19673770/objective-c-avcapturevideodataoutput-videosettings-how-to-identify-which-pix) So, my goal is to display this…
Eduardo Reis
  • 1,691
  • 1
  • 22
  • 45