Merge branch 'dev' into metadata-exiv2

This commit is contained in:
Lawrence Lee
2023-02-05 12:29:58 -08:00
278 changed files with 74278 additions and 13534 deletions

View File

@@ -22,7 +22,11 @@
#include "editbuffer.h"
#include "editcallbacks.h"
#include "rtsurface.h"
#include "../rtengine/rt_math.h"
const std::vector<double> Geometry::dash = {3., 1.5};
#define INNERGEOM_OPACITY 1.
#define OUTERGEOM_OPACITY 0.7
RGBColor Geometry::getInnerLineColor ()
{
@@ -67,7 +71,8 @@ RGBColor Geometry::getOuterLineColor ()
void Circle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
{
if ((flags & F_VISIBLE) && state != INSENSITIVE) {
double lineWidth = getOuterLineWidth();
if ((flags & F_VISIBLE) && state != INSENSITIVE && lineWidth > 0. && innerLineWidth > 0.) {
RGBColor color;
if (flags & F_AUTO_COLOR) {
@@ -76,8 +81,9 @@ void Circle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
color = outerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_line_width( getOuterLineWidth() );
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), OUTERGEOM_OPACITY * rtengine::min(innerLineWidth / 2.f, 1.f));
cr->set_line_width (lineWidth);
cr->set_line_cap(Cairo::LINE_CAP_ROUND);
rtengine::Coord center_ = center;
double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas(double(radius)) : double(radius);
@@ -107,10 +113,11 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
color = innerLineColor;
}
cr->set_source_rgba(color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), INNERGEOM_OPACITY);
}
cr->set_line_width( innerLineWidth );
cr->set_line_width(innerLineWidth);
cr->set_line_cap(flags & F_DASHED ? Cairo::LINE_CAP_BUTT : Cairo::LINE_CAP_ROUND);
rtengine::Coord center_ = center;
double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas(double(radius)) : double(radius);
@@ -123,9 +130,12 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
center_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
}
if (filled && state != INSENSITIVE) {
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI);
if (flags & F_DASHED) {
cr->set_dash(dash, 0.);
}
if (filled) {
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI);
if (innerLineWidth > 0.f) {
cr->fill_preserve();
cr->stroke();
@@ -134,28 +144,20 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
}
} else if (innerLineWidth > 0.f) {
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI);
if (state == INSENSITIVE) {
std::valarray<double> ds(1);
ds[0] = 4;
cr->set_source_rgba(1.0, 1.0, 1.0, 0.618);
cr->stroke_preserve();
cr->set_source_rgba(0.0, 0.0, 0.0, 0.618);
cr->set_dash(ds, 0);
cr->stroke();
ds.resize(0);
cr->set_dash(ds, 0);
} else {
cr->stroke();
}
cr->stroke();
}
}
if (flags & F_DASHED) {
cr->unset_dash();
}
}
}
void Circle::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
{
if (flags & F_HOVERABLE) {
cr->set_line_width( getMouseOverLineWidth() );
cr->set_line_cap(Cairo::LINE_CAP_ROUND);
rtengine::Coord center_ = center;
double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas(double(radius)) : double(radius);
@@ -190,7 +192,8 @@ void Circle::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short
void Line::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
{
if ((flags & F_VISIBLE) && state != INSENSITIVE) {
double lineWidth = getOuterLineWidth();
if ((flags & F_VISIBLE) && state != INSENSITIVE && lineWidth > 0. && innerLineWidth > 0.) {
RGBColor color;
if (flags & F_AUTO_COLOR) {
@@ -199,8 +202,9 @@ void Line::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
color = outerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.0);
cr->set_line_width( getOuterLineWidth() );
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), OUTERGEOM_OPACITY * rtengine::min(innerLineWidth / 2.f, 1.f));
cr->set_line_width (lineWidth);
cr->set_line_cap(Cairo::LINE_CAP_ROUND);
rtengine::Coord begin_ = begin;
rtengine::Coord end_ = end;
@@ -234,10 +238,11 @@ void Line::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
color = innerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), INNERGEOM_OPACITY);
}
cr->set_line_width(innerLineWidth);
cr->set_line_cap(flags & F_DASHED ? Cairo::LINE_CAP_BUTT : Cairo::LINE_CAP_ROUND);
rtengine::Coord begin_ = begin;
rtengine::Coord end_ = end;
@@ -253,21 +258,16 @@ void Line::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
end_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
}
if (flags & F_DASHED) {
cr->set_dash(dash, 0.);
}
cr->move_to(begin_.x + 0.5, begin_.y + 0.5);
cr->line_to(end_.x + 0.5, end_.y + 0.5);
cr->stroke();
if (state == INSENSITIVE) {
std::valarray<double> ds(1);
ds[0] = 4;
cr->set_source_rgba(1.0, 1.0, 1.0, 0.618);
cr->stroke_preserve();
cr->set_source_rgba(0.0, 0.0, 0.0, 0.618);
cr->set_dash(ds, 0);
cr->stroke();
ds.resize(0);
cr->set_dash(ds, 0);
} else {
cr->stroke();
if (flags & F_DASHED) {
cr->unset_dash();
}
}
}
@@ -276,6 +276,7 @@ void Line::drawToMOChannel(Cairo::RefPtr<Cairo::Context> &cr, unsigned short id,
{
if (flags & F_HOVERABLE) {
cr->set_line_width( getMouseOverLineWidth() );
cr->set_line_cap(Cairo::LINE_CAP_ROUND);
rtengine::Coord begin_ = begin;
rtengine::Coord end_ = end;
@@ -304,7 +305,8 @@ void Line::drawToMOChannel(Cairo::RefPtr<Cairo::Context> &cr, unsigned short id,
void Polyline::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
{
if ((flags & F_VISIBLE) && state != INSENSITIVE && points.size() > 1) {
double lineWidth = getOuterLineWidth();
if ((flags & F_VISIBLE) && state != INSENSITIVE && points.size() > 1 && lineWidth > 0.) {
RGBColor color;
if (flags & F_AUTO_COLOR) {
@@ -313,8 +315,10 @@ void Polyline::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
color = outerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_line_width( getOuterLineWidth() );
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), OUTERGEOM_OPACITY * rtengine::min(innerLineWidth / 2.f, 1.f));
cr->set_line_width (lineWidth);
cr->set_line_cap(Cairo::LINE_CAP_ROUND);
cr->set_line_join(Cairo::LINE_JOIN_ROUND);
rtengine::Coord currPos;
@@ -357,10 +361,16 @@ void Polyline::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
color = innerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), INNERGEOM_OPACITY);
}
cr->set_line_width( innerLineWidth );
cr->set_line_width(innerLineWidth);
cr->set_line_cap(flags & F_DASHED ? Cairo::LINE_CAP_BUTT : Cairo::LINE_CAP_ROUND);
cr->set_line_join(Cairo::LINE_JOIN_ROUND);
if (flags & F_DASHED) {
cr->set_dash(dash, 0.);
}
if (filled && state != INSENSITIVE) {
rtengine::Coord currPos;
@@ -409,20 +419,11 @@ void Polyline::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
cr->line_to(currPos.x + 0.5, currPos.y + 0.5);
}
}
cr->stroke();
}
if (state == INSENSITIVE) {
std::valarray<double> ds(1);
ds[0] = 4;
cr->set_source_rgba(1.0, 1.0, 1.0, 0.618);
cr->stroke_preserve();
cr->set_source_rgba(0.0, 0.0, 0.0, 0.618);
cr->set_dash(ds, 0);
cr->stroke();
ds.resize(0);
cr->set_dash(ds, 0);
} else {
cr->stroke();
}
if (flags & F_DASHED) {
cr->unset_dash();
}
}
}
@@ -439,8 +440,11 @@ void Polyline::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned shor
cr->set_source_rgba (0., 0., 0., (id + 1) / 65535.);
}
cr->set_line_width( getMouseOverLineWidth() );
cr->set_line_cap(Cairo::LINE_CAP_ROUND);
cr->set_line_join(Cairo::LINE_JOIN_ROUND);
for (unsigned int i = 0; i < points.size(); ++i) {
cr->set_line_width( getMouseOverLineWidth() );
currPos = points.at(i);
if (datum == IMAGE) {
@@ -497,7 +501,8 @@ void EditRectangle::setXYXY(rtengine::Coord topLeft, rtengine::Coord bottomRight
void EditRectangle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
{
if ((flags & F_VISIBLE) && state != INSENSITIVE) {
double lineWidth = getOuterLineWidth();
if ((flags & F_VISIBLE) && state != INSENSITIVE && lineWidth > 0. && innerLineWidth > 0.) {
RGBColor color;
if (flags & F_AUTO_COLOR) {
@@ -506,8 +511,9 @@ void EditRectangle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectM
color = outerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_line_width( getOuterLineWidth() );
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), OUTERGEOM_OPACITY * rtengine::min(innerLineWidth / 2.f, 1.f));
cr->set_line_width (lineWidth);
cr->set_line_join(Cairo::LINE_JOIN_BEVEL);
rtengine::Coord tl, br;
@@ -550,10 +556,11 @@ void EditRectangle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectM
color = innerLineColor;
}
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), INNERGEOM_OPACITY);
}
cr->set_line_width( innerLineWidth );
cr->set_line_width(innerLineWidth);
cr->set_line_join(Cairo::LINE_JOIN_BEVEL);
rtengine::Coord tl, br;
@@ -573,7 +580,11 @@ void EditRectangle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectM
br = bottomRight + objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
}
if (filled && state != INSENSITIVE) {
if (flags & F_DASHED) {
cr->set_dash(dash, 0.);
}
if (filled) {
cr->rectangle(tl.x + 0.5, tl.y + 0.5, br.x - tl.x, br.y - tl.y);
if (innerLineWidth > 0.f) {
@@ -584,20 +595,11 @@ void EditRectangle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectM
}
} else if (innerLineWidth > 0.f) {
cr->rectangle(tl.x + 0.5, tl.y + 0.5, br.x - tl.x, br.y - tl.y);
cr->stroke();
}
if (state == INSENSITIVE) {
std::valarray<double> ds(1);
ds[0] = 4;
cr->set_source_rgba(1.0, 1.0, 1.0, 0.618);
cr->stroke_preserve();
cr->set_source_rgba(0.0, 0.0, 0.0, 0.618);
cr->set_dash(ds, 0);
cr->stroke();
ds.resize(0);
cr->set_dash(ds, 0);
} else {
cr->stroke();
}
if (flags & F_DASHED) {
cr->unset_dash();
}
}
}
@@ -606,6 +608,7 @@ void EditRectangle::drawToMOChannel(Cairo::RefPtr<Cairo::Context> &cr, unsigned
{
if (flags & F_HOVERABLE) {
cr->set_line_width( getMouseOverLineWidth() );
cr->set_line_join(Cairo::LINE_JOIN_ROUND);
rtengine::Coord tl, br;