本文整理汇总了C++中Voxel::convertLinear方法的典型用法代码示例。如果您正苦于以下问题:C++ Voxel::convertLinear方法的具体用法?C++ Voxel::convertLinear怎么用?C++ Voxel::convertLinear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Voxel
的用法示例。
在下文中一共展示了Voxel::convertLinear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char **argv){
int nfile = 1;
char inputfile[CHARMAX];
char outputfile[CHARMAX];
char outputfile2[CHARMAX];
char colormap_file[CHARMAX];
fprintf(stderr,"Usage: %s inputfile outputfile color_map_file \n", argv[0]);
if(argc != 4 )
{
exit(0);
}
sprintf(inputfile,"%s", argv[1]);
sprintf(outputfile,"%s", argv[2]);
sprintf(colormap_file,"%s", argv[3]);
cerr << "Processing: " << inputfile << std::endl;
int csize = 256;
int cmap_size = csize * csize * 3;
unsigned char *colormap_array = new unsigned char[cmap_size];
int cwidth, cheight;
readBmp( colormap_file, colormap_array, cwidth, cheight);
assert( cwidth == csize);
assert( cheight == csize);
//Create top view
{
Voxel *voxel = new Voxel( nfile, inputfile, 0 );
voxel->convertLinear( 0, 60000.0);
voxel->convertLinear2( 0, 3000.0);
voxel->convertLog( 0, 0);
voxel->convertLinear( 0, 255.0);
voxel->convertLinear2( 0, 255.0);
Display *display = new Display( voxel);
sprintf(outputfile2, "%s-top.bmp", outputfile);
display->oImageBmp( outputfile2, colormap_array, csize);
delete display;
delete voxel;
}
//Create front view
{
Voxel *voxel = new Voxel( nfile, inputfile, 2 );
voxel->convertLinear( 0, 60000.0);
voxel->convertLinear2( 0, 3000.0);
voxel->convertLog( 0, 0);
voxel->convertLinear( 0, 255.0);
voxel->convertLinear2( 0, 255.0);
Display *display = new Display( voxel);
sprintf(outputfile2, "%s-front.bmp", outputfile);
display->oImageBmp( outputfile2, colormap_array, csize);
delete display;
delete voxel;
}
}