~diresu/blender/blender-command-port-002

« back to all changes in this revision

Viewing changes to source/blender/editors/interface/interface_draw.c

  • Committer: Dietrich Bollmann
  • Date: 2010-07-23 08:21:44 UTC
  • mfrom: (15474.1.5025)
  • Revision ID: dietrich@formgames.org-20100723082144-24nrn8oku0115pwh
Update to state of blender repository from 2010-07-23 revision 30644.

Show diffs side-by-side

added added

removed removed

Lines of Context:
469
469
        //int w, h;
470
470
        
471
471
        /* hardcoded to splash, loading and freeing every draw, eek! */
472
 
        ibuf= IMB_ibImageFromMemory((int *)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
 
472
        ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
473
473
 
474
474
        if (!ibuf) return;
475
475
        
861
861
                glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
862
862
        }
863
863
        /* 3 vertical separation */
864
 
        if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUM) {
 
864
        if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUMA) {
865
865
                for (i=1; i<3; i++) {
866
866
                        fdrawline(rect.xmin+i*w3, rect.ymin, rect.xmin+i*w3, rect.ymax);
867
867
                }
878
878
                fdrawline(rect.xmin+w3, yofs+h*240.0f/255.0f, rect.xmax+1, yofs+h*240.0f/255.0f);
879
879
        }
880
880
        /* 7.5 IRE black point level for NTSC */
881
 
        if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUM)
 
881
        if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUMA)
882
882
                fdrawline(rect.xmin, yofs+h*0.075f, rect.xmax+1, yofs+h*0.075f);
883
 
        
884
 
        /* LUMA (1 channel) */
885
 
        glBlendFunc(GL_ONE,GL_ONE);
886
 
        glColor3f(alpha, alpha, alpha);
887
 
        if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUM){
888
 
 
889
 
                glBlendFunc(GL_ONE,GL_ONE);
890
 
                
891
 
                glPushMatrix();
892
 
                glEnableClientState(GL_VERTEX_ARRAY);
893
 
                
894
 
                glTranslatef(rect.xmin, yofs, 0.f);
895
 
                glScalef(w, h, 0.f);
896
 
                glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
897
 
                glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
898
 
                                
899
 
                glDisableClientState(GL_VERTEX_ARRAY);
900
 
                glPopMatrix();
901
 
 
902
 
                /* min max */
903
 
                glColor3f(.5f, .5f, .5f);
904
 
                min= yofs+scopes->minmax[0][0]*h;
905
 
                max= yofs+scopes->minmax[0][1]*h;
906
 
                CLAMP(min, rect.ymin, rect.ymax);
907
 
                CLAMP(max, rect.ymin, rect.ymax);
908
 
                fdrawline(rect.xmax-3,min,rect.xmax-3,max);
909
 
        }
910
 
 
911
 
        /* RGB / YCC (3 channels) */
912
 
        else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
913
 
                int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
914
 
                
915
 
                glBlendFunc(GL_ONE,GL_ONE);
916
 
                
917
 
                glPushMatrix();
918
 
                glEnableClientState(GL_VERTEX_ARRAY);
919
 
                
920
 
                glTranslatef(rect.xmin, yofs, 0.f);
921
 
                glScalef(w3, h, 0.f);
922
 
                
923
 
                glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
924
 
                glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
925
 
                glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
926
 
 
927
 
                glTranslatef(1.f, 0.f, 0.f);
928
 
                glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
929
 
                glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
930
 
                glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
931
 
                
932
 
                glTranslatef(1.f, 0.f, 0.f);
933
 
                glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
934
 
                glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
935
 
                glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
936
 
                
937
 
                glDisableClientState(GL_VERTEX_ARRAY);
938
 
                glPopMatrix();
939
 
 
940
 
                
941
 
                /* min max */
942
 
                for (c=0; c<3; c++) {
943
 
                        if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
944
 
                                glColor3f(colors[c][0]*0.75, colors[c][1]*0.75, colors[c][2]*0.75);
945
 
                        else
946
 
                                glColor3f(colorsycc[c][0]*0.75, colorsycc[c][1]*0.75, colorsycc[c][2]*0.75);
947
 
                        min= yofs+scopes->minmax[c][0]*h;
948
 
                        max= yofs+scopes->minmax[c][1]*h;
 
883
 
 
884
        if (scopes->ok && scopes->waveform_1 != NULL) {
 
885
                
 
886
                /* LUMA (1 channel) */
 
887
                glBlendFunc(GL_ONE,GL_ONE);
 
888
                glColor3f(alpha, alpha, alpha);
 
889
                if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA){
 
890
 
 
891
                        glBlendFunc(GL_ONE,GL_ONE);
 
892
                        
 
893
                        glPushMatrix();
 
894
                        glEnableClientState(GL_VERTEX_ARRAY);
 
895
                        
 
896
                        glTranslatef(rect.xmin, yofs, 0.f);
 
897
                        glScalef(w, h, 0.f);
 
898
                        glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
 
899
                        glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
 
900
                                        
 
901
                        glDisableClientState(GL_VERTEX_ARRAY);
 
902
                        glPopMatrix();
 
903
 
 
904
                        /* min max */
 
905
                        glColor3f(.5f, .5f, .5f);
 
906
                        min= yofs+scopes->minmax[0][0]*h;
 
907
                        max= yofs+scopes->minmax[0][1]*h;
949
908
                        CLAMP(min, rect.ymin, rect.ymax);
950
909
                        CLAMP(max, rect.ymin, rect.ymax);
951
 
                        fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
952
 
                }
 
910
                        fdrawline(rect.xmax-3,min,rect.xmax-3,max);
 
911
                }
 
