Commit 3b2c84da8cd8c43774e3078cf620026d3ad52397

Authored by bklare
1 parent 8db62b7d

Add parameter for zero padding and removed incorrect copyright

Showing 1 changed file with 3 additions and 17 deletions
openbr/plugins/io/write.cpp
1 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
2 - * Copyright 2012 The MITRE Corporation *  
3 - * *  
4 - * Licensed under the Apache License, Version 2.0 (the "License"); *  
5 - * you may not use this file except in compliance with the License. *  
6 - * You may obtain a copy of the License at *  
7 - * *  
8 - * http://www.apache.org/licenses/LICENSE-2.0 *  
9 - * *  
10 - * Unless required by applicable law or agreed to in writing, software *  
11 - * distributed under the License is distributed on an "AS IS" BASIS, *  
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *  
13 - * See the License for the specific language governing permissions and *  
14 - * limitations under the License. *  
15 - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */  
16 -  
17 #include <openbr/plugins/openbr_internal.h> 1 #include <openbr/plugins/openbr_internal.h>
18 #include <openbr/core/opencvutils.h> 2 #include <openbr/core/opencvutils.h>
19 3
@@ -33,9 +17,11 @@ class WriteTransform : public TimeVaryingTransform @@ -33,9 +17,11 @@ class WriteTransform : public TimeVaryingTransform
33 Q_PROPERTY(QString outputDirectory READ get_outputDirectory WRITE set_outputDirectory RESET reset_outputDirectory STORED false) 17 Q_PROPERTY(QString outputDirectory READ get_outputDirectory WRITE set_outputDirectory RESET reset_outputDirectory STORED false)
34 Q_PROPERTY(QString underscore READ get_underscore WRITE set_underscore RESET reset_underscore STORED false) 18 Q_PROPERTY(QString underscore READ get_underscore WRITE set_underscore RESET reset_underscore STORED false)
35 Q_PROPERTY(QString imgExtension READ get_imgExtension WRITE set_imgExtension RESET reset_imgExtension STORED false) 19 Q_PROPERTY(QString imgExtension READ get_imgExtension WRITE set_imgExtension RESET reset_imgExtension STORED false)
  20 + Q_PROPERTY(int padding READ get_padding WRITE set_padding RESET reset_padding STORED false)
36 BR_PROPERTY(QString, outputDirectory, "Temp") 21 BR_PROPERTY(QString, outputDirectory, "Temp")
37 BR_PROPERTY(QString, underscore, "") 22 BR_PROPERTY(QString, underscore, "")
38 BR_PROPERTY(QString, imgExtension, "jpg") 23 BR_PROPERTY(QString, imgExtension, "jpg")
  24 + BR_PROPERTY(int, padding, 5)
39 25
40 int cnt; 26 int cnt;
41 27
@@ -48,7 +34,7 @@ class WriteTransform : public TimeVaryingTransform @@ -48,7 +34,7 @@ class WriteTransform : public TimeVaryingTransform
48 void projectUpdate(const Template &src, Template &dst) 34 void projectUpdate(const Template &src, Template &dst)
49 { 35 {
50 dst = src; 36 dst = src;
51 - QString path = QString("%1/image%2%3.%4").arg(outputDirectory).arg(cnt++, 5, 10, QChar('0')).arg(underscore.isEmpty() ? "" : "_" + underscore).arg(imgExtension); 37 + QString path = QString("%1/image%2%3.%4").arg(outputDirectory).arg(cnt++, padding, 10, QChar('0')).arg(underscore.isEmpty() ? "" : "_" + underscore).arg(imgExtension);
52 OpenCVUtils::saveImage(dst.m(), path); 38 OpenCVUtils::saveImage(dst.m(), path);
53 } 39 }
54 40