Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    H2 get 32 bit color values

    SDK Help
    0
    4
    357
    Loading More Posts
    • 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.
    • H
      Helper
      last edited by

      On 08/12/2013 at 23:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R15 
      Platform:   Windows  ;   
      Language(s) :

      ---------
      I have a HDR 32 bit texture layer and now I want to read the color values.
      For normal 8 bit textures this is not a problem, but how to get the 32 bit color values.
      Here is my attempt:

      	Float buffer[3];		//one pixel is 1 float (4 bytes) * 3 (RGB) = 3 floats
        
        
      	//get one pixel to test
      	pLayerBmp->GetPixelCnt(0,0,1,(UChar* )buffer,COLORMODE_RGBf, PIXELCNT_0);
        
      	GePrint("Before pixel 0,0: " + String::FloatToString(buffer[0])  \+ " - " +
      				String::FloatToString(buffer[1]) + " - " + 
      				String::FloatToString(buffer[2]));
        
      
      
      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 09/12/2013 at 02:49, xxxxxxxx wrote:

        Solved.
        Float buffer[3]; should be Float32 buffer[3];

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 09/12/2013 at 03:16, xxxxxxxx wrote:

          In the C4D C++ SDK, defined 'generic' types usually default to the 64-bit version (Float = Float64, Vector = LVector, etc.).

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 12/12/2013 at 08:28, xxxxxxxx wrote:

            Ok, good to know.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post