The antialias of rotated CGImage/CGlayer seems jaggy, UIImageView’s is not

Nibbie
Posts: 4
Joined: 2009.12
Post: #1
I need to mask a "texture" image with a rotated greyscale image.

I found out, that I have to do it with CGImages or CGlayers (if there is a simplier way using UIImageViews only, please let me know about it).

My problem is simple:

The antialias of any rotation-transformed CG stuff is quiet jaggy...

... but the antialias of a rotation-transformed UIImageView is kinda perfect. How can I produce that beautiful antialiased rotations?

I've uploaded a "proof" involving actual iPhone Simulator screenshots, to see what am I talkin' about:

[Image: Proof.png]

I've tried to use CGImages, CGLayers, UIImageViews "captured" with renderInContext, I've tried to CGContextSetInterpolationQuality to high, and also tried to set CGContextSetAllowsAntialiasing - CGContextSetShouldAntialias, but every case returned the same jaggy result.

I'm planning to learn using OpenGL next year, but this development should released using CoreGraphics only. Please let me know how to get a perfectly rendered rotated image, I just can't accept it's impossible.
Quote this message in a reply
⌘-R in Chief
Posts: 1,261
Joined: 2002.05
Post: #2
If you could post some code for your 3 different versions that would go a long way.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2009.12
Post: #3
Ok, I will.
First I write a "skeleton" code which is short enough, an still creates the "bug".
After work.. Sad
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #4
I don't know about iPhone, but in general, CG and Cocoa let you select the "quality" of image processing. It may be the case that the quality settings are differing.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2009.12
Post: #5
Sounds promising.
Can you tell me something about how to set the "quality" you've mentioned?
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #6
For NSImage, you can use: http://developer.apple.com/mac/library/d...erpolation

For CG, see: http://developer.apple.com/mac/library/d...g-BJEBGEGB

Now, I'm just assuming that what you're seeing here is different quality settings.

EDIT: I'm loving Apple's new online documentation.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2009.12
Post: #7
I've tried these setting already without any useful result.
Quote this message in a reply
Post Reply