58 double view_n[3], nview_n;
60 double point_s[3], point_o[3], ray_direction[3];
62 double range[6], xd, yd;
63 double coff_matrix[3][3], n_vertex[3 * 8], inv_matrix[3][3];
64 double mincolor, maxcolor, view_point[3], scr_area[4], x, y, nn;
65 double tmincolor, tmaxcolor, trange[6], svertex[3 * 8], sn_vertex[3 * 8],
69 double grad_minmax[2], dis_minmax[2], feap_minmax[2], feai_minmax[2];
70 double tfeap_minmax[2];
76 double center[3], dis_c_v, *ndis_c_v, tmpd;
77 int *pe_id, tmpi, pix_num, pix0_num, pixn;
78 double *n_subimage, *n_subopa, *subimage, *subopa;
79 double *subimage1, *subopa1;
82 int starti, startj, endi, endj;
84 double minx, miny, minz, maxx, maxy, maxz, tminx, tminy, tminz, tmaxx, tmaxy,
86 double av_length, tav_length;
88 int num_img, ii, base_x, base_y;
89 double o_v_point[3], m_scr[4];
93 unsigned char r, g, b;
96 int scale, scale_type;
98 char timestep_str[128], rotate_str[128];
110 int x_specified_l, y_specified_l, z_specified_l;
112 int nx, ny, nz, *empty_flag;
113 double *var, *grad_var;
115 double r_dxyz[3], dxyz[3], orig_xyz[3];
116 double org_mincolor, org_maxcolor;
154 if ((*init_flag == 1) || (num_of_pvr > 1)) {
164 for (j = 0; j < pesize; j++) {
172 if (stat_para[22] == 1) {
186 if (*init_flag == 1) {
194 for (i = 0; i < n_voxel; i++)
195 fprintf(stderr,
"voxel %d level: %d %d %d \n", i,
level[i * 3],
199 for (i = 0; i < n_voxel; i++)
level[i * 3] = x_specified_l;
201 for (i = 0; i < n_voxel; i++) {
207 for (i = 0; i < n_voxel; i++)
level[i * 3 + 1] = y_specified_l;
209 for (i = 0; i < n_voxel; i++) {
215 for (i = 0; i < n_voxel; i++)
level[i * 3 + 2] = z_specified_l;
217 for (i = 0; i < n_voxel; i++) {
227 for (i = 0; i < n_node; i++) {
244 fprintf(stderr,
"Start parallel volume rendering module\n");
248 if (mynode == 0) fprintf(stderr,
"calc_gradient\n");
250 calc_gradient(n_node, n_internal, n_elem, node, elem, node1, n_neighbor_pe,
251 neighbor_pe, import_index, import_node, export_index,
252 export_node, phi_x, phi_y, phi_z, mynode, VIS_COMM);
256 "The time for computing gradient is %lf the total time up to now "
262 fprintf(stderr,
"refinement\n");
264 nx =
level[mynode * 3];
265 ny =
level[mynode * 3 + 1];
266 nz =
level[mynode * 3 + 2];
267 empty_flag = (
int *)
HECMW_calloc((nx + 1) * (ny + 1) * (nz + 1),
sizeof(int));
268 var = (
double *)
HECMW_calloc((nx + 1) * (ny + 1) * (nz + 1),
sizeof(double));
270 grad_var = (
double *)
HECMW_calloc((nx + 1) * (ny + 1) * (nz + 1) * 3,
272 if ((grad_var ==
NULL) || (var ==
NULL) || (empty_flag ==
NULL)) {
273 fprintf(stderr,
"There is no enough memory: empty_flag, var, gradient\n");
290 fprintf(stderr,
" Finish refinement now, refinement level: \n");
292 " The time for refinement is %lf the total time up to now is %lf\n",
297 mincolor = tmincolor = 1.0E17;
298 maxcolor = tmaxcolor = -1.0E17;
307 tmincolor = mincolor;
308 tmaxcolor = maxcolor;
310 org_mincolor = tmincolor;
311 org_maxcolor = tmaxcolor;
321 mynode, pesize, VIS_COMM);
324 nz, mynode, pesize, VIS_COMM,
328 nz, mynode, pesize, VIS_COMM,
332 for (i = 0; i < 6; i++) trange[i] = 0.0;
357 fprintf(stderr,
"the range of the field is %lf %lf %lf %lf %lf %lf\n",
358 tminx, tmaxx, tminy, tmaxy, tminz, tmaxz);
365 if ((*init_flag == 1) || (num_of_pvr > 1)) {
366 if (stat_para[4] == 0) {
371 vr->
light_point[1] = tmaxy + 0.1 * (tmaxy - tminy);
372 vr->
light_point[2] = tmaxz + (tmaxz - tminz) * 2.0;
374 if (stat_para[5] == 0) {
379 if (stat_para[6] == 0) {
395 for (i = 0; i < 3; i++)
396 vr->
screen_point[i] = (trange[i * 2] + trange[i * 2 + 1]) / 2.0;
398 for (i = 0; i < 3; i++) o_v_point[i] = vr->
view_point_d[i];
399 m_scr[0] = m_scr[2] = 1.0E+17;
400 m_scr[1] = m_scr[3] = -1.0E+17;
402 for (ii = 0; ii < num_img; ii++) {
408 for (i = 0; i < 3; i++)
410 nview_n = sqrt(
SQR(view_n[0]) +
SQR(view_n[1]) +
SQR(view_n[2]));
412 for (i = 0; i < 3; i++) view_n[i] /= nview_n;
418 for (i = 0; i < 3; i++)
422 if (scr_area[0] < m_scr[0]) m_scr[0] = scr_area[0];
423 if (scr_area[1] > m_scr[1]) m_scr[1] = scr_area[1];
424 if (scr_area[2] < m_scr[2]) m_scr[2] = scr_area[2];
425 if (scr_area[3] > m_scr[3]) m_scr[3] = scr_area[3];
428 for (i = 0; i < 3; i++) vr->
view_point_d[i] = o_v_point[i];
431 for (ii = 0; ii < num_img; ii++) {
436 for (i = 0; i < 3; i++)
438 nview_n = sqrt(
SQR(view_n[0]) +
SQR(view_n[1]) +
SQR(view_n[2]));
440 for (i = 0; i < 3; i++) view_n[i] /= nview_n;
451 "viewpoint=%lf %lf %lf screen_point=%lf %lf %lfup=%lf %lf %lf\n",
454 vr->
up[0], vr->
up[1], vr->
up[2]);
463 for (i = 0; i < 3; i++)
479 xd = (scr_area[1] - scr_area[0]) / (vr->
xr - 20);
480 yd = (scr_area[3] - scr_area[2]) / (vr->
yr - 20);
483 xd = (m_scr[1] - m_scr[0]) / (vr->
xr - 20);
484 yd = (m_scr[3] - m_scr[2]) / (vr->
yr - 20);
490 (int)((
int)(20 + (scr_area[3] - scr_area[2]) / yd) / 10) * 10 +
492 else if (num_img > 1)
494 (int)((
int)(20 + (m_scr[3] - m_scr[2]) / yd) / 10) * 10 + 10;
500 (int)((
int)(20 + (scr_area[1] - scr_area[0]) / xd) / 8) * 8 + 8;
501 else if (num_img > 1)
502 vr->
xr = (int)((
int)(20 + (m_scr[1] - m_scr[0]) / xd) / 8) * 8 + 8;
509 xd = (scr_area[1] - scr_area[0]) / (vr->
xr - 40);
510 yd = (scr_area[3] - scr_area[2]) / (vr->
yr - 20);
511 }
else if (num_img > 1) {
512 xd = (m_scr[1] - m_scr[0]) / (vr->
xr - 40);
513 yd = (m_scr[3] - m_scr[2]) / (vr->
yr - 20);
520 (int)((
int)(20 + (scr_area[3] - scr_area[2]) / yd) / 10) * 10 +
522 else if (num_img > 1)
524 (int)((
int)(20 + (m_scr[3] - m_scr[2]) / yd) / 10) * 10 + 10;
525 }
else if (xd < yd) {
529 (int)((
int)(40 + (scr_area[1] - scr_area[0]) / xd) / 8) * 8 + 8;
530 else if (num_img > 1)
531 vr->
xr = (int)((
int)(40 + (m_scr[1] - m_scr[0]) / xd) / 8) * 8 + 8;
540 if (scale_type == 1) {
541 start_x = 10 + 45 * scale;
543 }
else if (scale_type == 2) {
544 start_x = 10 + 63 * scale;
549 if (vr->
xr < start_x + 10) {
551 "The image x_resolution cannot write such size characters\n");
553 "Please reduce the font size or enlarge x_resolution and run "
558 xd = (scr_area[1] - scr_area[0]) / (vr->
xr - (start_x + 10));
559 yd = (scr_area[3] - scr_area[2]) / (vr->
yr - 20);
560 }
else if (num_img > 1) {
561 xd = (m_scr[1] - m_scr[0]) / (vr->
xr - (start_x + 10));
562 yd = (m_scr[3] - m_scr[2]) / (vr->
yr - 20);
569 (int)((
int)(20 + (scr_area[3] - scr_area[2]) / yd) / 10) * 10 +
571 else if (num_img > 1)
573 (int)((
int)(20 + (m_scr[3] - m_scr[2]) / yd) / 10) * 10 + 10;
574 }
else if (xd < yd) {
578 (int)((
int)(start_x + 10 + (scr_area[1] - scr_area[0]) / xd) /
582 else if (num_img > 1)
584 (int)((
int)(start_x + 10 + (m_scr[1] - m_scr[0]) / xd) / 8) *
595 base_x = (int)((scr_area[0] - m_scr[0]) / xd);
596 base_y = (int)((scr_area[2] - m_scr[2]) / yd);
616 starti = (int)((sscr_area[0] - scr_area[0]) / xd) + start_x - 1;
617 endi = (int)((sscr_area[1] - scr_area[0]) / xd) + start_x + 1;
618 startj = (int)((sscr_area[2] - scr_area[2]) / yd) + start_y - 1;
619 endj = (int)((sscr_area[3] - scr_area[2]) / yd) + start_y + 1;
622 grad_minmax[0] = 1.0E17;
623 grad_minmax[1] = -1.0E17;
631 feap_minmax[0] = 1.0E17;
632 feap_minmax[1] = -1.0E17;
635 tmincolor, tmaxcolor, feap_minmax);
641 feap_minmax[0] = tfeap_minmax[0];
642 feap_minmax[1] = tfeap_minmax[1];
644 feai_minmax[0] = 1.0E17;
645 feai_minmax[1] = -1.0E17;
657 dis_minmax[0] = 1.0E17;
658 dis_minmax[1] = -1.0E17;
693 tav_length = av_length;
701 if (accum_opa ==
NULL)
706 for (j = 0; j < vr->
yr * vr->
xr * 3; j++)
708 for (j = 0; j < vr->
yr * vr->
xr; j++)
715 "The time for preprocessing of pvr is %lf, "
716 "the total time up to now is %lf\n",
721 for (i = 0; i < 3; i++) {
722 r_level[i] =
level[mynode * 3 + i];
724 r_dxyz[i] = dxyz[i] / r_level[i];
730 mincolor = tmincolor;
731 maxcolor = tmaxcolor;
742 for (j = startj; j < endj; j++)
743 for (i = starti; i < endi; i++) {
752 x = xd * (i - start_x + 0.5) + scr_area[0];
753 y = yd * (j - start_y + 0.5) + scr_area[2];
759 inv_matrix, point_o);
761 for (m = 0; m < 3; m++)
768 if (fabs(orig_xyz[0] + dxyz[0] -
772 }
else if (fabs(ray_direction[1]) <
EPSILON) {
773 if (fabs(orig_xyz[1] + dxyz[1] -
777 }
else if (fabs(ray_direction[2]) <
EPSILON) {
778 if (fabs(orig_xyz[2] + dxyz[2] -
783 if (trace_flag == 1) {
784 nn = sqrt(
SQR(ray_direction[0]) +
785 SQR(ray_direction[1]) +
786 SQR(ray_direction[2]));
788 for (m = 0; m < 3; m++) ray_direction[m] /= nn;
803 dxyz, r_dxyz, ray_direction, first_p,
805 if (intersection == 1) {
814 r_dxyz, r_level, empty_flag, var, grad_var,
815 first_p, first_ijk, ray_direction, mincolor,
816 maxcolor, accum_rgba, grad_minmax,
817 feap_minmax, feai_minmax, dis_minmax,
818 opa_table, tav_length, time_step, i, j);
820 for (m = 0; m < 3; m++)
821 image[(j * vr->
xr + i) * 3 + m] =
823 accum_opa[j * vr->
xr + i] = accum_rgba[3];
830 fprintf(stderr,
"Finish the computing on each PE\n");
833 "The volume rendering on each PE is %lf the "
834 "total time up to now is %lf\n",
840 pix_num = (int)(vr->
xr * vr->
yr / pesize);
841 pix0_num = vr->
xr * vr->
yr - pix_num * (pesize - 1);
842 if (mynode == 0) pixn = pix0_num;
843 if (mynode != 0) pixn = pix_num;
848 if ((n_subimage ==
NULL) || (n_subopa ==
NULL))
851 for (j = 0; j < pixn * 3; j++) {
853 n_subimage[j] =
image[j];
854 else if (mynode != 0)
855 n_subimage[mynode * pixn * 3 + j] =
857 (mynode - 1) * pix_num * 3 + j];
860 for (j = 0; j < pixn; j++)
861 n_subopa[j] = accum_opa[j];
862 else if (mynode != 0)
863 for (j = 0; j < pixn; j++)
864 n_subopa[mynode * pixn + j] =
865 accum_opa[pix0_num + (mynode - 1) * pix_num +
871 if ((subimage ==
NULL) || (subopa ==
NULL))
875 for (i = 0; i < pesize; i++) {
880 for (k = 0; k < pesize; k++) {
884 pix0_num * 3,
sizeof(
double));
886 pix0_num,
sizeof(
double));
889 pix_num * 3,
sizeof(
double));
891 pix_num,
sizeof(
double));
894 if ((subimage1 ==
NULL) || (subopa1 ==
NULL))
897 for (j = 0; j < pix0_num * 3; j++)
898 subimage1[j] =
image[j];
899 for (j = 0; j < pix0_num; j++)
900 subopa1[j] = accum_opa[j];
902 for (j = 0; j < pix_num * 3; j++)
905 (k - 1) * pix_num * 3 + j];
906 for (j = 0; j < pix_num; j++)
909 (k - 1) * pix_num + j];
933 for (j = 0; j < pixn * 3; j++)
934 n_subimage[i * pixn * 3 + j] = subimage[j];
935 for (j = 0; j < pixn; j++)
936 n_subopa[i * pixn + j] = subopa[j];
943 for (i = 0; i < 3; i++)
944 center[i] = orig_xyz[i] + dxyz[i] / 2.0;
959 if (ndis_c_v ==
NULL)
961 ndis_c_v[0] = dis_c_v;
962 for (i = 1; i < pesize; i++) {
965 ndis_c_v[i] = dis_c_v;
969 for (i = 0; i < pesize; i++) pe_id[i] = i;
970 for (i = 0; i < pesize - 1; i++)
971 for (j = i + 1; j < pesize; j++) {
972 if (ndis_c_v[i] > ndis_c_v[j]) {
974 ndis_c_v[i] = ndis_c_v[j];
981 for (i = 1; i < pesize; i++)
998 for (j = 0; j < pix0_num * 3; j++)
999 image[j] = subimage[j];
1000 for (i = 1; i < pesize; i++) {
1003 for (j = 0; j < pix_num * 3; j++)
1004 image[pix0_num * 3 + (i - 1) * pix_num * 3 +
1011 fprintf(stderr,
" Finish combining \n");
1014 "The combining time is %lf the total time up "
1026 tmincolor, tmaxcolor, tmincolor, tmaxcolor,
1036 tmincolor, tmaxcolor, org_mincolor,
1037 org_maxcolor,
image);
1054 if (*timestep >= 1000)
1055 snprintf(timestep_str,
sizeof(timestep_str),
"%d", *timestep);
1056 else if (*timestep >= 100)
1057 snprintf(timestep_str,
sizeof(timestep_str),
"0%d", *timestep);
1058 else if (*timestep >= 10)
1059 snprintf(timestep_str,
sizeof(timestep_str),
"00%d", *timestep);
1061 snprintf(timestep_str,
sizeof(timestep_str),
"000%d", *timestep);
1063 snprintf(rotate_str,
sizeof(rotate_str),
"%d", ii);
1065 snprintf(rotate_str,
sizeof(rotate_str),
"0%d", ii);
1066 snprintf(fname,
sizeof(fname),
"%s.%s.%s.bmp", outfile, timestep_str,
1069 FP = fopen(fname,
"wb");
1073 "ERROR: HEC-MW-VIS-E0009: Cannot open output "
1077 #ifdef CONVERSE_ORDER
1079 54 + 3 * vr->
xr * vr->
yr);
1082 #ifdef CONVERSE_ORDER
1087 #ifdef CONVERSE_ORDER
1092 #ifdef CONVERSE_ORDER
1097 #ifdef CONVERSE_ORDER
1102 #ifdef CONVERSE_ORDER
1107 #ifdef CONVERSE_ORDER
1112 #ifdef CONVERSE_ORDER
1117 #ifdef CONVERSE_ORDER
1123 #ifdef CONVERSE_ORDER
1128 #ifdef CONVERSE_ORDER
1133 #ifdef CONVERSE_ORDER
1138 #ifdef CONVERSE_ORDER
1143 #ifdef CONVERSE_ORDER
1148 #ifdef CONVERSE_ORDER
1154 fwrite(&(header.
bfSize),
sizeof(
unsigned int), 1, FP);
1156 sizeof(
unsigned short int), 1, FP);
1158 sizeof(
unsigned short int), 1, FP);
1159 fwrite(&header.
bfOffBits,
sizeof(
unsigned int), 1,
1161 fwrite(&info, 40, 1, FP);
1162 for (j = 0; j < vr->
yr; j++)
1163 for (i = vr->
xr - 1; i >= 0; i--) {
1164 if ((
image[(j * vr->
xr + i) * 3] < 0.1) &&
1165 (
image[(j * vr->
xr + i) * 3 + 1] < 0.1) &&
1166 (
image[(j * vr->
xr + i) * 3 + 2] < 0.1)) {
1171 ri = (int)(
image[(j * vr->
xr + i) * 3] * 256);
1172 gi = (int)(
image[(j * vr->
xr + i) * 3 + 1] *
1174 bi = (int)(
image[(j * vr->
xr + i) * 3 + 2] *
1178 if (ri > 255) ri = 255;
1180 if (gi > 255) gi = 255;
1182 if (bi > 255) bi = 255;
1201 if (num_of_pvr > 1) {
1210 fprintf(stderr,
" Finish the module\n");
1213 " the time for output is %lf the total time of the module is %lf\n",
int HECMW_Comm_rank(HECMW_Comm comm, int *rank)
int HECMW_Comm_size(HECMW_Comm comm, int *size)
int HECMW_Allreduce(void *sendbuf, void *recvbuf, int count, HECMW_Datatype datatype, HECMW_Op op, HECMW_Comm comm)
int HECMW_Send(void *buffer, int count, HECMW_Datatype datatype, int dest, int tag, HECMW_Comm comm)
int HECMW_Barrier(HECMW_Comm comm)
int HECMW_Recv(void *buffer, int count, HECMW_Datatype datatype, int source, int tag, HECMW_Comm comm, HECMW_Status *status)
#define HECMW_FILENAME_LEN
struct hecmwST_local_mesh * mesh
#define HECMW_calloc(nmemb, size)
void find_projection_range(double view_point[3], double n_vertex[24], double scr_area[4])
void view1_parameter_define(int ii, int num_of_frames, int rotate_style, double view_point_d[3], double screen_point[3], int num_of_lights, double *light_point, double up[3], double trange[6])
void tranverse_transform(double screen_point[3], double point_s[3], double inv_matrix[3][3], double point_o[3])
void find_inverse_matrix(double coff_matrix[3][3], double inv_matrix[3][3])
void get_frame_transform_matrix(double view_point_d[3], double screen_point[3], double up[3], double coff_matrix[3][3])
void view_parameter_define(int ii, int num_of_frames, int rotate_style, double view_point_d[3], double screen_point[3], double up[3], int num_of_lights, double *light_point, double trange[6])
void transform2_frame(double coff_matrix[3][3], double view_point[3])
void transform_range_vertex(double range[6], double vertex[24])
void transform_frame(double screen_point[3], double vertex[24], double coff_matrix[3][3], double n_vertex[24])
int change_int_order(int n)
unsigned short int change_short_int_order(unsigned short int n)
void generate_color_bar(int scale_marking_on, double font_size, int color_bar_style, int mark_0_on, int color_mapping_bar_on, int xr, int yr, double font_color[3], int color_system_type, int color_mapping_style, double *interval_point, int interval_mapping_num, int num_of_scale, double tmincolor, double tmaxcolor, double org_mincolor, double org_maxcolor, double *image)
unsigned int change_unsigned_int_order(unsigned int n)
void generate_interval_point_vr(double tmincolor, double tmaxcolor, double *var, int *empty_flag, int nx, int ny, int nz, int mynode, int pesize, HECMW_Comm VIS_COMM, double *interval_point)
void find_color_minmax_vr(double *var, int *empty_flag, int nx, int ny, int nz, double *mincolor, double *maxcolor)
void find_dis_minmax(double view_point_d[3], double vertex[24], double dis_minmax[2])
void find_feap_minmax(int num_of_features, double *fea_point, double mincolor, double maxcolor, double feap_minmax[2])
void output_histogram_vr(double tmincolor, double tmaxcolor, double *var, int *empty_flag, int nx, int ny, int nz, int mynode, int pesize, HECMW_Comm VIS_COMM)
void generate_histogram_graph_vr(double tmincolor, double tmaxcolor, double *var, int *empty_flag, int nx, int ny, int nz, int mynode, int pesize, HECMW_Comm VIS_COMM, int color_system_type)
void find_minmax_vr(double *voxel_dxyz, double *voxel_orig_xyz, int mynode, double range[6])
void HECMW_vis_print_exit(char *var)
void HECMW_vis_memory_exit(char *var)
int calc_voxel_level(int n_voxel, struct hecmwST_local_mesh *mesh, double *voxel_dxyz, double *voxel_orig_xyz, double *extent, int *level, HECMW_Comm VIS_COMM)
int calc_extent(struct hecmwST_local_mesh *mesh, double *extent)
void refinement(struct hecmwST_local_mesh *mesh, double *node1, int n_voxel, double *voxel_dxyz, double *voxel_orig_xyz, int *level, int *voxel_n_neighbor_pe, int **voxel_neighbor_pe, double *extent, int my_rank, HECMW_Comm VIS_COMM, int *empty_flag, double *var)
int * voxel_n_neighbor_pe
void HECMW_vis_pvr_rendering(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, int *timestep, int *init_flag, int num_of_pvr, Parameter_vr *vr, int stat_para[NUM_CONTROL_PVR], char *outfile, HECMW_Comm VIS_COMM)
int find_first_inter(double point_o[3], double view_point_d[3], int r_level[3], double orig_xyz[3], double dxyz[3], double r_dxyz[3], double ray_direction[3], double first_p[3], int ijk[3])
void ray_trace(int remove_0_display_on, int color_mapping_style, double *interval_point, int transfer_function_style, double opa_value, int num_of_features, double *fea_point, double view_point_d[3], int interval_mapping_num, int color_system_type, int num_of_lights, double *light_point, double k_ads[3], double orig_xyz[3], double dxyz[3], double r_dxyz[3], int r_level[3], int *empty_flag, double *var, double *grad_var, double first_p[3], int first_ijk[3], double ray_direction[3], double mincolor, double maxcolor, double accum_rgba[4], double grad_minmax[2], double feap_minmax[2], double feai_minmax[2], double dis_minmax[2], double *opa_table, double tav_length, int time_step, int test_i, int test_j)
int read_voxel_file(char *filename, int n_voxel, double *voxel_dxyz, double *voxel_orig_xyz, int *level, int *voxel_n_neighbor_pe, int **voxel_neighbor_pe)
void composite_subimage_vr(int pesize, int *pe_id, int pixn, double *n_subimage, double *n_subopa, double *subimage)
void transform_ucd_pvr(struct hecmwST_result_data *data, double *node1, struct hecmwST_local_mesh *mesh, Parameter_vr *vr, int my_rank, int pe_size, HECMW_Comm VIS_COMM, double *voxel_dxyz, double *voxel_orig_xyz, int *level, int *voxel_n_neighbor_pe, int **voxel_neighbor_pe, int voxel_on, int display_range_on, int init_flag, int num_of_pvr)
int transfer_function_style
double background_color[3]
unsigned short bfReserved1
unsigned short bfReserved2
unsigned int biCompression
unsigned short biBitCount
unsigned int biClrImportant