• 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: 2D grayscale image from an array of floats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2D grayscale image from an array of floats


  • Subject: Re: 2D grayscale image from an array of floats
  • From: Martin Beroiz <email@hidden>
  • Date: Sat, 19 Dec 2009 15:28:03 -0600

Thanks for the reply, I'm a newbie and I'm still trying to figure out how are things done in Cocoa.

I have another related question I'd like to ask you guys, cause I've searched through documentation and tutorials but I cannot find the exact answer.

I'm trying to implement Model-Controller-View in my code. So, so far I created a class called FilterBank with all the data to be plotted plus a method to init from a file. Then I included one instance of the class FilterBank in the myDocument class. When I open a file, myDocument will read and load all the data to the class calling the initFromFile: method of FilterBank, that works ok.

Then I can subclass NSView to hold and plot the image using NSImageRep, etc.

My problem is with the controller. I subclassed NSViewController (FilterBankViewController) and tried to bind the class with the owner of the file. But I noticed that in IB I cannot do that, actually the bind tab says it's "Not Applicable".

I don't understand why though, b/c I learned in a tutorial that loads data from a file and puts that into a table, that you need an NSArrayController to mediate between the table and the file owner.  What kind of controller should I use here?

Thanks.

On Dec 18, 2009, at 7:04 PM, Scott Ribe wrote:

> A couple more things I've thought of:
>
> - There is such a thing as a grayscale image that uses floats instead of
> bytes for values. You may not even need to do a conversion.
>
> - You may even be able to wrap your buffer up in an image rep without
> copying it.


Thanks for the info, this is so very interesting for me, but as you said I'm still trying to accomplish much more basic stuff here.

>
> I don't use NSImage; my custom image views do some drawing at lower levels;
> so I don't know for sure what all formats are supported. You'd have to study
> the docs more. As a newbie, the first thing you should probably do is take
> the shortest path to getting something on the screen, in other words finish
> what you were already doing--then experiment with ways to avoid conversion
> and/or copying.
>
> --
> Scott Ribe
> email@hidden
> http://www.killerbytes.com/
> (303) 722-0567 voice
>
>

_______________________________________________

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: 
 >Re: 2D grayscale image from an array of floats (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: iPhone Simulator auto-rotation touches detection bug?
  • Next by Date: NSOutlineView Bad Scrolling Behavior
  • Previous by thread: Re: 2D grayscale image from an array of floats
  • Next by thread: ImageAndTextCell still the way to go for icons in outline views?
  • Index(es):
    • Date
    • Thread