Simple c++ to pure conversion? openlibrary..

Just starting out? Need help? Post your questions and find answers here.
zued
User
User
Posts: 27
Joined: Wed Dec 17, 2003 11:20 pm

Simple c++ to pure conversion? openlibrary..

Post by zued »

Hi again..

Have this .dll called "Little cms engine" but all examples are in c++
("Little cmc enging" does image color correction based on different profiles,, like for monitors,printers or scanners etc).

heres the c-code/

Code: Select all


#include "lcms.h"


int main(void)
{

     cmsHPROFILE hInProfile, hOutProfile;
     cmsHTRANSFORM hTransform;
     int i;


     hInProfile  = cmsOpenProfileFromFile("HPSJTW.ICM", "r");
     hOutProfile = cmsOpenProfileFromFile("sRGBColorSpace.ICM", "r");



     hTransform = cmsCreateTransform(hInProfile,
                                           TYPE_BGR_8,
                                           hOutProfile,
                                           TYPE_BGR_8,
                                           INTENT_PERCEPTUAL, 0);


     /*
        here a loop for translating your image.
     */

     /*
     for (i=0; i < AllScanlinesTilesOrWatseverBlocksYouUse; i++)
     {
           cmsDoTransform(hTransform, YourInputBuffer,
                                      YourOutputBuffer,
                                      YourBuffersSizeInPixels);
     }
     */


     cmsDeleteTransform(hTransform);
     cmsCloseProfile(hInProfile);
     cmsCloseProfile(hOutProfile);

     return 0;
}

For example "AllScanlinesTilesOrWatseverBlocksYouUse" means that i have to read every line of the image (or every pixel) to apply the effect.
/read from one image then copy to a new?

Then I wonder about this:
hInProfile = cmsOpenProfileFromFile("HPSJTW.ICM", "r");
cmsopenprofilefromfile is a function in the dll but how come that the function is called 'within' the next function: cmsDoTransform(hTransform,...?
I thought you only could call one function at a time..

Well well.. sorry for my stupidity... /

/ZuedTheSwede