void SpotItemFace::initBlack(uint16 width, uint16 height) { if (_bitmap) { _bitmap->free(); } _bitmap = new Graphics::Surface(); _bitmap->create(width, height, Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)); initNotDrawn(width, height); _drawn = false; }
void SpotItemFace::loadData(Graphics::JPEGDecoder *jpeg) { // Convert active SpotItem image to raw data _bitmap = new Graphics::Surface(); _bitmap->create(jpeg->getComponent(1)->w, jpeg->getComponent(1)->h, Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)); for (int i = 0; i < _bitmap->h; i++) { byte *y = (byte *)jpeg->getComponent(1)->getBasePtr(0, i); byte *u = (byte *)jpeg->getComponent(2)->getBasePtr(0, i); byte *v = (byte *)jpeg->getComponent(3)->getBasePtr(0, i); byte *ptr = (byte *)_bitmap->getBasePtr(0, i); for (int j = 0; j < _bitmap->w; j++) { byte r, g, b; Graphics::YUV2RGB(*y++, *u++, *v++, r, g, b); *ptr++ = r; *ptr++ = g; *ptr++ = b; } } initNotDrawn(_bitmap->w, _bitmap->h); }
void SpotItemFace::initBlack(uint16 width, uint16 height) { _bitmap = new Graphics::Surface(); _bitmap->create(width, height, Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)); initNotDrawn(width, height); }
void SpotItemFace::loadData(const DirectorySubEntry *jpegDesc) { // Convert active SpotItem image to raw data _bitmap = Myst3Engine::decodeJpeg(jpegDesc); initNotDrawn(_bitmap->w, _bitmap->h); }