Question asked by springtimes on Jun 24, 2018
Latest reply on Jun 27, 2018 by springtimes

default value:int gs[16] = {0,2,4,8,16,32,64,96,128,160,192,224,255,255,255,255};

cal :for (i=8 ; i<16 ; i++)
{

gs[i] = gs[i] /v;

}

v value range =0.5,1.0,1.5,2.0,2.5...,5.0;

/*change into data for reg*/

for(int i=0; i<16; i++)
{
if(0==i) {
gx[i] = gs[i];
gy[i] = 16*(gs[i+1]-gs[i]);
}
if((i>=1)&&(i<=4)) {
gx[i] = 2*gs[i]-gs[i+1];
gy[i] = (2<<(4-i))*(gs[i+1]-gs[i]);
}
if((i>=5)&&(i<=14)) {
gx[i] = gs[i];
gy[i] = gs[i+1]-gs[i];
}
if(15==i) {
gx[i] = gs[i];
gy[i] = 255-gs[i];
}
}

struct mxcfb_gamma gamma_s = {
1 ,
{gx[0],gx[1],gx[2],gx[3],gx[4],gx[5],gx[6],gx[7],gx[8],gx[9],gx[10],gx[11],gx[12],gx[13],gx[14],gx[15]} ,
{gy[0],gy[1],gy[2],gy[3],gy[4],gy[5],gy[6],gy[7],gy[8],gy[9],gy[10],gy[11],gy[12],gy[13],gy[14],gy[15]}
};

ioctl cmd:ioctl(fd, MXCFB_SET_GAMMA, &gamma_s)

My question:How to become smooth when change v value?

I have try to change “gs[i] = gs[i] /v;” to “gs[i] -= 30×v； or gs[i] -= 20×v；or gs[i] -= 15×v；"and so on. The effect is not obvious.

Pls help me,thanks!