Skip to main content
Participant
September 29, 2017
Question

Manipulating each pixel

  • September 29, 2017
  • 1 reply
  • 567 views

Hi,

completely new to the SDK.

For starters, I want to write a new effect that replaces every nth pixel with a given color.

Next, I want to write a new effect that takes the color of pixel (x, y) and sets the next n pixels to the right of pixel (x, y) to exactly that color. Basically creating a smear effect.

How can I go about that? I haven't seen a way to access pixel (x, y) of a frame.

My best guess is to use

suites.IterateSuite1()->iterate(in_data,

                                   0,                                // progress base

                                   linesL,                            // progress final

                                   &params[SKELETON_INPUT]->u.ld,    // src

                                   NULL,                            // area - null for all pixels

                                   (void*)&data,                    // refcon - your custom data pointer

                                   MyMagicFunction,                // pixel function pointer

                                   output));

But MyMagicFunction will only get the information about the current pixel.

Thanks!

This topic has been closed for replies.

1 reply

Community Expert
September 30, 2017

Hi RoberlWilde.

there are 2 approacehs here:

1. take a look at the "Shifter" sample project. it shows how to access different pixels thorugh the iteration function, other than the current x/y coordinates passed to the iteration function.

2. access a buffer's pixels directly in RAM.

Re: Get Pixel Value from Layer Parameter and Arbitrary XY Coordinates

Re: How to iterate 16bpc and 32bpc pixels directly

both these threads show how to do that.