Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

C++ Gamma

C++ Gamma

kotorotomoto
Participant Participant
160 Views
10 Replies
Message 1 of 11

C++ Gamma

kotorotomoto
Participant
Participant

Hi everyone.
Does anyone know how to enable Override Gamma and set the value? I spent a lot of time trying to get to it through IParamBlock2, but to no avail.
Or similarly with maxscript (openBitmap @"d:\text.png" gamma:1.0)
Any ideas?

0 Likes
161 Views
10 Replies
Replies (10)
Message 2 of 11

denisT.MaxDoctor
Advisor
Advisor

What does IPramBlock2 have to do with the Bitmap gamma?

0 Likes
Message 3 of 11

kotorotomoto
Participant
Participant

I tried using BitmapInfo

BitmapInfo biLoad(finalFn);
biLoad.SetCustomGamma(TRUE);
biLoad.SetGamma(overrideGamma);

but to no avail.
The AI ​​insisted on messing with IPramBlock2.

0 Likes
Message 4 of 11

denisT.MaxDoctor
Advisor
Advisor

Screw AI 😁 ... there's no param block in Bitmap. 

Now, what do you really want to do? Do you want to change the gamma for some Bitmap? Or do you want to create a Bitmap with a specified gamma?
 

0 Likes
Message 5 of 11

kotorotomoto
Participant
Participant

Both. I want to change the incorrect ones and set the gamma when creating a Bitmap.

0 Likes
Message 6 of 11

denisT.MaxDoctor
Advisor
Advisor

Why do you think that simply changing the gamma can change the Bitmap?

 

 

If you know how to do this via MXS, just call MXS from the C++ SDK.

0 Likes
Message 7 of 11

kotorotomoto
Participant
Participant

It will work, but it's a kludge. I'd like to figure it out.

 

0 Likes
Message 8 of 11

denisT.MaxDoctor
Advisor
Advisor

If you want to figure out how it all works yourself, just do it. It's not entirely clear, but everything is explained in bitmap.h.


0 Likes
Message 9 of 11

kotorotomoto
Participant
Participant

Thanks for pointing me in the right direction.
It worked!

0 Likes
Message 10 of 11

denisT.MaxDoctor
Advisor
Advisor

If you ask others for help in finding a solution, it is considered good practice on professional forums that even if you found it yourself, you should publish it so that others can use it.

0 Likes
Message 11 of 11

kotorotomoto
Participant
Participant

Almost the same as I tried initially:
BitmapInfo biLoad(finalFn);
biLoad.SetCustomFlag(BMM_CUSTOM_GAMMA);
biLoad.SetCustomGamma(overrideGamma);

0 Likes