cgimage Questions
13
Solved
I am trying to convert an image into grayscale in the following way:
#define bytesPerPixel 4
#define bitsPerComponent 8
-(unsigned char*) getBytesForImage: (UIImage*)pImage
{
CGImageRef image = ...
Couching asked 19/8, 2009 at 9:55
3
What I'm essentially trying to do is have a text label 'cut' a text-shaped hole through the view. I've tried using self.mask = uiLabel but those refused to position the text correctly so I'm approa...
Jonniejonny asked 26/7, 2017 at 1:54
8
Solved
I'm facing an image orientation issue when cropping a square portion of an image out of a rectangular original image. When image is in landscape, it's fine. But when it is in portrait, it seems tha...
1
Solved
I have a project where I use ScreenCaptureKit. For various reasons out of the scope of the question, the format that I configure ScreenCaptureKit to use is kCVPixelFormatType_32BGRA -- I need the r...
Dorladorlisa asked 2/2, 2023 at 19:31
5
Solved
in my Cocoa application, I load a .jpg file from disk, manipulate it. Now it needs to be written to disk as a .png file. How can you do that?
Thanks for your help!
Allopath asked 24/8, 2009 at 7:52
2
Solved
I have built a camera using AVFoundation.
Once my AVCaptureStillImageOutput has completed its captureStillImageAsynchronouslyFromConnection:completionHandler: method, I create a NSData object lik...
Metope asked 22/10, 2013 at 20:41
1
I am making an swift video app.
In my app, I need to crop and horizontally flip CVPixelBuffer and return result which type is also CVPixelBuffer.
I tried few things.
First, I used 'CVPixelBuf...
Shopwindow asked 21/3, 2019 at 18:36
6
Solved
Is there an easy way to do this that works in 10.5?
In 10.6 I can use nsImage CGImageForProposedRect: NULL context: NULL hints: NULL
If I'm not using 1b black and white images (Like Group 4 TIFF...
Nessa asked 30/3, 2010 at 19:27
6
Solved
I have a UIImage that I'm getting from a UIImagePickerController. When I receive the image from the - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NS...
Vanny asked 11/5, 2012 at 3:6
4
2
Solved
I am working with the Photos framework and have created an app that will apply a filter to an image. Now instead of applying a filter, I want to add text on top of the image. This API provides me w...
Dorie asked 1/9, 2014 at 23:46
3
I have an app so far that allows the user to free draw (like a sketch pad) on a UIImageView element.
I want to get the raw RGB pixel data (as 0 to 255 integer values) as a multidimensional array s...
5
Solved
I have a screenshot of the entire screen, screenshot, generated using the following:
let layer = UIApplication.sharedApplication().keyWindow!.layer
let scale = UIScreen.mainScreen().scale
UIGraph...
Carthy asked 15/8, 2015 at 3:24
2
Solved
In Objc I use CGImageRelease method after the treatment of an image. But in Swift this method is not available.
On the Apple documentation after Retaining and Releasing Images there is a 2 Objecti...
1
Solved
I have a generative art application which starts with a small set of points, grows them outwards, and checks the growth to make sure it doesn't intersect with anything. My first naive implementatio...
Hydrostatic asked 6/10, 2018 at 4:18
2
1
I need to save and load metal textures to a file. Example code below is below. I'm noticing the RGB values are changing as it gets saved and reloaded again.
metal texture pixel: RGBA: 42,79,12,95 ...
Hemlock asked 7/4, 2018 at 23:34
5
Solved
I created a function for splitting an image into multiple images, but when I take take the CGImage of the UIImage, the CGImage returns NULL
NSArray* splitImage(UIImage* image,NSUInteger pieces) {
...
Odontoblast asked 5/4, 2012 at 4:6
3
Solved
On CGImageDestinationRef Apple's reference it mentions that It can contain thumbnail images as well as properties for each image. The part with the properties works nice, by setting the properties ...
Mchail asked 3/1, 2012 at 11:9
3
Solved
Loading a CGImage or NSImage from a file using a standard image format (jpeg, gif, png et.) is all very simple.
However, I now need to create a CGImage from an array in bytes in memory generated ...
1
Solved
This code type checks and compiles but then crashes. How do I save a CGImage to Data so that I can read it in again later.
let cgi: CGImage? = ...
var mData = Data()
let imageDest = CGImageDestin...
1
Solved
I have a view controller which allows a user to take a picture. I am setting the avcapture bounds to be the bounds of a view on screen.
Above this view I have a collection view. So users can captu...
Chorography asked 24/10, 2017 at 15:4
3
Solved
All the code I can find revolves around loading images directly into visual controls.
However, I have my own cache system (converting a project from another language) and so I as efficient as poss...
3
Solved
I have a UIImage which is loaded from a CIImage with:
tempImage = [UIImage imageWithCIImage:ciImage];
The problem is I need to crop tempImage to a specific CGRect and the only way I know how to d...
Applecart asked 18/1, 2013 at 15:44
1
Solved
I am trying to convert a CGImage into a CIImage; however, it is not working.
This line of code:
let personciImage = CIImage(CGImage: imageView.image!.CGImage!)
throws the following error
Amb...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.