menu

Banyak file untuk membuat penyangga dari float

ifstream :: Ukuran pos_typ untuk;
char * memblock;

File ifstream (“mrı_brain_shade.b ini”, ios :: in | ios :: binary | ios :: makanan);
jika (file.is_op di ()) {/>) (/>
ukuran = file.tellg file.seekg ( 0, ios :: Bega); /> file.read (memblock, ukuran) file.close (); /> dwsizeres DWORD = ukuran
nm int; // Nmax
nilai minimum untuk int;
// />
memblock + = 4; // Kedua

elemen max ditetapkan sebagai memcpy (& amp; amp; amp; Nmax, memblock, 4); di
memblock + = 4;
nsizewithouthead nilai sisa // int = dwsizeres – 8;
karakter unsigned char * = unsigned puclut baru [nsizewithouthead adalah];
// (+ 1024 5120) * 4 = 24.576
mengapung * pfrgbalut = mengapung baru [24576]; // RGBA * (- 1024:. 5119)
memcpy (puclut, memblock adalah nsizewithouthead);
ucrgb unsigned char [3];
falph = 0 mengapung;

0, setiap elemen // menyalin tabel warna dan

(& amp; amp; amp; ucrgb & amp; amp; amp; puclut [i], (3 * sizeof (unsigned char)));
i + = 3;
memcpy (& amp; amp; amp; falph A & amp; amp; amp; puclut [i], sizeof (float));
i + = 4;
pfrgbalut [j ++] = ucrgb [0] / 255.0f;
pfrgbalut [j ++] = ucrgb [1] / 255.0f;
pfrgbalut [j ++] = ucrgb [2] / f 255,0;
pfrgbalut [j ++] = falph untuk; }

Leave a Reply

Your email address will not be published. Required fields are marked *