mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Changed RgbImage to template based Image (with template for pixel type)
Former-commit-id: ef02f164eaf3c2f9dd552c1c17b525cf6eed499c
This commit is contained in:
@@ -22,19 +22,20 @@ int main()
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
DispmanxFrameGrabber frameGrabber(64, 64);
|
||||
frameGrabber.setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL);
|
||||
|
||||
unsigned iFrame = 0;
|
||||
QImage qImage(64, 64, QImage::Format_RGB888);
|
||||
RgbImage rgbImage(64, 64);
|
||||
QImage qImage(64, 64, QImage::Format_ARGB32);
|
||||
Image<ColorRgba> imageRgba(64, 64);
|
||||
|
||||
while(running)
|
||||
{
|
||||
frameGrabber.grabFrame(rgbImage);
|
||||
frameGrabber.grabFrame(imageRgba);
|
||||
|
||||
for (int iScanline=0; iScanline<qImage.height(); ++iScanline)
|
||||
{
|
||||
unsigned char* scanLinePtr = qImage.scanLine(iScanline);
|
||||
memcpy(scanLinePtr, rgbImage.memptr()+rgbImage.width()*iScanline, rgbImage.width()*sizeof(RgbColor));
|
||||
memcpy(scanLinePtr, imageRgba.memptr()+imageRgba.width()*iScanline, imageRgba.width()*sizeof(ColorRgba));
|
||||
}
|
||||
|
||||
qImage.save(QString("HYPERION_%3.png").arg(iFrame));
|
||||
|
Reference in New Issue
Block a user