JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
CvThumbNailDoc Class Reference

#include <vThumbNailDoc.h>

Inheritance diagram for CvThumbNailDoc:
Collaboration diagram for CvThumbNailDoc:

Public Member Functions

virtual CmnHead TranslateData ()
 
void SetSize (int txs, int tys, int bds, int vrs, int hrs, int ymx)
 
int GetTNailNum (POINT pt)
 
virtual void Serialize (CArchive &ar)
 
virtual ~CvThumbNailDoc ()
 
virtual void AssertValid () const
 
virtual void Dump (CDumpContext &dc) const
 
- Public Member Functions inherited from CRwGRDoc
virtual BOOL ReadDataFile (LPCTSTR str)
 
virtual BOOL MakeViewData ()
 
virtual ~CRwGRDoc ()
 
- Public Member Functions inherited from CExDocument
CExViewGetView ()
 
virtual BOOL WriteDataFile (LPCTSTR)
 
virtual BOOL OnNewDocument ()
 
virtual BOOL OnOpenDocument (LPCTSTR lpszPathName)
 
virtual ~CExDocument ()
 

Public Attributes

int tNailBorder
 
int xTNailSize
 
int yTNailSize
 
int xTNailOrder
 
int yTNailOrder
 
int xClientSize
 
int yClientSize
 
int yMaxOrder
 
int yMaxClientSize
 
- Public Attributes inherited from CExDocument
CmnHead infHead
 
ExMSGraph< sWordmsGraph
 
ExCmnHead cmnHead
 
CExViewpView
 
CExFramepFrame
 
CAppCallBackpApp
 
voidanyData
 
CString Title
 
CString preTitle
 
CString pstTitle
 
int vMax
 
int vMin
 
int cMax
 
int cMin
 
int base
 
int colorMode
 
int startNo
 
int endNo
 
BOOL multiSliceData
 
BOOL hasReadData
 
BOOL hasViewData
 
BOOL ctrlCntrst
 
BOOL notFreeMSGraph
 
BOOL notFreeCmnHead
 

Protected Member Functions

 CvThumbNailDoc ()
 
- Protected Member Functions inherited from CRwGRDoc
 CRwGRDoc ()
 
- Protected Member Functions inherited from CExDocument
 CExDocument ()
 

Detailed Description

Definition at line 41 of file vThumbNailDoc.h.

Constructor & Destructor Documentation

◆ CvThumbNailDoc()

CvThumbNailDoc ( )
protected

Definition at line 26 of file vThumbNailDoc.cpp.

27{
29}
void SetSize(int txs, int tys, int bds, int vrs, int hrs, int ymx)
#define THUMBNAIL_SIZE

References THUMBNAIL_SIZE.

◆ ~CvThumbNailDoc()

~CvThumbNailDoc ( )
virtual

Definition at line 32 of file vThumbNailDoc.cpp.

33{
34}

Member Function Documentation

◆ AssertValid()

void AssertValid ( ) const
virtual

Reimplemented from CRwGRDoc.

Definition at line 50 of file vThumbNailDoc.cpp.

51{
53}
virtual void AssertValid() const
Definition RwGRDoc.cpp:52

References CRwGRDoc::AssertValid().

Here is the call graph for this function:

◆ Dump()

void Dump ( CDumpContext & dc) const
virtual

Reimplemented from CRwGRDoc.

Definition at line 57 of file vThumbNailDoc.cpp.

58{
60}
virtual void Dump(CDumpContext &dc) const
Definition RwGRDoc.cpp:59

References CExDocument::cMin, and CRwGRDoc::Dump().

Here is the call graph for this function:

◆ GetTNailNum()

int GetTNailNum ( POINT pt)

Definition at line 218 of file vThumbNailDoc.cpp.

219{
220 int xx = pt.x/(xTNailSize+ tNailBorder) + 1;
221 int yy = pt.y/(yTNailSize+ tNailBorder) + 1;
222 int ret = (yy - 1)*2 + xx;
223
224 if (ret<0 || ret>msGraph.zs) ret = -1;
225 return ret;
226}
ExMSGraph< sWord > msGraph
Definition ExDocument.h:52

