BGR转换
This commit is contained in:
parent
b25ae0a7c2
commit
6872b61b53
|
@ -628,8 +628,40 @@ void hg_scanner_200::image_process(std::shared_ptr<std::vector<char>>& buffer)
|
|||
//HG_LOGHG_LOG_LEVEL_DEBUG_INFO,"除色开启\r\n");
|
||||
}
|
||||
/////////////////////////////////////2222222222222222222222222222222222222//////////////////////////////////
|
||||
int tableLength = sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
|
||||
hg_imgproc::customgamma(handle,custom_gamma_,custom_gamma_val_->table,tableLength);
|
||||
int tableLength ;//= sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
|
||||
|
||||
unsigned char buffer1[256 *3];
|
||||
if (img_conf_.pixtype == COLOR_MODE_BLACK_WHITE || img_conf_.pixtype == COLOR_MODE_256_GRAY)
|
||||
tableLength = 256;
|
||||
else
|
||||
{
|
||||
tableLength = 768;
|
||||
int index=0;
|
||||
|
||||
unsigned char buf_01[256];
|
||||
memcpy(buf_01,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
unsigned char buf_02[256];
|
||||
memcpy(buf_02,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
unsigned char buf_03[256];
|
||||
memcpy(buf_03,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
int j =0;
|
||||
for (size_t i = 0; i < 256; i++)
|
||||
{
|
||||
memcpy(buffer1 + j,buf_01 + i,1);
|
||||
memcpy(buffer1 + (++j),buf_02 + i,1);
|
||||
memcpy(buffer1 + (++j),buf_03 + i,1);
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hg_imgproc::customgamma(handle,custom_gamma_,buffer1,tableLength);
|
||||
|
||||
if (img_conf_.pixtype == COLOR_MODE_24_BITS && img_conf_.hsvcorrect)
|
||||
{
|
||||
|
|
|
@ -585,8 +585,40 @@ void hg_scanner_300::image_process(std::shared_ptr<std::vector<char>>& buffer)
|
|||
//HG_LOGHG_LOG_LEVEL_DEBUG_INFO,"除色开启\r\n");
|
||||
}
|
||||
/////////////////////////////////////2222222222222222222222222222222222222//////////////////////////////////
|
||||
int tableLength = sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
|
||||
hg_imgproc::customgamma(handle,custom_gamma_,custom_gamma_val_->table,tableLength);
|
||||
int tableLength ;//= sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
|
||||
|
||||
unsigned char buffer1[256 *3];
|
||||
if (img_conf_.pixtype == COLOR_MODE_BLACK_WHITE || img_conf_.pixtype == COLOR_MODE_256_GRAY)
|
||||
tableLength = 256;
|
||||
else
|
||||
{
|
||||
tableLength = 768;
|
||||
int index=0;
|
||||
|
||||
unsigned char buf_01[256];
|
||||
memcpy(buf_01,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
unsigned char buf_02[256];
|
||||
memcpy(buf_02,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
unsigned char buf_03[256];
|
||||
memcpy(buf_03,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
int j =0;
|
||||
for (size_t i = 0; i < 256; i++)
|
||||
{
|
||||
memcpy(buffer1 + j,buf_01 + i,1);
|
||||
memcpy(buffer1 + (++j),buf_02 + i,1);
|
||||
memcpy(buffer1 + (++j),buf_03 + i,1);
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hg_imgproc::customgamma(handle,custom_gamma_,buffer1,tableLength);
|
||||
|
||||
if (img_conf_.pixtype == COLOR_MODE_24_BITS && img_conf_.hsvcorrect)
|
||||
{
|
||||
|
|
|
@ -588,8 +588,40 @@ void hg_scanner_400::image_process(std::shared_ptr<std::vector<char>>& buffer)
|
|||
//HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO, "除色开启:%s\n",hg_scanner::strerr((hg_err)ret).c_str());
|
||||
}
|
||||
/////////////////////////////////////2222222222222222222222222222222222222//////////////////////////////////
|
||||
int tableLength = sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
|
||||
hg_imgproc::customgamma(handle,custom_gamma_,custom_gamma_val_->table,tableLength);
|
||||
int tableLength ;//= sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
|
||||
|
||||
unsigned char buffer1[256 *3];
|
||||
if (img_conf_.pixtype == COLOR_MODE_BLACK_WHITE || img_conf_.pixtype == COLOR_MODE_256_GRAY)
|
||||
tableLength = 256;
|
||||
else
|
||||
{
|
||||
tableLength = 768;
|
||||
int index=0;
|
||||
|
||||
unsigned char buf_01[256];
|
||||
memcpy(buf_01,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
unsigned char buf_02[256];
|
||||
memcpy(buf_02,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
unsigned char buf_03[256];
|
||||
memcpy(buf_03,custom_gamma_val_->table + index,256);
|
||||
index += 256;
|
||||
|
||||
int j =0;
|
||||
for (size_t i = 0; i < 256; i++)
|
||||
{
|
||||
memcpy(buffer1 + j,buf_01 + i,1);
|
||||
memcpy(buffer1 + (++j),buf_02 + i,1);
|
||||
memcpy(buffer1 + (++j),buf_03 + i,1);
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hg_imgproc::customgamma(handle,custom_gamma_,buffer1,tableLength);
|
||||
|
||||
if (img_conf_.pixtype == COLOR_MODE_24_BITS && img_conf_.hsvcorrect)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue