FreeTypeを使う 新しいページはコチラ

提供: yonewiki
移動: 案内, 検索
(サンプル3.公式サイトのErik Mollerさん作成 Qt版)
(サンプル3.公式サイトのErik Mollerさん作成 Qt版)
809行: 809行:
 
         header.idLength = 0; // 1byte 0~255
 
         header.idLength = 0; // 1byte 0~255
  
         //Color Map 0=無, 1=有
+
         //Color Map 0★=無, 1=有(この場合0~127はTruVisionが予約している色、128~255はファイルで定義)
         header.paletteType = 0;
+
         header.paletteType = 0; // 1byte
  
         //TGAファイルの形式
+
         //TGAファイルの形式  
 
         //0- 画像データは含まれていません。
 
         //0- 画像データは含まれていません。
 
         //1- 非圧縮、カラーマップ画像
 
         //1- 非圧縮、カラーマップ画像
         //2- 非圧縮、トゥルーカラー画像       //
+
         //2★- 非圧縮、トゥルーカラー画像
         //9- ランレングスエンコード、カラーマップ画像
+
        //3- 非圧縮、白黒画像   
 +
         //9- ランレングスエンコード、カラーマップ画像  
 +
        //10- ランレングスエンコード、トゥルーカラー画像
 
         //11-ランレングスエンコード、白黒画像
 
         //11-ランレングスエンコード、白黒画像
         header.imageType = 2;
+
         header.imageType = 2; // 1byte
  
         header.firstPaletteEntry = 0;
+
         //カラーマップ///////////////////////////////
         header.numPaletteEntries = 0;
+
        //カラーマップを使う場合の最初の番号
 +
         header.firstPaletteEntry = 0; // 2byte
  
         header.paletteBits = 0;
+
        //カラーマップを使う場合の総数
 +
         header.numPaletteEntries = 0; // 2byte
  
         header.x = 0;
+
         //カラーマップを使う場合の色を表すのに使うビット数。専用カードがある場合でも変わる。
         header.y = 0;
+
         header.paletteBits = 0; // 1byte
         header.width = width;
+
         //////////////////////////////////////////////
        header.height = height;
+
  
         header.depth = 32;
+
        //画像原点位置/////////////////////////////
         header.descriptor = 0x20;
+
        //左下原点としたときの画像開始水平位置
 +
        header.x = 0; // 1byte
 +
 
 +
        //左下原点としたときの画像開始垂直位置
 +
        header.y = 0; // 1byte
 +
        //////////////////////////////////////////////
 +
 
 +
        //画像サイズ///////////////////////////////
 +
        //横幅
 +
        header.width = width; // 2byte
 +
 
 +
        //縦幅
 +
        header.height = height; // 2byte
 +
        //////////////////////////////////////////////
 +
 
 +
        //色表現bit数
 +
         header.depth = 32; // 1byte
 +
 
 +
        //ヘッダ説明部 ビットによって細分化されている
 +
        //下位 0~3bit 1ピクセル毎のアルファチャンネルビット数
 +
        //上位 4bit 1なら左から右へ描画
 +
        //上位 5bit 1なら上から下へ描画
 +
        //上位 6~7bit 未使用 通常は00で固定
 +
         header.descriptor = 0x20; // = 0b0010 0000 1byte
  
 
         file.write((const char*)&header, sizeof(TGAHeader));
 
         file.write((const char*)&header, sizeof(TGAHeader));

2022年8月20日 (土) 00:00時点における版



個人用ツール
名前空間

変種
操作
案内
ツールボックス