• 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: NSImage -> 1-bit NSBitmapImageRep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage -> 1-bit NSBitmapImageRep


  • Subject: Re: NSImage -> 1-bit NSBitmapImageRep
  • From: Sanford Selznick <email@hidden>
  • Date: Fri, 11 Feb 2005 09:58:28 -0700

Now I know why NSReadPixel is so slow... it has to handle all planer/resolution/alpha combinations.

I just looked into supporting alpha/planar images, and between that and all the different resolutions, it seems like quite a Herculean task.

Unless there's other way?

-Sanford

At 7:52 AM -0600 2/9/05, Ricky Sharp wrote:
See the MonochromeImage sample code at Apple's site. It shows you how to work with an original NSImage and use its data to construct a monochrome image rep.

Note that you'll need to modify the parameters to initWithBitmapDataPlanes:pixelsWide... in order to specify 1 bpp.

Things to consider:

* The sample uses NSReadPixel which is very slow. What I've been doing is using "direct pixel access". i.e. I get a pointer into the source and destination data streams by using [someImageRep bitmapData].

* The original source rep may have alpha (hasAlpha returns YES) and may be planar (isPlanar returns YES). Your code should be modified to work with such data.
_______________________________________________
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: 
 >NSImage -> 1-bit NSBitmapImageRep (From: Sanford Selznick <email@hidden>)
 >Re: NSImage -> 1-bit NSBitmapImageRep (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Philosophy of FSRef - way
  • Next by Date: Small control size inside NSMatrix
  • Previous by thread: Re: NSImage -> 1-bit NSBitmapImageRep
  • Next by thread: Export data to excel
  • Index(es):
    • Date
    • Thread