References CExDocument::cMin, CExDocument::msGraph, CvThumbNailDoc::tNailBorder, CvThumbNailDoc::xTNailSize, and CvThumbNailDoc::yTNailSize.

◆ Serialize()

void Serialize ( CArchive & ar)
virtual

Reimplemented from CRwGRDoc.

Definition at line 68 of file vThumbNailDoc.cpp.

69{
70 if (ar.IsStoring())
71 {
72 // TODO: この位置に保存用のコードを追加してください
73 }
74 else
75 {
76 // TODO: この位置に読み込み用のコードを追加してください
77 }
78}

References CExDocument::cMin.

◆ SetSize()

void SetSize ( int txs,
int tys,
int bds,
int hrs,
int vrs,
int ymx )

txs サムネイルの Xサイズ(ピクセル) tys サムネイルの Yサイズ(ピクセル) bds サムネイル間のボーダサイズ(ピクセル) hrs ウィンドウの初期横サイズ(サムネイルの個数で指定) vrs ウィンドウの初期縦サイズ(サムネイルの個数で指定)

0以下 が指定された場合は,値を変更しない.

Definition at line 203 of file vThumbNailDoc.cpp.

References CExDocument::cMin, CvThumbNailDoc::tNailBorder, CvThumbNailDoc::xClientSize, CvThumbNailDoc::xTNailOrder, CvThumbNailDoc::xTNailSize, CvThumbNailDoc::yClientSize, CvThumbNailDoc::yMaxClientSize, CvThumbNailDoc::yMaxOrder, CvThumbNailDoc::yTNailOrder, and CvThumbNailDoc::yTNailSize.

Referenced by CvThumbNailDoc::TranslateData().

Here is the caller graph for this function:

◆ TranslateData()

CmnHead TranslateData ( )
virtual

Reimplemented from CRwGRDoc.

Definition at line 85 of file vThumbNailDoc.cpp.

