MCPcopy Create free account
hub / github.com/MrKepzie/Natron / findFormat

Method findFormat

Engine/ProjectPrivate.cpp:232–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230} // restoreFromSerialization
231
232bool
233ProjectPrivate::findFormat(int index,
234 Format* format) const
235{
236 if ( index >= (int)( builtinFormats.size() + additionalFormats.size() ) ) {
237 return false;
238 }
239
240 int i = 0;
241 if ( index >= (int)builtinFormats.size() ) {
242 ///search in the additional formats
243 index -= builtinFormats.size();
244
245 for (std::list<Format>::const_iterator it = additionalFormats.begin(); it != additionalFormats.end(); ++it) {
246 if (i == index) {
247 assert( !it->isNull() );
248 *format = *it;
249
250 return true;
251 }
252 ++i;
253 }
254 } else {
255 ///search in the builtins formats
256 for (std::list<Format>::const_iterator it = builtinFormats.begin(); it != builtinFormats.end(); ++it) {
257 if (i == index) {
258 assert( !it->isNull() );
259 *format = *it;
260
261 return true;
262 }
263 ++i;
264 }
265 }
266
267 return false;
268}
269
270void
271ProjectPrivate::autoSetProjectDirectory(const QString& path)

Callers 3

onKnobValueChangedMethod · 0.80

Calls 4

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected