Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Framing Tool #7253

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions rtdata/languages/default
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,24 @@ HISTORY_MSG_1147;Local - Jz BlackEv WhiteEv
HISTORY_MSG_1148;Local - Jz Sigmoid
HISTORY_MSG_1149;Local - Q Sigmoid
HISTORY_MSG_1150;Local - Log encoding Q instead Sigmoid Q
HISTORY_MSG_1151;Framing
HISTORY_MSG_1152;Framing - Method
HISTORY_MSG_1153;Framing - Aspect Ratio
HISTORY_MSG_1154;Framing - Orientation
HISTORY_MSG_1155;Framing - Framed Width
HISTORY_MSG_1156;Framing - Framed Height
HISTORY_MSG_1157;Framing - Upscaling
HISTORY_MSG_1158;Framing - Border Sizing Method
HISTORY_MSG_1159;Framing - Basis
HISTORY_MSG_1160;Framing - Relative Size
HISTORY_MSG_1161;Framing - Min Size
HISTORY_MSG_1162;Framing - Min Width
HISTORY_MSG_1163;Framing - Min Height
HISTORY_MSG_1164;Framing - Border Width
HISTORY_MSG_1165;Framing - Border Height
HISTORY_MSG_1166;Framing - Border (R)
HISTORY_MSG_1167;Framing - Border (G)
HISTORY_MSG_1168;Framing - Border (B)
HISTORY_MSG_BLSHAPE;Blur by level
HISTORY_MSG_BLURCWAV;Blur chroma
HISTORY_MSG_BLURWAV;Blur luminance
Expand Down Expand Up @@ -1587,8 +1605,8 @@ HISTORY_MSG_TONE_EQUALIZER_ENABLED;Tone equalizer
HISTORY_MSG_TONE_EQUALIZER_PIVOT;Tone equalizer - Pivot
HISTORY_MSG_TONE_EQUALIZER_REGULARIZATION;Tone equalizer - Regularization
HISTORY_MSG_TONE_EQUALIZER_SHOW_COLOR_MAP;Tone equalizer - Tonal map
HISTORY_MSG_TRANS_SCALE;Geometry - Scale
HISTORY_MSG_TRANS_METHOD;Geometry - Method
HISTORY_MSG_TRANS_SCALE;Geometry - Scale
HISTORY_MSG_WAVBALCHROM;Equalizer chrominance
HISTORY_MSG_WAVBALLUM;Equalizer luminance
HISTORY_MSG_WAVBL;Blur levels
Expand Down Expand Up @@ -1864,6 +1882,7 @@ PARTIALPASTE_FLATFIELDBLURTYPE;Flat-field blur type
PARTIALPASTE_FLATFIELDCLIPCONTROL;Flat-field clip control
PARTIALPASTE_FLATFIELDFILE;Flat-field file
PARTIALPASTE_FLATFIELDFROMMETADATA;Flat-field from Metadata
PARTIALPASTE_FRAMING;Framing
PARTIALPASTE_GRADIENT;Graduated filter
PARTIALPASTE_HSVEQUALIZER;HSV equalizer
PARTIALPASTE_ICMSETTINGS;Color management settings
Expand Down Expand Up @@ -2709,6 +2728,36 @@ TP_FLATFIELD_CLIPCONTROL;Clip control
TP_FLATFIELD_CLIPCONTROL_TOOLTIP;Clip control avoids clipped highlights caused by applying the flat field. If there are already clipped highlights before applying the flat field, value 0 is used.
TP_FLATFIELD_FROMMETADATA;From Metadata
TP_FLATFIELD_LABEL;Flat-Field
TP_FRAMING_ABSOLUTE_HEIGHT;Border Height
TP_FRAMING_ABSOLUTE_WIDTH;Border Width
TP_FRAMING_ALLOW_UPSCALING;Allow upscaling to frame
TP_FRAMING_ASPECT_RATIO;Aspect Ratio:
TP_FRAMING_BASIS;Basis
TP_FRAMING_BASIS_AUTO;Auto
TP_FRAMING_BASIS_HEIGHT;Height
TP_FRAMING_BASIS_LONG_SIDE;Long Edge
TP_FRAMING_BASIS_SHORT_SIDE;Short Edge
TP_FRAMING_BASIS_WIDTH;Width
TP_FRAMING_BLUE;Blue
TP_FRAMING_BORDER_COLOR;Border Color
TP_FRAMING_BORDER_SIZE;Size
TP_FRAMING_BORDER_SIZE_ABSOLUTE;Absolute
TP_FRAMING_BORDER_SIZE_METHOD;Sizing:
TP_FRAMING_BORDER_SIZE_RELATIVE;Relative
TP_FRAMING_BORDER_SIZE_UNIFORM_RELATIVE;Uniform Relative
TP_FRAMING_FRAMED_HEIGHT;Framed Height
TP_FRAMING_FRAMED_WIDTH;Framed Width
TP_FRAMING_GREEN;Green
TP_FRAMING_LABEL;Framing
TP_FRAMING_LIMIT_MINIMUM;Limit minimum size
TP_FRAMING_METHOD;Method:
TP_FRAMING_METHOD_BBOX;Bounding Box
TP_FRAMING_METHOD_FIXED;Fixed Frame
TP_FRAMING_METHOD_STANDARD;Standard
TP_FRAMING_MIN_HEIGHT;Minimum Height
TP_FRAMING_MIN_WIDTH;Minimum Width
TP_FRAMING_ORIENTATION;Orientation:
TP_FRAMING_RED;Red
TP_GENERAL_11SCALE_TOOLTIP;The effects of this tool are only visible or only accurate at a preview scale of 1:1.
TP_GRADIENT_CENTER;Center
TP_GRADIENT_CENTER_X;Center X
Expand Down Expand Up @@ -2876,11 +2925,11 @@ TP_LABCURVE_LCREDSK_TOOLTIP;If enabled, the LC Curve affects only red and skin-t
TP_LABCURVE_RSTPROTECTION;Red and skin-tones protection
TP_LABCURVE_RSTPRO_TOOLTIP;Works on the Chromaticity slider and the CC curve.
TP_LENSGEOM_AUTOCROP;Auto-Crop
TP_LENSGEOM_SCALE;Scale
TP_LENSGEOM_FILL;Auto-fill
TP_LENSGEOM_LABEL;Lens / Geometry
TP_LENSGEOM_LIN;Linear
TP_LENSGEOM_LOG;Logarithmic
TP_LENSGEOM_SCALE;Scale
TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
TP_LENSPROFILE_CORRECTION_LCPFILE;LCP file
TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected
Expand Down Expand Up @@ -3908,7 +3957,7 @@ TP_RESIZE_FITBOX;Bounding Box
TP_RESIZE_FULLIMAGE;Full Image
TP_RESIZE_H;Height:
TP_RESIZE_HEIGHT;Height
TP_RESIZE_LABEL;Resize
TP_RESIZE_LABEL;Resize & Framing
TP_RESIZE_LANCZOS;Lanczos
TP_RESIZE_LE;Long Edge:
TP_RESIZE_LONG;Long Edge
Expand Down
23 changes: 22 additions & 1 deletion rtengine/improcfun.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,33 @@ enum class BlurType {
void sharpening(LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask = false);
void sharpeningcam(CieImage* ncie, float** buffer, bool showMask = false);
void transform(Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const FramesMetaData *metadata, int rawRotationDeg, bool fullImage, bool useOriginalBuffer = false);
float resizeScale(const procparams::ProcParams* params, int fw, int fh, int &imw, int &imh);
void lab2monitorRgb(LabImage* lab, Image8* image);

double resizeScale(const procparams::ProcParams* params, int fw, int fh, int &imw, int &imh);
void resize(Imagefloat* src, Imagefloat* dst, float dScale);
void Lanczos(const LabImage* src, LabImage* dst, float scale);
void Lanczos(const Imagefloat* src, Imagefloat* dst, float scale);

struct FramingArgs {
const procparams::ProcParams* params = nullptr;
int cropWidth = 0;
int cropHeight = 0;
int resizeWidth = 0;
int resizeHeight = 0;
double resizeScale = 1.0f;
};
struct FramingData {
bool enabled = false;
int imgWidth = 0;
int imgHeight = 0;
double scale = 1.0;
int framedWidth = 0;
int framedHeight = 0;
};
FramingData framing(const FramingArgs& args) const;
Imagefloat* drawFrame(Imagefloat* rgb, const procparams::FramingParams& params,
const FramingData& dims) const;

void deconvsharpening(float** luminance, float** buffer, const float* const * blend, int W, int H, const procparams::SharpeningParams &sharpenParam, double Scale);
void deconvsharpeningloc(float** luminance, float** buffer, int W, int H, float** loctemp, int damp, double radi, int ite, int amo, int contrast, double blurrad, int sk);

Expand Down
Loading
Loading