fix CMP_Feedback_Proc return values. (return false is continue)
This commit is contained in:
parent
2a995a4575
commit
f284934d81
@ -140,7 +140,7 @@ bool ILImage::LoadFile(const OSString &filename)
|
|||||||
if(!ilLoadImage(filename.c_str()))
|
if(!ilLoadImage(filename.c_str()))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
LOG_INFO(OS_TEXT("File: ")+filename);
|
LOG_INFO(OS_TEXT("\nFile: ")+filename);
|
||||||
|
|
||||||
il_width =ilGetInteger(IL_IMAGE_WIDTH);
|
il_width =ilGetInteger(IL_IMAGE_WIDTH);
|
||||||
il_height =ilGetInteger(IL_IMAGE_HEIGHT);
|
il_height =ilGetInteger(IL_IMAGE_HEIGHT);
|
||||||
|
@ -159,20 +159,37 @@ public:
|
|||||||
CMP_FORMAT_BC7, //ColorFormat::BC7
|
CMP_FORMAT_BC7, //ColorFormat::BC7
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr char fmt_name_list[][8]=
|
||||||
|
{
|
||||||
|
"BC1RGB",
|
||||||
|
"BC1RGBA",
|
||||||
|
"BC2",
|
||||||
|
"BC3",
|
||||||
|
"BC4",
|
||||||
|
"BC5",
|
||||||
|
"BC6H",
|
||||||
|
"BC6H_SF",
|
||||||
|
"BC7"
|
||||||
|
};
|
||||||
|
|
||||||
|
const int fmt_index=size_t(fmt->format)-size_t(ColorFormat::BC1RGB);
|
||||||
|
|
||||||
kernel_options.height =image->height();
|
kernel_options.height =image->height();
|
||||||
kernel_options.width =image->width();
|
kernel_options.width =image->width();
|
||||||
kernel_options.fquality =1.0f;
|
kernel_options.fquality =1.0f;
|
||||||
kernel_options.format =fmt_list[size_t(fmt->format)-size_t(ColorFormat::BC1RGB)];
|
kernel_options.format =fmt_list[fmt_index];
|
||||||
kernel_options.encodeWith =CMP_HPC;
|
kernel_options.encodeWith =CMP_HPC;
|
||||||
kernel_options.threads =4;
|
kernel_options.threads =4;
|
||||||
kernel_options.getPerfStats =false;
|
kernel_options.getPerfStats =false;
|
||||||
kernel_options.getDeviceInfo=false;
|
kernel_options.getDeviceInfo=false;
|
||||||
|
|
||||||
|
std::cout<<"CompressFormat: "<<fmt_name_list[fmt_index]<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CMP_API CMP_Feedback_Proc(CMP_FLOAT fProgress, CMP_DWORD_PTR pUser1, CMP_DWORD_PTR pUser2)
|
static bool CMP_API CMP_Feedback_Proc(CMP_FLOAT fProgress, CMP_DWORD_PTR pUser1, CMP_DWORD_PTR pUser2)
|
||||||
{
|
{
|
||||||
std::cout<<"progress: "<<fProgress<<std::endl;
|
putchar('.');
|
||||||
return(true);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Write() override
|
bool Write() override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user