Skip to content

Commit fbb0916

Browse files
committed
some cleanup
1 parent 71757c3 commit fbb0916

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

src/Solidify.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,7 @@ bool solidify_main(const std::string& inputFileName, const std::string& outputFi
127127
int width = input_buf.spec().width;
128128
int height = input_buf.spec().height;
129129
std::cout << "Image size: " << width << "x" << height << std::endl;
130-
131-
std::cout << "Channels: " << input_buf.nchannels() << std::endl;
132-
133-
int alpha_channel = input_buf.spec().alpha_channel;
134-
std::cout << "Alpha channel: " << alpha_channel << std::endl;
130+
std::cout << "Channels: " << input_buf.nchannels() << " Alpha channel: " << input_buf.spec().alpha_channel << std::endl;
135131

136132
bool isValid = true;
137133
int inputCh = input_buf.nchannels();
@@ -205,15 +201,6 @@ bool solidify_main(const std::string& inputFileName, const std::string& outputFi
205201

206202
ImageBuf* input_buf_ptr = external_alpha ? &rgba_buf : &input_buf; // Use the multiplied RGBA buffer if have an external alpha
207203

208-
#if 0
209-
std::cout << "channels: " << input_buf_ptr->nchannels() << std::endl;
210-
//std::vector<std::string> chnames = input_buf_ptr->spec().channelnames;
211-
//for (int i = 0; i < input_buf_ptr->nchannels(); ++i)
212-
// std::cout << "channel " << i << " : " << chnames[i] << std::endl;
213-
214-
std::cout << "alpha channel: " << input_buf_ptr->spec().alpha_channel << std::endl;
215-
#endif
216-
217204
// Call fillholes_pushpull
218205
bool ok = ImageBufAlgo::fillholes_pushpull(result_buf, *input_buf_ptr);
219206

@@ -231,8 +218,11 @@ bool solidify_main(const std::string& inputFileName, const std::string& outputFi
231218
}
232219

233220
ImageSpec spec = result_buf.spec();
234-
spec.nchannels = grayscale ? 1 : 3; // Only write RGB channels
235-
spec.alpha_channel = -1; // No alpha channel
221+
222+
//std::cout << "Channels: " << spec.nchannels << " Alpha channel: " << spec.alpha_channel << std::endl;
223+
224+
spec.nchannels = grayscale ? 1 : 4; // Only write RGB channels
225+
spec.alpha_channel = 3; // No alpha channel
236226

237227
out->open(outputFileName, spec, ImageOutput::Create);
238228

0 commit comments

Comments
 (0)