CDxGraphDoc Class Reference

#include <DxGraphDoc.h>

Inheritance diagram for CDxGraphDoc:
Inheritance graph
[legend]
Collaboration diagram for CDxGraphDoc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

BOOL MakeViewData ()
BOOL ReadDataFile (LPCTSTR fname)
virtual void Serialize (CArchive &ar)
virtual ~CDxGraphDoc ()
virtual void AssertValid () const
virtual void Dump (CDumpContext &dc) const

Protected Member Functions

 CDxGraphDoc ()

Detailed Description

Definition at line 39 of file DxGraphDoc.h.


Constructor & Destructor Documentation

CDxGraphDoc (  )  [protected]

Definition at line 25 of file DxGraphDoc.cpp.

00026 {
00027 }

~CDxGraphDoc (  )  [virtual]

Definition at line 31 of file DxGraphDoc.cpp.

00032 {
00033 }


Member Function Documentation

void AssertValid (  )  const [virtual]

Reimplemented from CExDocument.

Definition at line 50 of file DxGraphDoc.cpp.

00051 {
00052     CExDocument::AssertValid();
00053 }

void Dump ( CDumpContext &  dc  )  const [virtual]

Reimplemented from CExDocument.

Definition at line 56 of file DxGraphDoc.cpp.

00057 {
00058     CExDocument::Dump(dc);
00059 }

BOOL MakeViewData (  )  [virtual]

Reimplemented from CExDocument.

Definition at line 113 of file DxGraphDoc.cpp.

References CExDocument::cMax, CExDocument::cMin, CExDocument::cmnHead, CExDocument::ctrlCntrst, CExDocument::msGraph, VIEW_8_MAX, CExDocument::vMax, and CExDocument::vMin.

00114 {
00115 //  int kind = cmnHead.kind;
00116 //  int chk  = kind & 0x00ff;
00117 
00118     if (!msGraph.isNull()) {
00119         freeCmnHead(&cmnHead);
00120 
00121         int mode = 0;
00122         if (msGraph.color==GRAPH_COLOR_MONO || msGraph.color==GRAPH_COLOR_MONO16 ||  // 表示は 8bit
00123             msGraph.color==GRAPH_COLOR_RGB  || msGraph.color==GRAPH_COLOR_BGR  || 
00124             msGraph.color==GRAPH_COLOR_XRGB || msGraph.color==GRAPH_COLOR_ARGB || msGraph.color==GRAPH_COLOR_RGBA ||
00125             msGraph.color==GRAPH_COLOR_XBGR || msGraph.color==GRAPH_COLOR_ABGR || msGraph.color==GRAPH_COLOR_BGRA) {
00126             // 8bit/pixcel
00127             mode = MG2CH_OCTET;
00128         }
00129         if (ctrlCntrst || msGraph.color==GRAPH_COLOR_MONO16) {
00130             mode |= MG2CH_CONTRAST;
00131         }
00132 
00133         //
00134         cmnHead = copyMSGraph2CmnHead(msGraph, mode);
00135         
00136         //
00137         cMax = vMax = msGraph.max;
00138         cMin = vMin = msGraph.min;
00139         if (msGraph.color==GRAPH_COLOR_RGB16 || msGraph.color==GRAPH_COLOR_ARGB16) {
00140             // 16bit/pixcel
00141             //vMax = cMax = UWORDMAX;
00142             //vMin = cMin = 0;
00143         }
00144         else if (!ctrlCntrst && cMin>=0 && cMax<=VIEW_8_MAX) {
00145             vMax = cMax = VIEW_8_MAX;
00146             vMin = cMin = 0;
00147         }
00148     }
00149 
00150     else {  //  DirectX9 サポートデータ(DirectX9に任せる)
00151         D3DXIMAGE_INFO imgInfo;
00152         HRESULT hr = D3DXGetImageInfoFromFileInMemory(cmnHead.grptr, cmnHead.lsize, &imgInfo);
00153         if (FAILED(hr)) {   
00154             freeNull(cmnHead.grptr);
00155             cmnHead.kind  = HEADER_NONE;
00156             return FALSE;
00157         }
00158         cmnHead.xsize = imgInfo.Width;
00159         cmnHead.ysize = imgInfo.Height;
00160         cmnHead.zsize = 1;
00161         cmnHead.depth = imgInfo.Format;
00162         cmnHead.bsize = sizeof(D3DXIMAGE_INFO);
00163         cmnHead.buf   = (uByte*)malloc(cmnHead.bsize);
00164         if (cmnHead.buf==NULL) {
00165             freeCmnHead(&cmnHead);
00166             return FALSE;
00167         }
00168         bcopy((char*)&imgInfo, (char*)cmnHead.buf, cmnHead.bsize);
00169     }
00170     return  TRUE;
00171 }

BOOL ReadDataFile ( LPCTSTR  str  )  [virtual]

機能: 画像データを読み込む. 引数: ファイル名 戻値: TRUE: 成功,FALSE: 失敗 説明: 読み込んだグラフィックデータ(msGraphメンバ)と ヘッダ情報(cmnHeadメンバ) cmnHead.kind: HEADER_ERR → データ読み込み失敗. その他 → CmnHead hd にデータが入る. UN_KNOWN → ヘッダが解析できないのでファイルイメージのまま hd->grptrに格納される. hd->kind, hd->lsize, hd->gptrのみ有効.MSGraph<sWord>.gp はNULL. その他 → MSGraph<sWord>.gp にデータが入る. cmnHead にはヘッダ情報のみが入り,cmnHead->buf, cmnHead->gptr はNULL. CT_DATA, RAS_DATA, CT_3DX など.

Reimplemented from CExDocument.

Definition at line 100 of file DxGraphDoc.cpp.

References CExDocument::cmnHead, CExDocument::infHead, CExDocument::msGraph, and jbxwl::ts2mbs().

00101 {
00102     char* fname = ts2mbs(str);
00103     msGraph = readGraphicFile<sWord>(fname, &cmnHead);
00104     ::free(fname);
00105     infHead = getinfo_CmnHead(cmnHead);
00106 
00107     if (cmnHead.kind==HEADER_NONE) return  FALSE;
00108     return  TRUE;
00109 }

Here is the call graph for this function:

void Serialize ( CArchive &  ar  )  [virtual]

Reimplemented from CExDocument.

Definition at line 68 of file DxGraphDoc.cpp.

00069 {
00070     if (ar.IsStoring())
00071     {
00072         // TODO: この位置に保存用のコードを追加してください
00073     }
00074     else
00075     {
00076         // TODO: この位置に読み込み用のコードを追加してください
00077     }
00078 }


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

Generated on 15 Nov 2023 for JunkBox_Win_Lib by  doxygen 1.6.1