Mercurial > mercurial > hgweb_searcher03.cgi
comparison src/bprint.cpp @ 4:fdba695b99f1
More fast ( read from DB ).
Improve the precision of marksheet judgement.
| author | pyon@macmini |
|---|---|
| date | Wed, 11 Sep 2013 19:09:14 +0900 |
| parents | 1a64119ab257 |
| children | bc2e2b304095 |
comparison
equal
deleted
inserted
replaced
| 3:1a64119ab257 | 4:fdba695b99f1 |
|---|---|
| 1 // Filename : bprint.cpp | 1 // Filename : bprint.cpp |
| 2 // Last Change: 27-Aug-2013. | 2 // Last Change: 11-Sep-2013. |
| 3 // | 3 // |
| 4 | 4 |
| 5 #include "bprint.h" | 5 #include "bprint.h" |
| 6 #include "marksheet.h" | 6 #include "marksheet.h" |
| 7 #include "dndfile.h" | 7 #include "dndfile.h" |
| 133 wxString html; | 133 wxString html; |
| 134 html = html + wxT("<html><body>\n"); | 134 html = html + wxT("<html><body>\n"); |
| 135 | 135 |
| 136 wxString file; | 136 wxString file; |
| 137 bool cout = dir.GetFirst( &file, wxT("*.jpg"), wxDIR_FILES ); | 137 bool cout = dir.GetFirst( &file, wxT("*.jpg"), wxDIR_FILES ); |
| 138 bool notyet_mask = true; | |
| 138 int n = 0; | 139 int n = 0; |
| 139 wxString tmpdir = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH; | 140 wxString tmpdir = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH; |
| 140 while ( cout ) { | 141 while ( cout ) { |
| 141 file = path + wxFILE_SEP_PATH + file; | 142 file = path + wxFILE_SEP_PATH + file; |
| 142 file.Replace( wxFILE_SEP_PATH, wxT("/") ); | 143 file.Replace( wxFILE_SEP_PATH, wxT("/") ); |
| 143 wxString tmpjpg = wxString::Format( wxT("%stmp%d.jpg"), tmpdir, n ); | 144 wxString tmpjpg = wxString::Format( wxT("%stmp%d.jpg"), tmpdir, n ); |
| 144 | 145 |
| 145 if ( n == 0 ) { // 1枚目はマスクする | 146 double zmin = 0.095713; |
| 147 double zmax = 0.147142; | |
| 148 long lmin = 2072393; | |
| 149 long lmax = 2472318; | |
| 150 | |
| 151 if ( notyet_mask && IsMarksheet( file, zmin, zmax, lmin, lmax ) ) { // マークシート表面をマスクする | |
| 146 wxImage img_org( file, wxBITMAP_TYPE_JPEG ); | 152 wxImage img_org( file, wxBITMAP_TYPE_JPEG ); |
| 147 int ver = GetMarksheetVersion( file ); | 153 int ver = GetMarksheetVersion( file ); |
| 148 if ( ver == 2 ) { | 154 if ( ver == 2 ) { |
| 149 img_org.SetRGB( m_mask1, 255, 255, 255 ); // cm name | 155 img_org.SetRGB( m_mask1, 255, 255, 255 ); // cm name |
| 150 img_org.SetRGB( m_mask2, 255, 255, 255 ); // cm no. | 156 img_org.SetRGB( m_mask2, 255, 255, 255 ); // cm no. |
