Future of scripting - RealWorld forums

Log-in or register.

Future of scripting

what to expect in future versions, suggestions are welcome
on November 8th 2013


The RasterImage interface is quite old and it is starting to show. Perhaps an alternative interface that would offer a different approach to raster images should be added. The current RasterImage functionality will be kept unchanged for compatibility reasons, the new interface will have a different name (I am open to suggestions).

Here are some goals for the new interface:

  • Removal of the Z and W coordinates.
  • Be ready for HDR colors.
  • As fast as possible per-pixel operations.
  • Simplicity.

Initial proposal:

RasterImageEx methods and properties

  • PixelIterator GetIterator(int posX, int posY)
  • uint sizeX (get) - width of the image.
  • uint sizeY (get) - height of the image.
  • void Resize ?
  • PixelIterator Sample(float posX, float posY)

PixelIterator methods and properties

  • float r (get/set)
  • float g (get/set)
  • float b (get/set)
  • float a (get/set)
  • uint rgba (get/set)
  • PixelIterator val (set)
  • bool offX(int offset) - changes current X coordinate; returns true if the new coordinate is valid.
  • bool offY(int offset) - the same for Y.
  • bool next() - increase X coordinate; if the result is invalid, reset X coordinate and increase Y.
on November 8th 2013

Ooooh, like a shader language for RW, cool!
Now if we could mod an image using OpenGL shaders that would be something.....and SERIOUSLY fast!

on November 8th 2013

I wouldn't go as far :-). But it is a good idea for a separate plug-in.

on November 8th 2013

hehe, thats alright I never could get my head around that stuff.
But then Ive only tried to learn WebGl shaders and finding good docs on it sux! They all expect you to know normal gl shaders and theres a bunch of differences that just made it hell for me.....the curse of being the perpetual noob...give it another go one day

on November 8th 2013

Awesome Sample accepts floats, but could it have one more parameter, clamp type?
You know, for when the x/y is over width/height, under 0.
The usual 3 would be great, clamp, mirror and wrap.
That would save me a bit of effort.

on November 8th 2013

That should be possible.

Currently, the editor internally supports out-of-canvas content and a background color, which is close to the clamp mode. Basically, it is possible to request pixel at arbitrary coordinates. The future scripting should reflect this.

on November 10th 2013

Sounds pretty cool! But just wondering, would it be possible to add settings to it so one would have the option to work with CMYK color codes instead? (Well, one should add the alpha channel. CYMaK color?) And maybe HSL color (HaLS?)

And may I suggest naming the new interface Painted Reality Interface? (PRI for short? Or the PRInterface? LOL)

on November 27th 2013

There are some ways to work with other color spaces - the Blender object and its MapChannels mode may be of help.

Also, 2 other things were recently discussed, so I am adding them here, so that they are not forgotten:

  • gradient control as an input field in Configuration object
  • seedable random number generator
Page views: 3001       Posts: 8      
I wish there were...
Select background
Vista & Win 7 icons