Add a 'Stamp' widget.
Place one or multiple stamps on scanned pages in defined locations. A stamp is understood here as - a transparent text in a transparent frame with no borders - an opaque text on an opaque background with no borders. Stamp parameters: - text - font - foreground colour - background colour - angle of rotation - transparency. Locations: - centre - cardinal directions - inter-cardinal directions.
This commit is contained in:
@@ -8,14 +8,17 @@
|
||||
// */
|
||||
|
||||
#include "PixelToImageWriter.h"
|
||||
#include <Common.h>
|
||||
#include <StampWorker.h>
|
||||
#include <fstream>
|
||||
#include <DefsInsaneWidget.h>
|
||||
#include <DefsStampWidget.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
bool PixelToImageWriter::Convert(const std::string& pixelFilePath,
|
||||
int imageWidth, int imageHeight,
|
||||
int outputFormat, wxImage * image)
|
||||
int imageWidth, int imageHeight,
|
||||
std::vector<StampDescriptor*> * descriptors,
|
||||
int outputFormat, wxImage * image)
|
||||
{
|
||||
UpdateExtensionsMap();
|
||||
wxImage * outImage = image;
|
||||
@@ -35,6 +38,16 @@ bool PixelToImageWriter::Convert(const std::string& pixelFilePath,
|
||||
raw.assign(istreambuf_iterator<char>(ifs), istreambuf_iterator<char>());
|
||||
|
||||
outImage->SetData((unsigned char*) raw.data(), imageWidth, imageHeight, true); // true +++
|
||||
if (descriptors)
|
||||
{
|
||||
for (StampDescriptor * descriptor : *descriptors)
|
||||
{
|
||||
if (descriptor)
|
||||
{
|
||||
StampWorker::StampBackground(*outImage, descriptor->image, descriptor->location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (outputFormat)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user