20#ifndef BITMAP_IMPORT_PLUGIN_H
21#define BITMAP_IMPORT_PLUGIN_H
44 const wxString
GetName()
const override {
return "Bitmap image"; }
48 static std::vector<std::string> exts = {
"png",
"jpg",
"jpeg",
"bmp",
"gif" };
54 void ReportMsg(
const wxString& aMessage )
override;
56 bool Load(
const wxString& aFileName )
override;
Import a raster image by tracing its dark areas into filled polygons.
bool Load(const wxString &aFileName) override
Load file for import.
const wxString GetName() const override
Return the plugin name.
double GetImageWidth() const override
Return image width from original imported file.
void ReportMsg(const wxString &aMessage) override
void SetInvert(bool aInvert)
Invert the image before the threshold is applied.
double pixelSizeYmm() const
bool LoadFromMemory(const wxMemoryBuffer &aMemBuffer) override
Set memory buffer with content for import.
bool Import() override
Actually imports the file.
BOX2D GetImageBBox() const override
Return image bounding box from original imported file.
const wxImage & GetImage() const
The loaded image, so a caller showing a preview does not have to read the file again.
static constexpr int DEFAULT_DPI
Resolution assumed for images that do not carry one.
void SetThreshold(double aThreshold)
Brightness cut deciding which pixels are traced, from 0 to 1.
double GetImageHeight() const override
Return image height from original imported file.
static constexpr double DEFAULT_THRESHOLD
Used when the caller offers the user no threshold setting.
const std::vector< std::string > GetFileExtensions() const override
Return a vector of the file extensions handled by this plugin.
const wxString & GetMessages() const override
Collect warning and error messages after loading/importing.
double pixelSizeXmm() const
Interface for vector graphics import plugins.