• 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: convert NSBitmapImageRep to black/white depending on pixel hsb
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: convert NSBitmapImageRep to black/white depending on pixel hsb


  • Subject: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • From: Raul Fiedler <email@hidden>
  • Date: Sat, 11 Aug 2007 15:05:05 +0200

here is my code that takes for ever to run

+ (NSBitmapImageRep *) getBlackWhiteImage:(NSBitmapImageRep *)image brigthness:(float)brigthness bellow:(NSColor *)bellow above:(NSColor *)above {
NSBitmapImageRep* newImage = [image copy];
for (int x = 0; x < [image pixelsWide]; x++) {
for (int y = 0; y < [image pixelsHigh]; y++) {
NSColor *color = [image colorAtX:x y:y];
if ([color brightnessComponent] > brigthness) {
[newImage setColor:above atX:x y:y];
} else {
[newImage setColor:bellow atX:x y:y];
}
}
}
return newImage;
}


this is my first project with Cocoa and core image I havn't even touched yet.
If you happen to know example code that is similar to my function, I would appreciated it very much.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >convert NSBitmapImageRep to black/white depending on pixel hsb (From: email@hidden)
 >Re: convert NSBitmapImageRep to black/white depending on pixel hsb (From: "Shawn Erickson" <email@hidden>)
 >Re: convert NSBitmapImageRep to black/white depending on pixel hsb (From: Michael Watson <email@hidden>)
 >Re: convert NSBitmapImageRep to black/white depending on pixel hsb (From: Uli Kusterer <email@hidden>)

  • Prev by Date: NSArrayControllers and lazyloading referencing through an NSObjectController alias
  • Next by Date: Re: User Shutdown or Logout
  • Previous by thread: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • Next by thread: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • Index(es):
    • Date
    • Thread