Hi
I'm trying to take a portion of a hardware pixel buffer, but all I get are scanlines... I wonder why
here is my attempt
int min_x = 0;
int min_y = 0;
int max_x = 0;
int max_y = 0;
Core::Resolution screenRes = Core::EnvironmentInformation::getSingleton()->getScreenResolution();
float screenPositionX = (screenPosition.x / screenRes.width) * (pixelBuffer->getWidth());
float screenPositionY = (screenPosition.y / screenRes.height) * (pixelBuffer->getHeight());
min_x = std::max( 0, (int) screenPositionX - radius );
min_y = std::max( 0, (int) screenPositionY - radius);
max_x = std::min( (int)512, (int) screenPositionX + radius );
max_y = std::min( (int)1024, (int) screenPositionY + radius );
// Get the pixelbox within the radius.
Ogre::PixelBox pixelBoxTexture = pixelBuffer->lock(Ogre::Image::Box(min_x, min_y, 0,
max_x,
max_y, 1), Ogre::HardwareBuffer::HBL_READ_ONLY);
cropping a hardware pixel buffer
-
- Kobold
- Posts: 38
- Joined: Wed Dec 31, 2014 2:26 am
- x 2
-
- Kobold
- Posts: 38
- Joined: Wed Dec 31, 2014 2:26 am
- x 2
Re: cropping a hardware pixel buffer
please help
-
- Gnoblar
- Posts: 18
- Joined: Tue Oct 03, 2017 7:27 pm
- x 1
Re: cropping a hardware pixel buffer
I have a similar need. Did you ever resolve your issue?