Skip to main content
Participant
October 6, 2016
Question

RGB to HLS Conversion within Iterator

  • October 6, 2016
  • 1 reply
  • 298 views

Hey all,

Having trouble finding the most efficient way to use the PF_ColorCallbacksSuite within my iterator so I can do some math in HLS, then transform back to RGB to send to the out pixel.

The best way I can think of is to make all 3 versions of the ColorCallbackSuite (8,16, and 32 bit) a part of my refcon struct and then set the appropriate one up in smart render, but the AEFX suite scoper does not seem happy about doing that.

I would then also have to put the PF_ProgPtr that's required for the callbacks into my *refcon but that also seems like a bit of a hack. Is there any better way of transforming from RGB to HLS and back within an iterator function besides just plugging in my own math to do so? I have a function to do just that waiting on deck, I just figured using the built in versions would play nicer with the rest of AE. Thanks so much, the vast amount of info on this forum has been invaluable to me getting even this far in my project.

Robert

This topic has been closed for replies.

1 reply

Inspiring
October 6, 2016

I work entirely in 32-bit as you only need one render function. When it comes to copying your internal 32-bit world back to the output, you'll need three iterator functions to do that but these are very simple pixel conversion functions. It means, of course that you need to have to define an offscreen 32-bit world in SmartRender but that's not really a problem these days.

If you used this method you could just use the 32-bit ColorCallbackSuite during SmartRender - simple!

BTW, some people will say not to use the pixel iterators, instead preferring IterateGeneric and looping over a chunk. I've just implemented this approach in my latest plugin but have yet to see any major performance increase.