if(nRows - 0 || nCols - 0) return:

glCopyPixelsCx, у. width. height,GL_C0L0R):

}
//«««««««««< draw »»»»»»>»»
void drawO
{
// draw this pix map at current raster position

// рисуем зту пиксельную карту в текущей растровой позиции

if(nRows - 0 || nCols - 0) return: // tell OpenGL: don't align pixels with 4-byte // boundaries in memory // указываем OpenGL не выравнивать пикселы // по 4-битовым границам в памяти

glPixelStorei(GL_UNPACK_ALIGNMENT.1);
glDrawPixelsCnCols. nRows.GL_RGB. GL_UNSIGNEO_BYTE.pixel):
}
//«««<««««« read »»»»»»»» int readCint x. int y. int wid. int ht)
// read a rectangle of pixels into this plxmap

// читаем прямоугольник из пикселов в данную пиксельную карту

nRows - ht:
nCols - wid:

pixel - new mRGB[nRows *nCols]: if(lpixel) return -1; // tell OpenGL: don't align pixels with // 4-byte boundaries in memory // указываем OpenGL не выравнивать пикселы // по 4-битовым границам в памяти

glPixelStorei(GL_PACK_ALIGNMENT.1);

glReadPixelsCx. у. nCols. nRows. GL_RGB.GL_UNSIGNED_BYTE.pixel): return 0; }

//««««««««< read from IntRect »»»»»»»»
int read(IntRect r)
{

// read a rectangle of pixels into this pix map // читаем прямоугольник пикселов в зту пиксельную карту nRows - г.top - r.bott:

В2, RGBPixmaE CLASS
nCols - r.right - r.left:

pixel - new mRGB[nRows *nCols]: if(lpixel) return -1; // tell OpenGL: don't align pixels with // 4-byte boundaries in memory // указываем OpenGL не выравнивать пикселы // no 4-битовым границам в памяти

glPixelStorei(GL_PACK_ALIGNMENT.1):
glReadPixels(r.left.r.bott. nCols. nRows. GL_RGB. GL_UNSIGNED_BYTE. pixel):
return 0:
}
//««««««« setPixel »»»»»»> void setPixel(int x. int y. mRGB color) {

⇐ Предыдущая| |Следующая ⇒