52 #ifndef __PCL_ImageWindow_h
53 #define __PCL_ImageWindow_h
62 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
76 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
80 class ProcessInterface;
128 return m != NewPreview && m != EditPreview;
161 namespace BackgroundBrush
195 namespace TransparencyMode
205 Default = BackgroundBrush
245 DefaultMode = 0x00000000,
246 PixelData = 0x00000001,
248 ICCProfile = 0x00000004,
249 Keywords = 0x00000008,
251 FormatData = 0x00000020,
252 ImageId = 0x00000040,
253 Resolution = 0x00000080,
254 AstrometricSolution = 0x00000100,
256 DeletePropertiesOnEntry = 0x01000000,
257 DeletePropertiesOnExit = 0x02000000,
258 ExcludePreviews = 0x80000000,
259 ExcludeMaskRelations = 0x40000000
267 using UndoFlags = Flags<UndoFlag::mask_type>;
271 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
292 using gui_mode = ImageMode::value_type;
299 using display_channel = DisplayChannel::value_type;
306 using mask_mode = MaskMode::value_type;
313 using background_brush = BackgroundBrush::value_type;
320 using transparency_mode = TransparencyMode::value_type;
374 int bitsPerSample = 32,
bool floatSample =
true,
bool color =
false,
375 bool initialProcessing =
true,
378 ImageWindow(
int width,
int height,
int numberOfChannels,
379 int bitsPerSample,
bool floatSample,
bool color,
380 bool initialProcessing,
383 bitsPerSample, floatSample, color,
535 bool allowMessages =
true );
537 template <
class S1,
class S2>
540 const S2& formatHints,
542 bool allowMessages =
true )
592 return !FileURL().IsEmpty();
614 return ModifyCount() > 0;
675 View v( MainView() ); SelectView( v );
700 return NumberOfPreviews() > 0;
721 return PreviewById(
IsoString( previewId ) );
731 return !IsNull() && !PreviewById( previewId ).IsNull();
736 return PreviewExists(
IsoString( previewId ) );
766 View v( PreviewById( previewId ) ), SelectPreview( v );
784 return CreatePreview( r.
x0, r.
y0, r.
x1, r.
y1, previewId );
789 return CreatePreview( r,
IsoString( previewId ) );
815 return CreatePreview( x0, y0, x1, y1,
IsoString( previewId ) );
828 ModifyPreview( previewId, r.
x0, r.
y0, r.
x1, r.
y1, newId );
833 ModifyPreview(
IsoString( previewId ), r );
838 ModifyPreview( IsoString( previewId ), r, IsoString( newId ) );
868 ModifyPreview(
IsoString( previewId ), x0, y0, x1, y1 );
888 return PreviewRect(
IsoString( previewId ) );
978 SetMask( mask, invert );
996 EnableMask( !disable );
1149 EnableColorManagement( !disable );
1184 EnableProofing( !disable );
1221 EnableGamutCheck( !disable );
1306 keywords = Keywords();
1477 template <
typename T>
1480 DPoint qI(
double( pI.
x ),
double( pI.
y ) );
1481 if ( ImageToCelestial( qI.
x, qI.
y, rawRA ) )
1529 if ( CelestialToImage( qI.
x, qI.
y ) )
1588 SetResolution( r, r, metric );
1756 return CurrentChannel() >= DisplayChannel::Alpha;
1770 return CurrentChannel() - DisplayChannel::Alpha;
1881 return TransparencyMode() != pcl::TransparencyMode::Hide;
1907 SetTransparencyMode( pcl::TransparencyMode::Hide );
1969 SetViewport( center.
x, center.
y, zoom );
2014 bool allowMagnification =
true,
2015 bool allowAnimations =
true,
2016 bool noLimits =
false );
2043 int z = ZoomFactor() + 1;
2044 SetZoomFactor( (z > 0) ? z : +1 );
2055 int z = ZoomFactor() - 1;
2056 SetZoomFactor( (z > 0 || z < -1) ? z : -2 );
2081 GetViewportSize( w, dum );
2091 GetViewportSize( dum, h );
2127 SetViewportPosition( p.
x, p.
y );
2145 return VisibleViewportRect().Width();
2154 return VisibleViewportRect().Height();
2177 void Show(
bool fitWindow =
true );
2299 SetDynamicCursor( xpm, p.
x, p.
y );
2336 SetDynamicCursor( bmp, p.
x, p.
y );
2412 template <
typename T>
2416 ViewportToImage( p1.
x, p1.
y );
2425 template <
typename T>
2429 ViewportToImage( r1.
x0, r1.
y0 );
2430 ViewportToImage( r1.
x1, r1.
y1 );
2465 template <
typename T>
2468 ViewportToImage( a.Begin(), a.Length() );
2510 template <
typename T>
2513 return ViewportScalarToImage(
double( d ) );
2539 template <
typename T>
2543 ImageToViewport( p1.
x, p1.
y );
2556 template <
typename T>
2560 ImageToViewport( r1.
x0, r1.
y0 );
2561 ImageToViewport( r1.
x1, r1.
y1 );
2596 template <
typename T>
2599 ImageToViewport( a.Begin(), a.Length() );
2661 ViewportToGlobal( p1.
x, p1.
y );
2673 ViewportToGlobal( r1.
x0, r1.
y0 );
2674 ViewportToGlobal( r1.
x1, r1.
y1 );
2694 GlobalToViewport( p1.
x, p1.
y );
2706 GlobalToViewport( r1.
x0, r1.
y0 );
2707 GlobalToViewport( r1.
x1, r1.
y1 );
2721 SetZoomFactor( ZoomFactor() );
2741 RegenerateViewportRect( r.
x0, r.
y0, r.
x1, r.
y1 );
2770 RegenerateImageRect( r.
x0, r.
y0, r.
x1, r.
y1 );
2805 UpdateViewportRect( r.
x0, r.
y0, r.
x1, r.
y1 );
2834 UpdateImageRect( r.
x0, r.
y0, r.
x1, r.
y1 );
2895 return ViewportBitmap( r.
x0, r.
y0, r.
x1, r.
y1, flags );
2929 BeginSelection( p.
x, p.
y, flags );
2960 ModifySelection( p.
x, p.
y, flags );
3058 friend class ProcessContextDispatcher;
3059 friend class InternalWindowEnumerator;
bool IsEmpty() const noexcept
Client-side interface to a PixInsight Bitmap object.
A generic point in the two-dimensional space.
component x
Abscissa (horizontal, or X-axis coordinate).
component y
Ordinate (vertical, or Y-axis coordinate).
A generic rectangle in the two-dimensional space.
component x1
Horizontal coordinate of the lower right corner.
component y1
Vertical coordinate of the lower right corner.
component y0
Vertical coordinate of the upper left corner.
component x0
Horizontal coordinate of the upper left corner.
A high-level interface to ICC color profiles.
Format-independent, fundamental image stream options.
High-level interface to an image window object in the PixInsight core application.
void SetResolution(double xRes, double yRes, bool metric=false)
void BeginSelection(int x, int y, uint32 flags=0)
View CreatePreview(int x0, int y0, int x1, int y1, const IsoString &previewId=IsoString())
void SetICCProfile(const ICCProfile &icc)
void EnableColorManagement(bool=true)
void SetRGBWS(const RGBColorSystem &rgbws)
GenericRectangle< T > ImageToViewport(const GenericRectangle< T > &r) const
ImageOptions FileInfo() const
void RegenerateImageRect(double x0, double y0, double x1, double y1)
static ImageWindow ActiveWindow()
bool HasPendingUpdates() const
GenericPoint< T > ImageToViewport(const GenericPoint< T > &p) const
void CommitPendingUpdates()
ImageWindow(ImageWindow &&x)
void ViewportToGlobal(int &x, int &y) const
static bool IsDefaultThumbnailEmbeddingEnabled()
display_channel CurrentChannel() const
void SetDynamicCursor(const char **xpm, const Point &p)
bool GetKeywords(FITSKeywordArray &keywords) const
static bool SetSwapDirectories(const StringList &directories)
int CurrentAlphaChannel() const
ImageWindow(const ImageWindow &w)
DPoint ViewportToImage(const GenericPoint< T > &p) const
void ModifySelection(int x, int y, uint32 flags=0)
void ZoomToFit(bool optimalFit=true, bool allowMagnification=true, bool allowAnimations=true, bool noLimits=false)
void RegenerateViewportRect(const Rect &r)
void HideMask(bool hide=true)
void SelectChannel(display_channel c)
void SetMaskMode(mask_mode mode)
ImageWindow(int width, int height, int numberOfChannels=1, int bitsPerSample=32, bool floatSample=true, bool color=false, bool initialProcessing=true, const IsoString &id=IsoString())
bool HasMaskReferences() const
bool GetICCProfile(ICCProfile &icc) const
void ViewportToImage(Point *p, size_type n) const
Bitmap DynamicCursorBitmap() const
bool IsMaskCompatible(const ImageWindow &)
void BeginSelection(const Point &p, uint32 flags=0)
Rect GlobalToViewport(const Rect &r) const
void DisableProofing(bool disable=true)
void UpdateViewportRect(int x0, int y0, int x1, int y1)
void GetViewportSize(int &width, int &height) const
Point DynamicCursorHotSpot() const
void SetResolution(double r, bool metric=false)
void SetDynamicCursor(const char **xpm, int hx=0, int hy=0)
void SelectPreview(const IsoString &previewId)
View CreatePreview(const Rect &r, const IsoString &previewId=IsoString())
static ImageWindow & Null()
View PreviewById(const IsoString &previewId) const
int ImageScalarToViewport(int) const
void ViewportScalarToImage(int *d, size_type n) const
int VisibleViewportHeight() const
static ImageWindow WindowById(const IsoString &id)
int ViewportHeight() const
Point GlobalToViewport(const Point &p) const
void Show(bool fitWindow=true)
void RegenerateViewportRect(int x0, int y0, int x1, int y1)
void RemoveMaskReferences()
Rect VisibleViewportRect() const
void DeletePreview(const IsoString &previewId)
Array< View > Previews() const
bool IsMaskInverted() const
void SetICCProfile(const String &filePath)
void ViewportToImage(Array< GenericPoint< T > > &a) const
bool PreviewExists(const IsoString &previewId) const
static void SetBackgroundBrush(background_brush brush, uint32 fgColor=0, uint32 bgColor=0)
bool IsAlphaChannelDisplayed() const
void EnableProofing(bool=true)
void EnableGamutCheck(bool=true)
void InvertMask(bool invert=true)
static bool IsDefaultICCProfileEmbeddingEnabledForRGBImages()
void ModifySelection(const Point &p, uint32 flags=0)
bool IsMaskVisible() const
Rect ViewportToGlobal(const Rect &r) const
void SetDynamicCursor(const Bitmap &bmp, int hx=0, int hy=0)
Point ViewportToGlobal(const Point &p) const
double ViewportScalarToImage(T d) const
void GetResolution(double &xRes, double &yRes, bool &metric) const
DRect ViewportToImage(const GenericRectangle< T > &r) const
static StringList SwapDirectories()
static void GetDefaultResolution(double &xRes, double &yRes, bool &metric)
Rect PreviewRect(const IsoString &previewId) const
bool IsTransparencyVisible() const
double ImageScalarToViewport(double) const
void ModifyPreview(const IsoString &previewId, int x0, int y0, int x1, int y1, const IsoString &newId=IsoString())
void ResetDynamicCursor()
void GetSampleFormat(int &bitsPerSample, bool &floatSample) const
static gui_mode CurrentMode()
static bool IsDynamicSessionActive()
static ImageWindow WindowByFilePath(const String &filePath)
void DisableGamutCheck(bool disable=true)
void ImageToViewport(DPoint *p, size_type n) const
void UpdateImageRect(double x0, double y0, double x1, double y1)
void EnableMask(bool=true)
Rect SelectionRect(uint32 *flags=nullptr) const
static bool IsDefaultICCProfileEmbeddingEnabledForGrayscaleImages()
static Array< ImageWindow > AllWindows(bool includeIconicWindows=true)
static bool IsDefaultPropertiesEmbeddingEnabled()
void ViewportToImage(DPoint *p, size_type n) const
void ViewportScalarToImage(double *d, size_type n) const
void SetViewportPosition(const Point &p)
static ProcessInterface * ActiveDynamicInterface()
int NumberOfPreviews() const
Rect ViewportUpdateRect() const
int ViewportWidth() const
Bitmap ViewportBitmap(int x0, int y0, int x1, int y1, uint32 flags=0) const
void UpdateImageRect(const pcl::DRect &r)
void SetSampleFormat(int bitsPerSample, bool floatSample)
bool IsProofingEnabled() const
void SetTransparencyMode(transparency_mode mode, RGBA color=0)
void ImageToViewport(Array< GenericPoint< T > > &a) const
mask_mode MaskMode() const
static void SelectMode(gui_mode mode)
void UpdateViewportRect(const Rect &r)
static void GetGlobalRGBWS(RGBColorSystem &rgbws)
void ViewportToImage(double &x, double &y) const
bool IsGamutCheckEnabled() const
double DisplayPixelRatio() const
static background_brush GetBackgroundBrush(uint32 &fgColor, uint32 &bgColor)
int VisibleViewportWidth() const
void ImageToViewport(Point *p, size_type n) const
size_type ModifyCount() const
void ModifyPreview(const IsoString &previewId, const Rect &r, const IsoString &newId=IsoString())
void SetMask(ImageWindow &w, bool inverted=false)
void SelectPreview(View &)
static bool TerminateDynamicSession(bool closeInterface=true)
void DisableMask(bool disable=true)
void UpdateMaskReferences()
void GlobalToViewport(int &x, int &y) const
void RegenerateImageRect(const pcl::DRect &r)
void SetViewport(double cx, double cy, int zoom=0)
bool IsValidView(const View &) const
static int CursorTolerance()
bool IsMaskEnabled() const
void ImageToViewport(int &x, int &y) const
bool UsingGlobalRGBWS() const
double ViewportScalarToImage(double d) const
void DisableColorManagement(bool disable=true)
RGBA TransparencyColor() const
Point ViewportPosition() const
void SetColorManagementFeatures(bool cmEnabled, bool proofing, bool gamutCheck)
void SetDynamicCursor(const Bitmap &bmp, const Point &p)
bool IsColorManagementEnabled() const
static Array< ImageWindow > Open(const String &url, const IsoString &id=IsoString(), const IsoString &formatHints=IsoString(), bool asCopy=false, bool allowMessages=true)
FITSKeywordArray Keywords() const
static void SetGlobalRGBWS(const RGBColorSystem &rgbws)
void ImageScalarToViewport(double *d, size_type n) const
void GetRGBWS(RGBColorSystem &rgbws) const
void ImageToViewport(double &x, double &y) const
void SetViewport(const DPoint ¢er, int zoom=0)
transparency_mode TransparencyMode() const
Bitmap ViewportBitmap(const Rect &r, uint32 flags=0) const
void ViewportToImage(int &x, int &y) const
void SetViewportPosition(int x, int y)
View SelectedPreview() const
void SetZoomFactor(int z)
void ImageScalarToViewport(int *d, size_type n) const
void SetKeywords(const FITSKeywordArray &keywords)
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
GenericString< char16_type, CharTraits, PCL_STRING_ALLOCATOR > ustring_base
High-level interface to a process instance.
Client-side interface to a PixInsight process interface window.
Colorimetrically defined RGB working color space.
32-bit integer rectangle on the plane.
Root base class for all user interface objects.
A collection of history data item specifiers.
High-level interface to a PixInsight view object.
bool CelestialToImage(DPoint &pI, const DPoint &pRD) const
bool CelestialToImage(double &ra, double &dec) const
bool ImageToCelestial(DPoint &pRD, const GenericPoint< T > &pI, bool rawRA=false) const
bool CopyAstrometricSolution(const ImageWindow &source, bool notify=true)
void UpdateAstrometryMetadata(bool notify=true)
bool HasAstrometricSolution() const
void ClearAstrometricSolution(bool notify=true)
bool ImageToCelestial(double &x, double &y, bool rawRA=false) const
bool RegenerateAstrometricSolution(bool allowGUIMessages=true, bool notify=true)
bool IsValidMainViewMode(value_type m)
bool IsValidPreviewMode(value_type m)