912
 
 
913
                /* RGB / YCC (3 channels) */
 
914
                else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
 
915
                        int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
 
916
                        
 
917
                        glBlendFunc(GL_ONE,GL_ONE);
 
918
                        
 
919
                        glPushMatrix();
 
920
                        glEnableClientState(GL_VERTEX_ARRAY);
 
921
                        
 
922
                        glTranslatef(rect.xmin, yofs, 0.f);
 
923
                        glScalef(w3, h, 0.f);
 
924
                        
 
925
                        glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
 
926
                        glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
 
927
                        glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
 
928
 
 
929
                        glTranslatef(1.f, 0.f, 0.f);
 
930
                        glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
 
931
                        glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
 
932
                        glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
 
933
                        
 
934
                        glTranslatef(1.f, 0.f, 0.f);
 
935
                        glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
 
936
                        glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
 
937
                        glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
 
938
                        
 
939
                        glDisableClientState(GL_VERTEX_ARRAY);
 
940
                        glPopMatrix();
 
941
 
 
942
                        
 
943
                        /* min max */
 
944
                        for (c=0; c<3; c++) {
 
945
                                if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
 
946
                                        glColor3f(colors[c][0]*0.75, colors[c][1]*0.75, colors[c][2]*0.75);
 
947
                                else
 
948
                                        glColor3f(colorsycc[c][0]*0.75, colorsycc[c][1]*0.75, colorsycc[c][2]*0.75);
 
949
                                min= yofs+scopes->minmax[c][0]*h;
 
950
                                max= yofs+scopes->minmax[c][1]*h;
 
951
                                CLAMP(min, rect.ymin, rect.ymax);
 
952
                                CLAMP(max, rect.ymin, rect.ymax);
 
953
                                fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
 
954
                        }
 
955
                }
 
956
                
953
957
        }
954
958
        
955
959
        /* outline, scale gripper */
969
973
void vectorscope_draw_target(float centerx, float centery, float diam, float r, float g, float b)
970
974
{
971
975
        float y,u,v;
972
 
        float tangle, tampli;
 
976
        float tangle=0.f, tampli;
973
977
        float dangle, dampli, dangle2, dampli2;
974
978
 
975
979
        rgb_to_yuv(r,g,b, &y, &u, &v);
1030
1034
        float colors[6][3]={{.75,0,0},{.75,.75,0},{0,.75,0},{0,.75,.75},{0,0,.75},{.75,0,.75}};
1031
1035
        GLint scissor[4];
1032
1036
        
1033
 
        if (scopes==NULL) return;
1034
 
        
1035
1037
        rect.xmin = (float)recti->xmin+1;
1036
1038
        rect.xmax = (float)recti->xmax-1;
1037
1039
        rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
1079
1081
        for(i=0; i<6; i++)
1080
1082
                vectorscope_draw_target(centerx, centery, diam, colors[i][0], colors[i][1], colors[i][2]);
1081
1083
        
1082
 
        /* pixel point cloud */
1083
 
        glBlendFunc(GL_ONE,GL_ONE);
1084
 
        glColor4f(alpha, alpha, alpha, alpha);
1085
 
 
1086
 
        glPushMatrix();
1087
 
        glEnableClientState(GL_VERTEX_ARRAY);
1088
 
 
1089
 
        glTranslatef(centerx, centery, 0.f);
1090
 
        glScalef(diam, diam, 0.f);
1091
 
        glVertexPointer(2, GL_FLOAT, 0, scopes->vecscope);
1092
 
        glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
1093
 
 
1094
 
        glDisableClientState(GL_VERTEX_ARRAY);
1095
 
        glPopMatrix();
1096
 
        
 
1084
        if (scopes->ok && scopes->vecscope != NULL) {
 
1085
                /* pixel point cloud */
 
1086
                glBlendFunc(GL_ONE,GL_ONE);
 
1087
                glColor3f(alpha, alpha, alpha);
 
1088
 
 
1089
                glPushMatrix();
 
1090
                glEnableClientState(GL_VERTEX_ARRAY);
 
1091
 
 
1092
                glTranslatef(centerx, centery, 0.f);
 
1093
                glScalef(diam, diam, 0.f);
 
1094
 
 
1095
                glVertexPointer(2, GL_FLOAT, 0, scopes->vecscope);
 
1096
                glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
 
1097
                
 
1098
                glDisableClientState(GL_VERTEX_ARRAY);
 
1099
                glPopMatrix();
 
1100
        }
 
1101
 
1097
1102
        /* outline, scale gripper */
1098
1103
        draw_scope_end(&rect, scissor);
1099
1104