mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 21:00:37 +02:00
Unified Index Variable Name
This commit is contained in:
@@ -71,10 +71,10 @@ int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOff
|
||||
}
|
||||
|
||||
|
||||
void PaintingArea::deleteLayer(int index){
|
||||
if(index<static_cast<int>(layerBundle.size())) {
|
||||
this->layerBundle.erase(layerBundle.begin()+index);
|
||||
if(activeLayer>=index && activeLayer != 0) {
|
||||
void PaintingArea::deleteLayer(int idx){
|
||||
if(idx<static_cast<int>(layerBundle.size())) {
|
||||
this->layerBundle.erase(layerBundle.begin()+idx);
|
||||
if(activeLayer>=idx && activeLayer != 0) {
|
||||
activeLayer--;
|
||||
}
|
||||
}
|
||||
@@ -87,15 +87,15 @@ void PaintingArea::slotDeleteActiveLayer(){
|
||||
}
|
||||
}
|
||||
|
||||
void PaintingArea::setLayerActive(int index){
|
||||
if(index>=0&&index<static_cast<int>(layerBundle.size())) {
|
||||
this->activeLayer=index;
|
||||
void PaintingArea::setLayerActive(int idx){
|
||||
if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
|
||||
this->activeLayer=idx;
|
||||
}
|
||||
}
|
||||
|
||||
void PaintingArea::setLayerAlpha(int index, int alpha){
|
||||
if(index>=0&&index<static_cast<int>(layerBundle.size())) {
|
||||
layerBundle[static_cast<size_t>(index)].alpha=alpha;
|
||||
void PaintingArea::setLayerAlpha(int idx, int alpha){
|
||||
if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
|
||||
layerBundle[static_cast<size_t>(idx)].alpha=alpha;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ bool PaintingArea::save(const QString &filePath, const char*fileFormat){
|
||||
this->drawLayers(true);
|
||||
|
||||
if(!strcmp(fileFormat,"PNG")) {
|
||||
QImage visibleImage = Canvas->convertToFormat(QImage::Format_Indexed8);
|
||||
QImage visibleImage = Canvas->convertToFormat(QImage::Format_idxed8);
|
||||
fileFormat = "png";
|
||||
if (visibleImage.save(filePath, fileFormat)) {
|
||||
return true;
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::Raster_Image);
|
||||
/*!
|
||||
* \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack
|
||||
* \param idx - ID of the position the new layer should be added
|
||||
* \param idx - Index of the position the new layer should be added
|
||||
* \param width - Width of the layer in pixles
|
||||
* \param height - Height of the layer in pixles
|
||||
* \param widthOffset - Offset of the layer measured to the left border of the painting area in pixles
|
||||
@@ -94,21 +94,21 @@ public:
|
||||
*/
|
||||
int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::Raster_Image);
|
||||
/*!
|
||||
* \brief The deleteLayer method removes a layer at a given index
|
||||
* \param index - The index of the layer to be removed
|
||||
* \brief The deleteLayer method removes a layer at a given idx
|
||||
* \param idx - The index of the layer to be removed
|
||||
*/
|
||||
void deleteLayer(int index);
|
||||
void deleteLayer(int idx);
|
||||
/*!
|
||||
* \brief The setLayerToActive method marks a specific layer as active
|
||||
* \param index - Index of the layer to be active
|
||||
* \param idx - The index of the layer to be active
|
||||
*/
|
||||
void setLayerActive(int index);
|
||||
void setLayerActive(int idx);
|
||||
/*!
|
||||
* \brief The setAlphaOfLayer method sets the alpha value of a specific layer
|
||||
* \param index - Index of the layer where the change should be applied
|
||||
* \param idx - The index of the layer where the change should be applied
|
||||
* \param alpha - New alpha value of the layer
|
||||
*/
|
||||
void setLayerAlpha(int index, int alpha);
|
||||
void setLayerAlpha(int idx, int alpha);
|
||||
/*!
|
||||
* \brief The floodFill method fills a the active layer with a given color
|
||||
* \param r - Red value of the color the layer should be filled with
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
void movePositionActive(int x, int y);
|
||||
/*!
|
||||
* \brief The moveActiveLayer moves the active layer to a specific position in the layer stack
|
||||
* \param idx - The id of the new position the layer should be in
|
||||
* \param idx - The index of the new position the layer should be in
|
||||
*/
|
||||
void moveActiveLayer(int idx);
|
||||
|
||||
@@ -178,7 +178,7 @@ public slots:
|
||||
// Events to handle
|
||||
/*!
|
||||
* \brief The slotActivateLayer method handles the event of selecting one layer as active
|
||||
* \param a - Index of the layer to be active
|
||||
* \param a - idx of the layer to be active
|
||||
*/
|
||||
void slotActivateLayer(int a);
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user