• 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
Rendering a raw image buffer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rendering a raw image buffer


  • Subject: Rendering a raw image buffer
  • From: Graham Cox <email@hidden>
  • Date: Fri, 22 Feb 2013 12:15:48 +1100

Hi all,

I have a simple requirement: take a buffer I malloc myself and get that rendered as an image using CGImage.

I'm creating a data provider using CGDataProviderCreateWithData(), then using that to create a CGImage of the desired dimensions and format. This is later drawn using CGContextDrawImage().

The original buffer is updated directly by writing pixel values into the buffer, then the appropriate part of the view is invalidated which causes the image to redraw. All I get is a black image - the data I write to the buffer appears not to affect anything.

Is this the right way to handle this? I understand that the whole system with data providers and so on is intended for efficient image rendering and decoding, but in this case I want to get back to almost the most basic situation possible. So maybe CGImage is caching the content of my buffer once and not re-reading from it each time, which would explain my results? How can I set up an image that just blits my buffer and doesn't try anything clever like caching?

--Graham



_______________________________________________

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

  • Follow-Ups:
    • Re: Rendering a raw image buffer
      • From: Ken Thomases <email@hidden>
    • Re: Rendering a raw image buffer
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: NSSplitView not Resizing Subviews if Delegate is used
  • Next by Date: A plugin for a sandboxed app - where to can I successfully store a temp file?
  • Previous by thread: Re: NSTask arguments
  • Next by thread: Re: Rendering a raw image buffer
  • Index(es):
    • Date
    • Thread