• 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: How invert a PICT
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How invert a PICT


  • Subject: RE: How invert a PICT
  • From: "Christopher Hickman" <email@hidden>
  • Date: Wed, 12 Oct 2005 16:37:56 -0400

This Core Image code will take the image at path and invert it, putting the
resulting image in result.

//--- Begin Code Snippet ---//
NSURL *url;
CIImage *source;
CIImage *result;
CIFilter *colorInvert;

url = [NSURL fileURLWithPath:path];
source = [CIImage imageWithContentsOfURL:url];

colorInvert = [CIFilter filterWithName:@"CIColorInvert"];
[colorInvert setValue:source forKey:@"inputImage"];

result = [colorInvert valueForKey:@"outputImage"];
//---- End Code Snippet ----//

You'll want to take a look at
<http://developer.apple.com/macosx/coreimage.html> this page, and check the
links to further docs at the bottom of the page.

Topher

-----Original Message-----
From: cocoa-dev-bounces+tophu=email@hidden
[mailto:cocoa-dev-bounces+tophu=email@hidden] On Behalf Of JuanC
Sent: Wednesday, October 05, 2005 1:22 AM
To: email@hidden
Subject: How invert a PICT

Hi to everybody!!!
I'm JuanC a at home developer here in Spain (Europe). From many year
I have been programming the QuickDraw and now I wish port my programs
on Cocoa.
Well, the troube: I have a window with 6 images, in PFS format and
wish when the user clicks on it the image change to video inverso
(invert de image). With QuickDraw the procedure is using -CopyBits_,
like this:

LockPixels( pixMapSrc );
                 CopyBits((BitMap*) *pixMapSrc,(BitMap*) *pixMapDes,
                     &(*pixMapSrc)->bounds,&(*pixMapDes)-
 >bounds,notSrcCopy,nil);
UnlockPixels( pixMapSrc);

How can do it using Cocoa image classes?
Thank you very much in advance.
Best regards from Spain.
Un cordial saludo desde EspaƱa.
JuanC++ _______________________________________________
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


 _______________________________________________
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

References: 
 >How invert a PICT (From: JuanC <email@hidden>)

  • Prev by Date: Anyone willing to port Moire to OS X 10.4?
  • Next by Date: Re: Spotlight view
  • Previous by thread: How invert a PICT
  • Next by thread: Live resizing strategies for custom views
  • Index(es):
    • Date
    • Thread