86{
87 int i, j, k;
89
90 // サムネイルのサイズの再計算
91 if (msGraph.xs>0 && msGraph.ys>0) {
92 if (msGraph.xs>msGraph.ys) {
93 int ysize = THUMBNAIL_SIZE*msGraph.ys/msGraph.xs;
94 SetSize(0, ysize, 0, 0, 0, 0); // 0 の箇所は変化なし
95 }
96 else {
97 int xsize = THUMBNAIL_SIZE*msGraph.xs/msGraph.ys;
98 SetSize(xsize, 0, 0, 0, 0, 0); // 0 の箇所は変化なし
99 }
100 }
101
102 colorMode = msGraph.color;
103 chd.kind = CT_DATA;
104 chd.xsize = xClientSize;
105 chd.ysize = Max(((msGraph.zs+1)/2+1)*(yTNailSize+tNailBorder), yClientSize);
106 chd.zsize = yClientSize;
107 chd.depth = 8;
108 chd.bsize = 0;
109 chd.buf = NULL;
110 chd.lsize = chd.xsize*chd.ysize;
111 chd.grptr = (uByte*)malloc(chd.lsize);
112 if (chd.grptr==NULL) {
114 chd.xsize = -2;
115 return chd;
116 }
117 for (i=0; i<chd.xsize*chd.ysize; i++) chd.grptr[i] = VIEW_8_MAX; // バックを白にする
118
119 // カウンタ
120 CVCounter* counter = NULL; // カウンタはここでは,delete禁止
121 if (chd.zsize>10) {
123 if (counter!=NULL) counter->SetMax(msGraph.zs*2/10);
124 }
125
126 // コントラスト調整のための最大値と最小値
127 int min = SINTMAX;
128 int max = SINTMIN;
129 int ks, js;
130 for (k=0; k<msGraph.zs; k++) {
131 ks = k*msGraph.xs*msGraph.ys;
132 for (j=0; j<msGraph.ys; j++) {
133 js = j*msGraph.xs;
134 for (i=0; i<msGraph.xs; i++) {
135 min = Min((int)msGraph.gp[i+js+ks], min);
136 max = Max((int)msGraph.gp[i+js+ks], max);
137 }
138 }
139 if (counter!=NULL && k%10==0) {
140 counter->StepIt();
141 if (counter->isCanceled()) { // キャンセル
143 chd.xsize = -3;
144 return chd;
145 }
146 }
147 }
148
149 if (min>=0 && max<=VIEW_8_MAX && !ctrlCntrst) {
150 max = VIEW_8_MAX;
151 min = 0;
152 }
153 msGraph.max = (sWord)max;
154 msGraph.min = (sWord)min;
155
156 RECT rect;
157 int ii, jj;
158 for (k=0; k<msGraph.zs; k++) {
159 rect.left = (k%2)*(xTNailSize + tNailBorder) + 1;
160 rect.right = rect.left + xTNailSize - 1;
161 rect.top = (k/2)*(yTNailSize + tNailBorder) + 1;
162 rect.bottom = rect.top + yTNailSize - 1;
163
164 for (i=rect.left-1; i<=rect.right +1; i++) CmnHeadBytePoint(chd, i, rect.top-1) = 0;
165 for (i=rect.left-1; i<=rect.right +1; i++) CmnHeadBytePoint(chd, i, rect.bottom+1) = 0;
166 for (j=rect.top-1; j<=rect.bottom+1; j++) CmnHeadBytePoint(chd, rect.left -1, j) = 0;
167 for (j=rect.top-1; j<=rect.bottom+1; j++) CmnHeadBytePoint(chd, rect.right+1, j) = 0;
168
169 for (j=0; j<yTNailSize; j++) {
170 jj = j*(msGraph.ys-1)/(yTNailSize-1);
171 for (i=0; i<xTNailSize; i++) {
172 ii = i*(msGraph.xs-1)/(xTNailSize-1);
173 CmnHeadBytePoint(chd, rect.left+i, rect.top+j) = (uByte)((float)(msGraph.point(ii, jj, k)-min)/(max-min)*VIEW_8_MAX);
174 }
175 }
176 if (counter!=NULL && k%10==0) {
177 counter->StepIt();
178 if (counter->isCanceled()) { // キャンセル
180 chd.xsize = -3;
181 return chd;
182 }
183 }
184 }
185
186 // 表示はモノクロ固定
189
190 return chd;
191}
#define VIEW_8_MAX
Definition ExView.h:39

References CExDocument::cMin, CExDocument::colorMode, CExView::colorMode, CExDocument::ctrlCntrst, CExView::maxYSize, CExDocument::msGraph, CExDocument::pView, CvThumbNailDoc::SetSize(), THUMBNAIL_SIZE, CvThumbNailDoc::tNailBorder, VIEW_8_MAX, CvThumbNailDoc::xClientSize, CvThumbNailDoc::xTNailSize, CvThumbNailDoc::yClientSize, CvThumbNailDoc::yMaxClientSize, and CvThumbNailDoc::yTNailSize.

Here is the call graph for this function:

Member Data Documentation

◆ tNailBorder

◆ xClientSize

int xClientSize

Definition at line 57 of file vThumbNailDoc.h.

Referenced by CvThumbNailDoc::SetSize(), and CvThumbNailDoc::TranslateData().

◆ xTNailOrder

int xTNailOrder

Definition at line 54 of file vThumbNailDoc.h.

Referenced by CvThumbNailDoc::SetSize().

◆ xTNailSize

◆ yClientSize

int yClientSize

Definition at line 58 of file vThumbNailDoc.h.

Referenced by CvThumbNailDoc::SetSize(), and CvThumbNailDoc::TranslateData().

◆ yMaxClientSize

int yMaxClientSize

Definition at line 61 of file vThumbNailDoc.h.

Referenced by CvThumbNailDoc::SetSize(), and CvThumbNailDoc::TranslateData().

◆ yMaxOrder

int yMaxOrder

Definition at line 60 of file vThumbNailDoc.h.

Referenced by CvThumbNailDoc::SetSize().

◆ yTNailOrder

int yTNailOrder

Definition at line 55 of file vThumbNailDoc.h.

Referenced by CvThumbNailDoc::SetSize().

◆ yTNailSize


The documentation for this class was generated from the following files: