1 / 11

練習問題の答え

練習問題の答え. 変数の型と初期値 unsigned char A = 3; (16 進  0x03, 2 進  0000 0011) unsigned char B = 65; (16 進  0x41, 2 進  0100 0001) char C = -4; (16 進  0xFC, 2 進  1111 1100) char D = 0;. 練習問題の答え. 変数の型と初期値

lara
Télécharger la présentation

練習問題の答え

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 練習問題の答え 変数の型と初期値 unsignedchar A = 3; (16進 0x03, 2進 0000 0011)unsignedchar B = 65; (16進 0x41, 2進 0100 0001)char C = -4; (16進 0xFC, 2進 1111 1100)char D = 0;

  2. 練習問題の答え 変数の型と初期値 unsignedchar A = 3; (16進 0x03, 2進 0000 0011)unsignedchar B = 65; (16進 0x41, 2進 0100 0001)char C = -4; (16進 0xFC, 2進 1111 1100)char D = 0;

  3. 練習問題の答え

  4. 練習問題の答え

  5. 練習問題の答え

  6. 練習問題の答え

  7. 画像バッファの様子 → i pImage ↓ j xsize 256 ysize 192 255 level pImage->pBuffer[0][0] pBuffer → i ↓ j ysize個 pImage->pBuffer[j][i] pImage->pBuffer[j] xsize個

  8. 画像の90度回転 ipRotateImage [0][ysize –1] [0][0] → i ↓ j xsize個 ysize個 xsize個 ysize個 関数内で作業用の画像バッファメモリを確保し, 順に画素を埋めていけばよい. iioMallocImageBuffer iioFreeImageBuffer

  9. 画素のビットマスク ipBitMask pImage->pBuffer[0][0] → i ↓ j 1画素ずつ処理していく 1画素はR,G,Bから成る構造体で表現している → R,G,Bのそれぞれに対して処理を行う

  10. 画素のビットマスク ipBitMask 2進表現で 1100 0000 pImage->pBuffer[j][i].r &= 0xC0; pImage->pBuffer[j][i].g &= 0xC0; pImage->pBuffer[j][i].b &= 0xC0; 下位6ビットが0なのでビットごとのAND演算をすると,下位6ビットが0にマスクされる. R 64  01000000 G 128 10000000 B 64  01000000 R 100 01100100 G 150 10010110 B 125 01111101 0xC0との &演算

  11. 画素のビットマスク ipBitMask pImage->pBuffer[j][i].r &= 0xC0; pImage->pBuffer[j][i].g &= 0xC0; pImage->pBuffer[j][i].b &= 0xC0; サンプルプログラム3: 各画素の下位”6”ビットを0でマスク→0xC0との&演算 演習課題: 各画素の下位”4”ビットを0でマスク →何を使えばよいか?

More Related