-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAutoIntegrateAnnotateImage.js
More file actions
72 lines (54 loc) · 1.99 KB
/
Copy pathAutoIntegrateAnnotateImage.js
File metadata and controls
72 lines (54 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
AutoIntegrate AnnotateImage module.
AnnotateImage wrapper routines for the AutoIntegrate script.
Copyright (c) 2018-2026 Jarmo Ruuth.
This product is based on software from the PixInsight project, developed
by Pleiades Astrophoto and its contributors (https://pixinsight.com/).
*/
#ifndef AUTOINTEGRATEANNOTATEIMAGE_JS
#define AUTOINTEGRATEANNOTATEIMAGE_JS
#ifndef NO_SOLVER_LIBRARY
#define USE_ANNOTATE_LIBRARY true
#undef SETTINGS_MODULE
#define SETTINGS_MODULE "AutoIntegrateAnnotateImage"
#undef TITLE
#undef VERSION
#include "../AnnotateImage/AnnotateImage.js"
#endif // NO_SOLVER_LIBRARY
class AutoIntegrateAnnotateImage extends Object
{
constructor(util, engine)
{
super();
this.util = util;
this.engine = engine;
}
annotateImage(enhancementsWin, apply_directly)
{
this.engine.addEnhancementsStep("Annotate image " + enhancementsWin.mainView.id);
let annotationengine = new AnnotationEngine;
annotationengine.Init(enhancementsWin);
annotationengine.graphicsScale = this.engine.par.enhancements_annotate_image_scale.val;
if (apply_directly) {
annotationengine.outputMode = 1; // annotationengine.OutputMode.Overlay
}
try {
annotationengine.Render();
} catch (ex) {
this.util.throwFatalError( "*** Annotate image error: " + ex.toString() );
}
var annotatedImgWin = this.util.findWindow(enhancementsWin.mainView.id + "_annotated");
if (annotatedImgWin == null) {
this.util.throwFatalError( "*** Annotate image error: Annotated image window " + enhancementsWin.mainView.id + "_annotated not found." );
}
if (apply_directly) {
var bitmap = this.util.getWindowBitmap(annotatedImgWin);
enhancementsWin.mainView.image.blend(bitmap);
enhancementsWin.mainView.endProcess();
this.util.closeOneWindow(annotatedImgWin);
bitmap.clear();
}
return annotatedImgWin;
}
} // AutoIntegrateAnnotateImage
#endif // AUTOINTEGRATEANNOTATEIMAGE_JS