MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / getValidTargetModels

Function getValidTargetModels

src/utils/cameraModelConversions.ts:184–203  ·  view source on GitHub ↗
(
  sourceModel: CameraModelId
)

Source from the content-addressed store, hash-verified

182 * @returns Array of valid target model IDs with their compatibility
183 */
184export function getValidTargetModels(
185 sourceModel: CameraModelId
186): Array<{ modelId: CameraModelId; compatibility: ConversionCompatibility }> {
187 const allModels = Object.values(CameraModelId).filter(
188 (v): v is CameraModelId => typeof v === 'number'
189 );
190
191 const results: Array<{ modelId: CameraModelId; compatibility: ConversionCompatibility }> = [];
192
193 for (const targetModel of allModels) {
194 if (targetModel === sourceModel) continue;
195
196 const compatibility = canConvertModel(sourceModel, targetModel);
197 if (compatibility !== 'incompatible') {
198 results.push({ modelId: targetModel, compatibility });
199 }
200 }
201
202 return results;
203}
204
205/**
206 * Get a detailed preview of a camera model conversion.

Calls 2

canConvertModelFunction · 0.85
valuesMethod · 0.65

Tested by

no test coverage detected