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:
38
Resources/StampWidget/StampWorker.h
Normal file
38
Resources/StampWidget/StampWorker.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// /*
|
||||
// * File: StampWorker.h
|
||||
// * Author: Saleem Edah-Tally - nmset@yandex.com
|
||||
// * License : CeCILL-C
|
||||
// * Copyright Saleem Edah-Tally - © 2025
|
||||
// *
|
||||
// * Created on 02 07 2025, 21:23
|
||||
// */
|
||||
|
||||
#ifndef STAMPWORKER_H
|
||||
#define STAMPWORKER_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "DefsStampWidget.h"
|
||||
|
||||
struct StampDescriptor;
|
||||
|
||||
/**
|
||||
* A stamp is understood here as\n
|
||||
* - a transparent text in a transparent frame with no borders\n
|
||||
* - an opaque text on an opaque background with no borders.\n
|
||||
*
|
||||
* The text may be rotated. Actually, an initial image with the text is rotated
|
||||
* and its new orthogonal bounds accepted (fortunately, we don't have to compute
|
||||
* that).\n
|
||||
* The font point size is rescaled to match the scan resolution. If the
|
||||
* scanResolution parameter is invalid (<=0), the font is not rescaled.
|
||||
*/
|
||||
class StampWorker
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS( StampWorker )
|
||||
public:
|
||||
static wxImage CreateStamp(StampDescriptor * descriptor, int scanResolution = -1);
|
||||
static void StampBackground(wxImage& background, const wxImage& stamp, int location = CENTRE);
|
||||
|
||||
};
|
||||
|
||||
#endif // STAMPWORKER_H
|
||||
Reference in New Issue
Block a user