from EnergyCtrl import EnergyCtrl
from ClockDomain import SrcClockDomain
from SubSystem import SubSystem
+from Graphics import ImageFormat
# Platforms with KVM support should generally use in-kernel GIC
# emulation. Use a GIC model that automatically switches between
"selector order in some kernels")
workaround_dma_line_count = Param.Bool(True, "Workaround incorrect "
"DMA line count (off by 1)")
- enable_capture = Param.Bool(True, "capture frame to system.framebuffer.bmp")
+ enable_capture = Param.Bool(True, "capture frame to "
+ "system.framebuffer.{extension}")
+ frame_format = Param.ImageFormat("Auto",
+ "image format of the captured frame")
pixel_buffer_size = Param.MemorySize32("2kB", "Size of address range")
#include "debug/HDLcd.hh"
#include "dev/arm/amba_device.hh"
#include "dev/arm/base_gic.hh"
+#include "enums/ImageFormat.hh"
#include "mem/packet.hh"
#include "mem/packet_access.hh"
#include "params/HDLcd.hh"
virtRefreshEvent([this]{ virtRefresh(); }, name()),
// Other
- bmp(&pixelPump.fb), pic(NULL), conv(PixelConverter::rgba8888_le),
+ imgFormat(p->frame_format), pic(NULL), conv(PixelConverter::rgba8888_le),
pixelPump(*this, *p->pxl_clk, p->pixel_chunk)
{
if (vnc)
vnc->setFrameBuffer(&pixelPump.fb);
+
+ imgWriter = createImgWriter(imgFormat, &pixelPump.fb);
}
HDLcd::~HDLcd()
if (enableCapture) {
if (!pic) {
pic = simout.create(
- csprintf("%s.framebuffer.bmp", sys->name()),
+ csprintf("%s.framebuffer.%s",
+ sys->name(), imgWriter->getImgExtension()),
true);
}
assert(pic);
pic->stream()->seekp(0);
- bmp.write(*pic->stream());
+ imgWriter->write(*pic->stream());
}
}
#include <fstream>
#include <memory>
-#include "base/bmpwriter.hh"
#include "base/framebuffer.hh"
+#include "base/imgwriter.hh"
#include "base/output.hh"
#include "dev/arm/amba_device.hh"
#include "dev/pixelpump.hh"
EventFunctionWrapper virtRefreshEvent;
/** Helper to write out bitmaps */
- BmpWriter bmp;
+ std::unique_ptr<ImgWriter> imgWriter;
+
+ /** Image Format */
+ Enums::ImageFormat imgFormat;
/** Picture of what the current frame buffer looks like */
OutputStream *pic;