Инициализация:
Код: Выделить всё
OCIO::ConstConfigRcPtr config = OCIO::Config::CreateFromFile("C:\\...\\AgX-main\\config.ocio");
// The correct arguments for the next line are a mystery to me.
OCIO::ConstProcessorRcPtr processor = config->getProcessor(OCIO::ROLE_RENDERING, OCIO::ROLE_RENDERING);
auto compute = processor->getDefaultCPUProcessor();
Код: Выделить всё
XYZ post_process_pixel(XYZ lums) { //lums is raw light data via RGB
float w_luminance = luminance(lums); //get pixel overall luminence
float log_lum = pow(w_luminance,1.0/2.2); //curb it via gamma 2.2
lums = lums * log_lum / lums; //apply curb to color
float pixel[3] = { lums[0],lums[1],lums[2] };
compute->applyRGB(pixel);
//scale to 24 bit rgb
return XYZ::clamp(XYZ(pixel[0],pixel[1],pixel[2]), 0, 1) * 255;
}
Подробнее здесь: https://stackoverflow.com/questions/782 ... using-ocio
Мобильная версия