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
3
votes
1 answer

How to create a ICNS icon programmatically?

OK this is what I want : Take some NSImages Add them to an ICNS file Save it This is what I've done so far (purely as a test) : - (CGImageRef)refFromImage:(NSImage*)img { CGImageSourceRef source; source =…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223
2
votes
0 answers

CGBitmapContext byte order changed to ABGR - and CGImage metadata doesn't seem to match bitmap contents

I am standardizing the orientation and max size of an image using the following code (gleaned from elsewhere): + (UIImage *)scaleAndRotateImage:(UIImage *)image { int kMaxResolution = 960; // Or whatever CGImageRef imgRef = image.CGImage; …
Spanner
  • 312
  • 3
  • 11
2
votes
1 answer

Alpha Detection in Layer OK on Simulator, not iPhone

First, check out this very handy extension to CALayer from elsewhere on SO. It helps you determine if a point in a layer's contents-assigned CGImageRef is or isn't transparent. n.b.: There is no guarantee about a layer's contents being representable…
2
votes
1 answer

Rotating an image prior to saving in iOS

In my app, I need to save an image. I need the image to always be saved as a portrait, even if the device is in landscape mode. I am checking to see if the device is in landscape mode and if it is, I would like to rotate my image before it's saved…
Brodie
  • 3,526
  • 8
  • 42
  • 61
2
votes
2 answers

How would I draw to a mutable in-memory bitmap?

I'm trying to write a simple painting app for iOS as a first non-trivial project. Basically, on every touch event, I need to open a graphics context on the bitmap, draw something over top of where the user left off, and close it. UIImage is…
James C.
  • 23
  • 4
2
votes
1 answer

MTLTexture vs CGImageRef

What is the main difference between MTLTexture vs CGImageRef? When do we need to use MTLTexture instead of CGImageRef (and vice versa)? I have an app (say a video game) that draw everything by itself on a dedicated surface. this includes animation…
zeus
  • 12,173
  • 9
  • 63
  • 184
2
votes
1 answer

Converting CGImageRef to NSData increase app memory usage in Mac app

I am creating a mac app in which I am converting the CGImageRef to NSData and then Base64 and sending on a server. This thing happens in Loop, and every time image converted in NSData app memory usage increase. Here is my code CGImageRef screenShot…
Dilip Manek
  • 9,095
  • 5
  • 44
  • 56
2
votes
1 answer

How can I create a finite CIImage?

The CIColorMap CIFilter takes a CIImage as an input. It makes sense to generate that input image dynamically using another CIFilter (such as CILinearGradient) but providing the result of a filter to the color map filter will result in the following…
Warpling
  • 2,024
  • 2
  • 22
  • 38
2
votes
1 answer

Why use CGImageRef not CGImage instead?

I'm a new one to the media layer and the photo layer ,and what makes me confused is that there a lot of objects like CGImageRef and CMSampleBufferRef ,and I don't know why apple let us use objects like "XXXRef" not objects like "XXX"? I know there…
Onee
  • 67
  • 1
  • 8
2
votes
2 answers

How to create a CGImageRef from a NSBitmapImageRep?

How can I create a CGImageRef from a NSBitmapImageRep? Or how can I define a complete new CGImageRef in the same way as the NSBitmapImageRep? The definition of a NSBitmapImageRep works fine. But I need an image as CGImageRef. unsigned char *plane =…
3ef9g
  • 781
  • 2
  • 9
  • 19
2
votes
1 answer

How do I use CGImageRef to loop over parts of an image that has been resized without increasing pixelation?

I am trying to create an effect that looks as if 2 images are woven into each other. So I scaled the first image to be the background and I am looping over the second image using several UIIMageViews on top of the background to give my desired look.…
sfbarry14
  • 61
  • 5
2
votes
0 answers

How to align memory in Objective-C CGIMageRef to fix EXC_ARC_DA_ALIGN error

I've used this snippet of code for years in my apps without fail. It cuts out a set of pieces from a CGImageRef I pass in and a black and white mask. I am attempting to migrate the code into an enviornment where the layout will be based on…
EJB
  • 21
  • 1
2
votes
2 answers

Memory problems with imageWithCGImage

So here's the gist I've got a program that has a large image composed of many little images and it takes this image and separates it into many smaller images (like frames for a film) that the user can then go and scrub through. I currently use this…
What what
  • 527
  • 4
  • 15
2
votes
1 answer

How can I show an image in a NSView using an CGImageRef image

I want to show an image in NSview or in the NSImageView. In my header file I have @interface FVView : NSView { NSImageView *imageView; } @end here is what I been trying to do in my implementation file: - (void)drawRect:(NSRect)dirtyRect { …
joseamck
  • 39
  • 5
2
votes
0 answers

CGImageCreateWithMask on a masked image returns nil

I am trying to use CGImageCreateWithMask to mask an image (CGImageRef). The result is another CGImageRef which I store in a local variable. When I perform CGImageCreateWithMask on the result of the first pass (CGImageRef local variable), I get nil.…
user3154427
  • 155
  • 1
  • 8
1 2
3
10 11