quartz-graphics

maximum image size in CIFilter / CIKernel?

女生的网名这么多〃 提交于 2021-02-06 09:30:48
问题 Does anyone know what the limitations are on image size with custom CIFilters? I've created a filter that performs as expected when the images are up to 2 mega pixels but then produce very strange results when the images are larger. I've tested this both in my cocoa app as well as in quartz composer. The filter I've developed is a geometry-type distortion filter that (I think) requires an ROI and a DOD that spans the entire input image. I've created this filter for remapping panoramic images

CGImage recording distortion

自作多情 提交于 2020-06-27 12:51:08
问题 I've written a helper class to record a NSView and save it to a QuickTime file. The view is recorded fine to a QuickTime movie but the output is skewed for some reason. The core of my class is below, and the output is this: - (void) captureImage { [self getCGImageFromView]; pixelBuffer = [self getPixelBufferFromCGImage:viewCGImage size:CGRectMake(0, 0, mViewRect.size.width, mViewRect.size.height).size]; if(pixelBuffer) { if(![adapter appendPixelBuffer:pixelBuffer withPresentationTime

How do I process a mouse click using Quartz events?

偶尔善良 提交于 2020-02-23 04:06:19
问题 I have a CGEventTap and I would like to observe and process all system mouse click events. Detecting a mouse click event is easy, but I don’t want some of the clicks to get processed by the rest of the system. And I can’t figure out how. The system only sends low-level events like mouseUp , mouseDown , mouseDragged and so on. When I receive a mouseDown event, I don’t know if it’s a part of a mouse click yet, could be a drag event. I have to wait for the following event – if it’s a mouseUp , I

Core Graphics coordinate system

霸气de小男生 提交于 2020-02-21 10:22:06
问题 When overriding drawRect I've found that the coordinates there use 0,0 as the upper left. But the Apple UIView Programming Guide says this: Some iOS technologies define default coordinate systems whose origin point and orientation differ from those used by UIKit. For example, Core Graphics and OpenGL ES use a coordinate system whose origin lies in the lower-left corner of the view or window and whose y-axis points upward relative to the screen. I'm confused; are they talking about something

getting the text up-side down in core graphic

*爱你&永不变心* 提交于 2020-01-16 19:57:48
问题 I am drawing a text in core graphic by following - (void)drawRect:(CGRect)rect { CGContextTranslateCTM(context, 20, 150); CGContextScaleCTM(context, 1, 1); // Draw the text using the MyDrawText function myDrawText(context, viewBounds); } void myDrawText (CGContextRef myContext, CGRect contextRect) { CGFloat w, h; w = contextRect.size.width; h = contextRect.size.height; CGAffineTransform myTextTransform; CGContextSelectFont (myContext, "Helvetica-Bold", h/12, kCGEncodingMacRoman);

getting the text up-side down in core graphic

99封情书 提交于 2020-01-16 19:57:27
问题 I am drawing a text in core graphic by following - (void)drawRect:(CGRect)rect { CGContextTranslateCTM(context, 20, 150); CGContextScaleCTM(context, 1, 1); // Draw the text using the MyDrawText function myDrawText(context, viewBounds); } void myDrawText (CGContextRef myContext, CGRect contextRect) { CGFloat w, h; w = contextRect.size.width; h = contextRect.size.height; CGAffineTransform myTextTransform; CGContextSelectFont (myContext, "Helvetica-Bold", h/12, kCGEncodingMacRoman);

I want to use Quartz to make a single color image a different color

孤者浪人 提交于 2020-01-16 19:48:29
问题 I'm sure the answer for this exists on stackoverflow, but I've been looking and haven't been able to find it yet. Essentially, I have several images with transparent backgrounds and some black imagery, I want to be able to change the color of the black part to some other arbitrary color. I'm relatively sure this is achievable with Quartz Image Masking, but I haven't been able to find any good examples, so that is what I'm looking for. Other solutions are also welcome. Thanks!!! UPDATE: I

Curving/warping views with CoreAnimation or OpenGL for carousel effect

独自空忆成欢 提交于 2020-01-13 08:37:28
问题 Right now I'm populating a UIScrollView with a series of views. The views need to be warped to make the UIScrollView appear like a carousel. In other words when the user scrolls it needs to be like a circle. I've never done anything quite like this before, but I'm assuming CoreAnimation is out of the question and OpenGL needs to be used. If this is possible with CoreAnimation or Quartz then I really just need a sample on how to warp the views and I can figure the rest out myself but I'm not

CGWindowListCopyWindowInfo, kCGWindowLayer and window level

荒凉一梦 提交于 2020-01-13 03:29:29
问题 The CGWindowLevel.h file defines the constants that are used to set the window level and the largest value that can be used as window level is 20. But, if you retrieve the window list using the call CGWindowListCopyWindowInfo , you can observe that the value of kCGWindowLayer is more than 20 (25, 103 etc). Aren't kCGWindowLayer and window level same? If they are not same, how do I get the window level for the windows that are obtained using CGWindowListCopyWindowInfo ? If they are same, why

iPhone OS 3.2; PDF rendering; User Interaction

南笙酒味 提交于 2020-01-12 05:50:08
问题 I'd need to create a iPad-app which would be rendering multiple PDF-Files (one file contains one page). Each page should be scrollable, zoomable and if the user taps on a part of the PDF a website or photo gallery should popup. Currently i think i could do that either with: A. UIWebView Displays the pdf's nicely, scrolling and zooming works. But it looks like a lot of trouble to realize the clickable parts of the PDF. I don't know if i could use CGPDFContextSetURLForRect Getting the touch