Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3458152
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:56:52+00:00 2026-05-18T09:56:52+00:00

Basically, what I want to do is understand how to calculate the values along

  • 0

Basically, what I want to do is understand how to calculate the values along a ‘curve’ as represented here in the photoshop curves box:

Photoshop Curves

So, given N points with x between 0 and 1 and y between 0 and 1 – we’ll create a curve that passes through all these points. Given this curve, I’d like to be able to calculate all values of the curve for any given X.

In other words, I’d like to modify values of color just like the curves box does, but programmatically.

I’ve read that these are “catmull-rom splines” — but all I see is a function that relies upon a parametric T — I want to be able to look up for values of x. I’d like to do this in C if possible

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:56:52+00:00Added an answer on May 18, 2026 at 9:56 am

    A Catmull-Rom Spline is used because it’s a kind of spline that represents a curve in which you can add control points and refine the curve itself (that is what you do on Photoshop when you click to add a new point), with the particularity to have the curve pass by every control point you specify.

    In any case you just need a function that taken a value (float in 0..1 or int in 0..255 or whatever color space you have) will produce another one.

    float fun(float x) {
      y = /* something */
      return y;
    }
    

    This can be done with whatever kind of function of course. The most basic one is the default one that is an identity function

    float fun(float x) {
      y = x;
      return y;
    }
    

    Any other function can be calculated with curves and it will be ok but more complex to develop, I’d suggest you to start from simple examples like a Bezier curve. In any case the t parameter is used because these are parametric curves, you need to understand some of the mathematical background of curves before digging into development, take a look here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I basically want to be able to deploy multiple versions of the same EAR
I basically want to make things easier by just looping LinkButtons instead of making
I basically want to open a browser window from Word using VBA that does
I basically want to know what the system's input language is currently on (for
I just basically want to add about 20 and sometimes 80 Proximity Alerts with
What i basically want to do is to get content from a website and
I have a large multidimensional array and I basically want to drop the first
I have an SPListItemCollection. I basically want to get one of the items (randomly)
i'm experimenting with django and the builtin admin interface. I basically want to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.