Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    7

    CreateCurvesFilter

    Hey,

    Im interested inusing the CreateCurvesFilter from the SDK however there seems to be no documentation on how to implement it.

    I see that I need to provide 3 lookup tables, which need to be generated with CurveGenerator (which is even more confusing in implementing).

    Does anyone have, or can point me to some example code that utilises these so I can have a play around?

  2. #2
    Regular Contributor
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    481

    Re: CreateCurvesFilter

    Hi.
    To use CreateCurvesFilter, you must generate a LUT of 256 values for each channel.
    What is confuse for you?

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    7

    Re: CreateCurvesFilter

    What you just said. That confuses me :P

    I think the problem with the documentation is that if assumes too much with no pointers to where we can learn more about them. I didn't know what a LUP is; I googled it and now KIND of know what it is but how do I create one?

    The API doc says to use the CurveGenerator function..ok...but how? An example would be nice; this is how people learn.

  4. #4
    Regular Contributor
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    481

    Re: CreateCurvesFilter

    a Lut is simple an array which is used to transform a value to another. For example, to invert pixel, you create a array where
    tab[0] = 255;
    tab[1] =254
    tab[2] = 253
    ...
    tab[254] = 1
    tab[255] = 0


    CurvesFilter use R/G/B value as array id.

    For example to apply gamma :
    Code:
    var curve = new byte[256];
    for (int i = 0; i < 256; ++i)
    {
        curve[i] = (byte)(255 * Math.Pow( i / 255.0, 2);
    }
    session.AddFilter(FilterFactory.CreateCurvesFilter(curve,curve,curve));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×