• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: affine transformation of bitmap images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: affine transformation of bitmap images


  • Subject: Re: affine transformation of bitmap images
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 24 Feb 2005 15:50:16 -0500
  • Organization: Rogue Research

On 2005-02-16 15:28, Ricky Sharp said:

>> I have a bitmap image (a jpeg) and need to translate, rotate, and scale
>> it.  I'm not so much interested in displaying the result onscreen
>> (except
>> for debugging).  I've read up on NSImage and NSAffineTransform and it
>> seems to me that they are geared for display onscreen.  What I'd really
>> like is to provide an NSBitmapImageRep and a transform matrix and get
>> back a new NSBitmapImageRep.  Will I need to draw into some kind of
>> offscreen graphics context to do this? or use vImage?
>
>Just create an NSImage, lock focus on it, and draw.  The transforms
>will be applied to the current context which will be the NSImage.  At
>the end, unlock focus and then extract its representation.

I am just revisiting this issue.  It seems that your suggestion does not
quite work. :(  I create an NSImage, lock focus on it, concat the
transform matrix, and draw.  The result is 'good' in the sense that I get
the image I want, and it displays correctly onscreen, but 'bad' because I
am unable to get the pixels themselves.

The problem is that after drawing into the new image, I call [newImg
representations] and there is only 1 representation and it's an
NSCachedImageRep, which does not respond to -bitmapData.

Any other ideas?

Again, I have an NSBitmapImageRep and an NSAffineTransform, and I want an
NSBitmapImageRep of the post-transformed image.

Thanks!

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: affine transformation of bitmap images
      • From: Frank Midgley <email@hidden>
References: 
 >Re: affine transformation of bitmap images (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: What part of DO don't I understand?
  • Next by Date: Controlling startup / shutdown of a program.
  • Previous by thread: Re: affine transformation of bitmap images
  • Next by thread: Re: affine transformation of bitmap images
  • Index(es):
    • Date
    • Thread