Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Urgent Help ~!! Convert Lab to RGB

Urgent Help ~!! Convert Lab to RGB

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    azusakt
    wrote on last edited by
    #1

    Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..

    R CPalliniC M 3 Replies Last reply
    0
    • A azusakt

      Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      azusakt wrote:

      I have no much idea on the calculations or algorithms.

      You don't have much idea or you have absolutely no idea? Tell us what you've tried.

      Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

      A 1 Reply Last reply
      0
      • A azusakt

        Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        azusakt wrote:

        I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms.

        But documentation exists http://en.wikipedia.org/wiki/Lab_color_space#Advantages_of_Lab[^]. There is also the very nice Guillaume Leparmentier's article [^] here at CP. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        [my articles]

        1 Reply Last reply
        0
        • A azusakt

          Hi all, I have to make a library to convert the Color from Lab value to RGB value. However, I have no much idea on the calculations or algorithms. Suppose I will receive a data (Char pointer) then convert to RGB. Can some of you give me some hints or examples? Please Please... I believed that this should be easy for some experts. Thanks for your help..

          M Offline
          M Offline
          Mr Surprise
          wrote on last edited by
          #4

          I guess, by using an array structure you can do this. For Example: static COLORREF arColors[] = { RGB(0,255,0), RGB(0,255,255) }; char* arNames[] = { "green", "cyan" }; for(int i=0; i<2; i++) { arColors[i] = i; // you can try "atof" arNames[i] = atof(i); }

          modified on Wednesday, January 30, 2008 4:09:09 AM

          A 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            azusakt wrote:

            I have no much idea on the calculations or algorithms.

            You don't have much idea or you have absolutely no idea? Tell us what you've tried.

            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

            A Offline
            A Offline
            azusakt
            wrote on last edited by
            #5

            Actually, I'm a beginner in writting Graphic related program. especially in C++. I have no idea on the calculation for processing & converting the LAB to RGB. So I hope to find some examples with codings that I can easily to learn and understand . Could you provide me some program examples if you have this experience. Thanks a lot.

            modified on Tuesday, January 29, 2008 10:04:23 PM

            1 Reply Last reply
            0
            • M Mr Surprise

              I guess, by using an array structure you can do this. For Example: static COLORREF arColors[] = { RGB(0,255,0), RGB(0,255,255) }; char* arNames[] = { "green", "cyan" }; for(int i=0; i<2; i++) { arColors[i] = i; // you can try "atof" arNames[i] = atof(i); }

              modified on Wednesday, January 30, 2008 4:09:09 AM

              A Offline
              A Offline
              azusakt
              wrote on last edited by
              #6

              Thanks for you reply. Can you provide me a sample code for converting Lab value to RGB value? I've read some documents, they said the step should 1. convert Lab -> XYZ 2. convert XYZ -> RGB I don't know how to write such calculations.

              M 1 Reply Last reply
              0
              • A azusakt

                Thanks for you reply. Can you provide me a sample code for converting Lab value to RGB value? I've read some documents, they said the step should 1. convert Lab -> XYZ 2. convert XYZ -> RGB I don't know how to write such calculations.

                M Offline
                M Offline
                Mr Surprise
                wrote on last edited by
                #7

                This is a constant RGB macros of the COLORREF structure. Anyway, from 0 to 255 numeric values are equivalence a 24-Bit COLORREF's scope. If you want to chance only RGB macros, you can use the typedef struct tagCOLORREF structure. Forexample: #define XYZ(int i1, int i2, int i3) 0 int* pNewInt = new int[255]; pNewInt = NULL; #ifdef COLORREF for(int i=0; i<255; i++) { // I'm not sure just as already it will be defined a XYZ macro. RGB(pNewInt[i],pNewInt[i],pNewInt[i]) = XYZ(pNewInt[i],pNewInt[i],pNewInt[i]); } delete []pNewInt; #endif That is must be a defined tagpoint struct what own yourself.

                modified on Thursday, January 31, 2008 6:05:14 AM

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups