mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
Automated Release Preparation
This commit is contained in:
@@ -125,7 +125,7 @@ void IntelliPhotoGui::slotCreateNewShapedLayer(){
|
||||
// Create New Layer
|
||||
if (ok1&&ok2) {
|
||||
paintingArea->addLayer(width, height, 0, 0,255, ImageType::SHAPEDIMAGE);
|
||||
paintingArea->historyadd();
|
||||
paintingArea->historyadd();
|
||||
UpdateGui();
|
||||
}
|
||||
}
|
||||
@@ -315,8 +315,8 @@ void IntelliPhotoGui::slotCreateGradientTool(){
|
||||
// Open an about dialog
|
||||
void IntelliPhotoGui::slotAboutDialog(){
|
||||
// Window title and text to display
|
||||
QMessageBox::about(this, tr("About Us"),
|
||||
tr("<h1>About IntelliPhoto</h1><p>Version: v1.0<br>Developed by: Team 7<br>Interactive painting tool with layering and drawing capabilities.</p>"));
|
||||
QMessageBox::about(this, tr("About Us"),
|
||||
tr("<h1>About IntelliPhoto</h1><p>Version: v1.0<br>Developed by: Team 7<br>Interactive painting tool with layering and drawing capabilities.</p>"));
|
||||
}
|
||||
|
||||
void IntelliPhotoGui::slotEnterPressed(){
|
||||
@@ -856,7 +856,7 @@ void IntelliPhotoGui::createGui(){
|
||||
|
||||
void IntelliPhotoGui::setIntelliStyle(){
|
||||
// Set the title
|
||||
setWindowTitle("IntelliPhoto v1.0");
|
||||
setWindowTitle("IntelliPhoto v1.0");
|
||||
// Set style sheet
|
||||
this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ IntelliRasterImage::IntelliRasterImage(int width, int height, bool fastRendererO
|
||||
}
|
||||
|
||||
|
||||
|
||||
IntelliRasterImage::~IntelliRasterImage(){
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
IntelliShapedImage::IntelliShapedImage(int width, int height, bool fastRendererOn)
|
||||
: IntelliRasterImage(width, height, fastRendererOn){
|
||||
: IntelliRasterImage(width, height, fastRendererOn){
|
||||
TypeOfImage = ImageType::SHAPEDIMAGE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef INTELLIDATAMANAGER_H
|
||||
#ifndef INTELLIDATAMANAGER_H
|
||||
#define INTELLIDATAMANAGER_H
|
||||
|
||||
#include <QFile>
|
||||
|
||||
@@ -26,9 +26,9 @@ LayerObject::LayerObject(){
|
||||
|
||||
LayerObject::LayerObject(const LayerObject& layer){
|
||||
if(layer.image->getTypeOfImage()==ImageType::RASTERIMAGE) {
|
||||
this->image = new IntelliRasterImage(*dynamic_cast<IntelliRasterImage*>(layer.image));
|
||||
this->image = new IntelliRasterImage(*dynamic_cast<IntelliRasterImage*>(layer.image));
|
||||
}else if(layer.image->getTypeOfImage()==ImageType::SHAPEDIMAGE) {
|
||||
this->image = new IntelliShapedImage(*dynamic_cast<IntelliShapedImage*>(layer.image));
|
||||
this->image = new IntelliShapedImage(*dynamic_cast<IntelliShapedImage*>(layer.image));
|
||||
}
|
||||
this->width = layer.width;
|
||||
this->height = layer.height;
|
||||
@@ -130,7 +130,7 @@ void PaintingArea::slotDeleteActiveLayer(){
|
||||
this->layerBundle.erase(layerBundle.begin() + activeLayer);
|
||||
activeLayer--;
|
||||
}
|
||||
historyadd();
|
||||
historyadd();
|
||||
}
|
||||
|
||||
void PaintingArea::setLayerActive(int idx){
|
||||
@@ -205,7 +205,7 @@ void PaintingArea::movePositionActive(int x, int y){
|
||||
updateTools();
|
||||
layerBundle[static_cast<size_t>(activeLayer)].widthOffset += x;
|
||||
layerBundle[static_cast<size_t>(activeLayer)].heightOffset += y;
|
||||
historyadd();
|
||||
historyadd();
|
||||
}
|
||||
|
||||
void PaintingArea::moveActiveLayer(int idx){
|
||||
@@ -216,7 +216,7 @@ void PaintingArea::moveActiveLayer(int idx){
|
||||
this->selectLayerDown();
|
||||
}
|
||||
guiReference->UpdateGui();
|
||||
historyadd();
|
||||
historyadd();
|
||||
}
|
||||
|
||||
void PaintingArea::slotActivateLayer(int a){
|
||||
@@ -509,25 +509,25 @@ void PaintingArea::updateTools(){
|
||||
|
||||
void PaintingArea::historyadd(){
|
||||
|
||||
history.erase(history.begin()+historyPresent+1,history.end());
|
||||
historyPresent++;
|
||||
history.push_back(layerBundle);
|
||||
history.erase(history.begin() + historyPresent + 1,history.end());
|
||||
historyPresent++;
|
||||
history.push_back(layerBundle);
|
||||
}
|
||||
|
||||
void PaintingArea::historyGoBack(){
|
||||
historyPresent--;
|
||||
if( historyPresent<0){
|
||||
historyPresent=0;
|
||||
}
|
||||
layerBundle = history[static_cast<size_t>(historyPresent)];
|
||||
this->guiReference->UpdateGui();
|
||||
historyPresent--;
|
||||
if( historyPresent<0) {
|
||||
historyPresent = 0;
|
||||
}
|
||||
layerBundle = history[static_cast<size_t>(historyPresent)];
|
||||
this->guiReference->UpdateGui();
|
||||
}
|
||||
|
||||
void PaintingArea::historyGoForward(){
|
||||
historyPresent++;
|
||||
if(historyPresent>=static_cast<int>(history.size())){
|
||||
historyPresent=history.size()-1;
|
||||
}
|
||||
layerBundle = history[static_cast<size_t>(historyPresent)];
|
||||
historyPresent++;
|
||||
if(historyPresent>=static_cast<int>(history.size())) {
|
||||
historyPresent = history.size() - 1;
|
||||
}
|
||||
layerBundle = history[static_cast<size_t>(historyPresent)];
|
||||
this->guiReference->UpdateGui();
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ void updateTools();
|
||||
/*!
|
||||
* \brief history - an array out of containers to save history actions.
|
||||
*/
|
||||
std::vector<std::vector<LayerObject>> history = {layerBundle};
|
||||
std::vector<std::vector<LayerObject> > history = {layerBundle};
|
||||
|
||||
/*!
|
||||
* \brief historyPresent a indicator where the present is.
|
||||
|
||||
@@ -40,7 +40,7 @@ void IntelliTool::onMouseLeftReleased(int x, int y){
|
||||
this->mergeToolLayer();
|
||||
this->deleteToolLayer();
|
||||
activeLayer->image->calculateVisiblity();
|
||||
Area->historyadd();
|
||||
Area->historyadd();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,10 +83,10 @@ void IntelliToolGradient::computeAndDrawPixelColor(QPoint Point, int FirstColor[
|
||||
computedColor = colorPicker->getSecondColor();
|
||||
}
|
||||
else{
|
||||
computedColor.setRed(static_cast<int>(ratio * SecondColor[0] + (1 - ratio) * FirstColor[0]));
|
||||
computedColor.setGreen(static_cast<int>(ratio * SecondColor[1] + (1 - ratio) * FirstColor[1]));
|
||||
computedColor.setBlue(static_cast<int>(ratio * SecondColor[2] + (1 - ratio) * FirstColor[2]));
|
||||
computedColor.setAlpha(static_cast<int>(ratio * SecondColor[3] + (1 - ratio) * FirstColor[3]));
|
||||
computedColor.setRed(static_cast<int>(ratio * SecondColor[0] + (1 - ratio) * FirstColor[0]));
|
||||
computedColor.setGreen(static_cast<int>(ratio * SecondColor[1] + (1 - ratio) * FirstColor[1]));
|
||||
computedColor.setBlue(static_cast<int>(ratio * SecondColor[2] + (1 - ratio) * FirstColor[2]));
|
||||
computedColor.setAlpha(static_cast<int>(ratio * SecondColor[3] + (1 - ratio) * FirstColor[3]));
|
||||
}
|
||||
Canvas->image->drawPixel(Point,computedColor);
|
||||
}
|
||||
@@ -100,23 +100,23 @@ double IntelliToolGradient::lenghtVector(double Vector[2]){
|
||||
}
|
||||
|
||||
void IntelliToolGradient::computeGradientLayer(){
|
||||
int FirstColor[4];
|
||||
colorPicker->getFirstColor().getRgb(&FirstColor[0],&FirstColor[1],&FirstColor[2],&FirstColor[3]);
|
||||
int SecondColor[4];
|
||||
colorPicker->getSecondColor().getRgb(&SecondColor[0],&SecondColor[1],&SecondColor[2],&SecondColor[3]);
|
||||
int FirstColor[4];
|
||||
colorPicker->getFirstColor().getRgb(&FirstColor[0],&FirstColor[1],&FirstColor[2],&FirstColor[3]);
|
||||
int SecondColor[4];
|
||||
colorPicker->getSecondColor().getRgb(&SecondColor[0],&SecondColor[1],&SecondColor[2],&SecondColor[3]);
|
||||
|
||||
double NormalVector[2];
|
||||
double NormalDotNormal;
|
||||
double NormalVector[2];
|
||||
double NormalDotNormal;
|
||||
|
||||
VectorStartEnd[0] = static_cast<double>(endPoint.x() - startPoint.x());
|
||||
VectorStartEnd[1] = static_cast<double>(endPoint.y() - startPoint.y());
|
||||
NormalVector[0] = VectorStartEnd[1];
|
||||
NormalVector[1] = (-1 * VectorStartEnd[0]);
|
||||
NormalDotNormal = dotProduct(NormalVector,NormalVector);
|
||||
VectorStartEnd[0] = static_cast<double>(endPoint.x() - startPoint.x());
|
||||
VectorStartEnd[1] = static_cast<double>(endPoint.y() - startPoint.y());
|
||||
NormalVector[0] = VectorStartEnd[1];
|
||||
NormalVector[1] = (-1 * VectorStartEnd[0]);
|
||||
NormalDotNormal = dotProduct(NormalVector,NormalVector);
|
||||
|
||||
for(int i = 0; i < activeLayer->height; i++) {
|
||||
for(int i = 0; i < activeLayer->height; i++) {
|
||||
for(int j = 0; j < activeLayer->width; j++) {
|
||||
computeAndDrawPixelColor(QPoint(j,i), FirstColor, SecondColor, NormalVector, NormalDotNormal);
|
||||
computeAndDrawPixelColor(QPoint(j,i), FirstColor, SecondColor, NormalVector, NormalDotNormal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user