mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 18:18:56 +02:00
modules/media/magick: Add Xlib display gimmick for debugging.
This commit is contained in:
parent
5f5318c129
commit
c2dc298304
|
@ -12,6 +12,7 @@
|
|||
|
||||
namespace ircd::magick
|
||||
{
|
||||
struct display;
|
||||
struct transform;
|
||||
|
||||
static void handle_exception(const ::ExceptionType, const char *, const char *);
|
||||
|
@ -36,6 +37,12 @@ namespace ircd::magick
|
|||
extern log::log log;
|
||||
}
|
||||
|
||||
struct ircd::magick::display
|
||||
{
|
||||
display(const ::ImageInfo &, ::Image &);
|
||||
display(const const_buffer &);
|
||||
};
|
||||
|
||||
struct ircd::magick::transform
|
||||
{
|
||||
using input = std::tuple<const ::ImageInfo &, const ::Image *>;
|
||||
|
@ -281,6 +288,36 @@ ircd::magick::transform::transform(const const_buffer &input,
|
|||
output(result);
|
||||
}
|
||||
|
||||
//
|
||||
// display (internal)
|
||||
//
|
||||
|
||||
ircd::magick::display::display(const const_buffer &input)
|
||||
{
|
||||
const custom_ptr<::ImageInfo> input_info
|
||||
{
|
||||
::CloneImageInfo(nullptr),
|
||||
::DestroyImageInfo
|
||||
};
|
||||
|
||||
const custom_ptr<::Image> input_image
|
||||
{
|
||||
callex<::Image *>(::BlobToImage, input_info.get(), data(input), size(input)),
|
||||
::DestroyImage // pollock
|
||||
};
|
||||
|
||||
display
|
||||
{
|
||||
*input_info, *input_image
|
||||
};
|
||||
}
|
||||
|
||||
ircd::magick::display::display(const ::ImageInfo &info,
|
||||
::Image &image)
|
||||
{
|
||||
callpf(::DisplayImages, &info, &image);
|
||||
}
|
||||
|
||||
//
|
||||
// util (internal)
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue