PCL
|
High-level interface to an image window object in the PixInsight core application. More...
#include <ImageWindow.h>
Public Types | |
using | background_brush = BackgroundBrush::value_type |
using | display_channel = DisplayChannel::value_type |
using | gui_mode = ImageMode::value_type |
using | mask_mode = MaskMode::value_type |
using | transparency_mode = TransparencyMode::value_type |
Public Member Functions | |
ImageWindow ()=default | |
ImageWindow (const ImageWindow &w) | |
ImageWindow (ImageWindow &&x) | |
ImageWindow (int width, int height, int numberOfChannels=1, int bitsPerSample=32, bool floatSample=true, bool color=false, bool initialProcessing=true, const IsoString &id=IsoString()) | |
~ImageWindow () override | |
void | BeginSelection (const Point &p, uint32 flags=0) |
void | BeginSelection (int x, int y, uint32 flags=0) |
void | BringToFront () |
void | CancelSelection () |
bool | CelestialToImage (double &ra, double &dec) const |
bool | CelestialToImage (DPoint &pI, const DPoint &pRD) const |
void | ClearAstrometricSolution (bool notify=true) |
bool | Close () |
void | CommitPendingUpdates () |
bool | CopyAstrometricSolution (const ImageWindow &source, bool notify=true) |
View | CreatePreview (const Rect &r, const IsoString &previewId=IsoString()) |
View | CreatePreview (int x0, int y0, int x1, int y1, const IsoString &previewId=IsoString()) |
int | CurrentAlphaChannel () const |
display_channel | CurrentChannel () const |
View | CurrentView () const |
void | Deiconize () |
void | DeleteICCProfile () |
void | DeletePreview (const IsoString &previewId) |
void | DeletePreviews () |
void | DisableColorManagement (bool disable=true) |
void | DisableGamutCheck (bool disable=true) |
void | DisableMask (bool disable=true) |
void | DisableProofing (bool disable=true) |
double | DisplayPixelRatio () const |
Bitmap | DynamicCursorBitmap () const |
Point | DynamicCursorHotSpot () const |
void | EnableColorManagement (bool=true) |
void | EnableGamutCheck (bool=true) |
void | EnableMask (bool=true) |
void | EnableProofing (bool=true) |
void | EndSelection () |
ImageOptions | FileInfo () const |
String | FilePath () const |
String | FileURL () const |
void | FitWindow () |
void | ForceClose () |
bool | GetICCProfile (ICCProfile &icc) const |
bool | GetKeywords (FITSKeywordArray &keywords) const |
void | GetResolution (double &xRes, double &yRes, bool &metric) const |
void | GetRGBWS (RGBColorSystem &rgbws) const |
void | GetSampleFormat (int &bitsPerSample, bool &floatSample) const |
void | GetViewportSize (int &width, int &height) const |
Point | GlobalToViewport (const Point &p) const |
Rect | GlobalToViewport (const Rect &r) const |
void | GlobalToViewport (int &x, int &y) const |
bool | HasAstrometricSolution () const |
bool | HasMaskReferences () const |
bool | HasPendingUpdates () const |
bool | HasPreviews () const |
bool | HasURL () const |
void | Hide () |
void | HideMask (bool hide=true) |
void | HideTransparency () |
void | Iconize () |
void | ImageScalarToViewport (double *d, size_type n) const |
double | ImageScalarToViewport (double) const |
void | ImageScalarToViewport (int *d, size_type n) const |
int | ImageScalarToViewport (int) const |
bool | ImageToCelestial (double &x, double &y, bool rawRA=false) const |
template<typename T > | |
bool | ImageToCelestial (DPoint &pRD, const GenericPoint< T > &pI, bool rawRA=false) const |
template<typename T > | |
void | ImageToViewport (Array< GenericPoint< T > > &a) const |
template<typename T > | |
GenericPoint< T > | ImageToViewport (const GenericPoint< T > &p) const |
template<typename T > | |
GenericRectangle< T > | ImageToViewport (const GenericRectangle< T > &r) const |
void | ImageToViewport (double &x, double &y) const |
void | ImageToViewport (DPoint *p, size_type n) const |
void | ImageToViewport (int &x, int &y) const |
void | ImageToViewport (Point *p, size_type n) const |
void | InvertMask (bool invert=true) |
bool | IsACopy () const |
bool | IsAlphaChannelDisplayed () const |
bool | IsColorManagementEnabled () const |
bool | IsGamutCheckEnabled () const |
bool | IsIconic () const |
bool | IsMaskCompatible (const ImageWindow &) |
bool | IsMaskEnabled () const |
bool | IsMaskInverted () const |
bool | IsMaskVisible () const |
bool | IsModified () const |
bool | IsNew () const |
bool | IsProofingEnabled () const |
bool | IsSelection () const |
bool | IsTransparencyVisible () const |
bool | IsValidView (const View &) const |
bool | IsVisible () const |
FITSKeywordArray | Keywords () const |
View | MainView () const |
ImageWindow | Mask () const |
mask_mode | MaskMode () const |
size_type | ModifyCount () const |
void | ModifyPreview (const IsoString &previewId, const Rect &r, const IsoString &newId=IsoString()) |
void | ModifyPreview (const IsoString &previewId, int x0, int y0, int x1, int y1, const IsoString &newId=IsoString()) |
void | ModifySelection (const Point &p, uint32 flags=0) |
void | ModifySelection (int x, int y, uint32 flags=0) |
int | NumberOfPreviews () const |
ImageWindow & | operator= (const ImageWindow &window) |
ImageWindow & | operator= (ImageWindow &&x) |
View | PreviewById (const IsoString &previewId) const |
bool | PreviewExists (const IsoString &previewId) const |
Rect | PreviewRect (const IsoString &previewId) const |
Array< View > | Previews () const |
void | PurgeProperties () |
void | Regenerate () |
bool | RegenerateAstrometricSolution (bool allowGUIMessages=true, bool notify=true) |
void | RegenerateImageRect (const pcl::DRect &r) |
void | RegenerateImageRect (double x0, double y0, double x1, double y1) |
void | RegenerateViewportRect (const Rect &r) |
void | RegenerateViewportRect (int x0, int y0, int x1, int y1) |
void | RemoveMask () |
void | RemoveMaskReferences () |
void | Reset () |
void | ResetDynamicCursor () |
void | ResetKeywords () |
void | SelectChannel (display_channel c) |
View | SelectedPreview () const |
Rect | SelectionRect (uint32 *flags=nullptr) const |
void | SelectMainView () |
void | SelectPreview (const IsoString &previewId) |
void | SelectPreview (View &) |
void | SelectView (View &) |
void | SendToBack () |
void | SetColorManagementFeatures (bool cmEnabled, bool proofing, bool gamutCheck) |
void | SetDynamicCursor (const Bitmap &bmp, const Point &p) |
void | SetDynamicCursor (const Bitmap &bmp, int hx=0, int hy=0) |
void | SetDynamicCursor (const char **xpm, const Point &p) |
void | SetDynamicCursor (const char **xpm, int hx=0, int hy=0) |
void | SetICCProfile (const ICCProfile &icc) |
void | SetICCProfile (const String &filePath) |
void | SetKeywords (const FITSKeywordArray &keywords) |
void | SetMask (ImageWindow &w, bool inverted=false) |
void | SetMaskMode (mask_mode mode) |
void | SetResolution (double r, bool metric=false) |
void | SetResolution (double xRes, double yRes, bool metric=false) |
void | SetRGBWS (const RGBColorSystem &rgbws) |
void | SetSampleFormat (int bitsPerSample, bool floatSample) |
void | SetTransparencyMode (transparency_mode mode, RGBA color=0) |
void | SetViewport (const DPoint ¢er, int zoom=0) |
void | SetViewport (double cx, double cy, int zoom=0) |
void | SetViewportPosition (const Point &p) |
void | SetViewportPosition (int x, int y) |
void | SetZoomFactor (int z) |
void | Show (bool fitWindow=true) |
void | ShowMask (bool=true) |
RGBA | TransparencyColor () const |
transparency_mode | TransparencyMode () const |
void | UpdateAstrometryMetadata (bool notify=true) |
void | UpdateImageRect (const pcl::DRect &r) |
void | UpdateImageRect (double x0, double y0, double x1, double y1) |
void | UpdateMaskReferences () |
void | UpdateSelection () |
void | UpdateViewport () |
void | UpdateViewportRect (const Rect &r) |
void | UpdateViewportRect (int x0, int y0, int x1, int y1) |
void | UseGlobalRGBWS () |
bool | UsingGlobalRGBWS () const |
Bitmap | ViewportBitmap (const Rect &r, uint32 flags=0) const |
Bitmap | ViewportBitmap (int x0, int y0, int x1, int y1, uint32 flags=0) const |
int | ViewportHeight () const |
Point | ViewportPosition () const |
void | ViewportScalarToImage (double *d, size_type n) const |
double | ViewportScalarToImage (double d) const |
void | ViewportScalarToImage (int *d, size_type n) const |
template<typename T > | |
double | ViewportScalarToImage (T d) const |
Point | ViewportToGlobal (const Point &p) const |
Rect | ViewportToGlobal (const Rect &r) const |
void | ViewportToGlobal (int &x, int &y) const |
template<typename T > | |
void | ViewportToImage (Array< GenericPoint< T > > &a) const |
template<typename T > | |
DPoint | ViewportToImage (const GenericPoint< T > &p) const |
template<typename T > | |
DRect | ViewportToImage (const GenericRectangle< T > &r) const |
void | ViewportToImage (double &x, double &y) const |
void | ViewportToImage (DPoint *p, size_type n) const |
void | ViewportToImage (int &x, int &y) const |
void | ViewportToImage (Point *p, size_type n) const |
Rect | ViewportUpdateRect () const |
int | ViewportWidth () const |
int | VisibleViewportHeight () const |
Rect | VisibleViewportRect () const |
int | VisibleViewportWidth () const |
int | ZoomFactor () const |
void | ZoomIn () |
void | ZoomOut () |
void | ZoomToFit (bool optimalFit=true, bool allowMagnification=true, bool allowAnimations=true, bool noLimits=false) |
Public Member Functions inherited from pcl::UIObject | |
virtual | ~UIObject () noexcept(false) |
virtual void | EnsureUnique () |
bool | IsAlias () const |
bool | IsGarbage () const |
bool | IsNull () const |
bool | IsSameObject (const UIObject &o) const |
bool | IsUnique () const |
String | ObjectId () const |
IsoString | ObjectType () const |
bool | operator< (const UIObject &o) const |
bool | operator== (const UIObject &o) const |
size_type | RefCount () const |
void | SetObjectId (const String &id) |
Additional Inherited Members | |
Protected Member Functions inherited from pcl::UIObject | |
UIObject ()=default | |
UIObject (const UIObject &x) | |
UIObject (UIObject &&x) | |
UIObject & | operator= (const UIObject &x) |
UIObject & | operator= (UIObject &&x) |
Definition at line 286 of file ImageWindow.h.
using pcl::ImageWindow::background_brush = BackgroundBrush::value_type |
Represents a transparency background brush supported by the PixInsight core application. Valid transparency brushes are defined in the BackgroundBrush namespace.
Definition at line 315 of file ImageWindow.h.
using pcl::ImageWindow::display_channel = DisplayChannel::value_type |
Represents a display image channel supported by the PixInsight core application. Valid display channels and components are defined in the DisplayChannel namespace.
Definition at line 301 of file ImageWindow.h.
using pcl::ImageWindow::gui_mode = ImageMode::value_type |
Represents a GUI working mode. Valid modes are defined in the ImageMode namespace.
Definition at line 294 of file ImageWindow.h.
using pcl::ImageWindow::mask_mode = MaskMode::value_type |
Represents a mask rendering mode supported by the PixInsight core application. Valid mask rendering modes are defined in the MaskMode namespace.
Definition at line 308 of file ImageWindow.h.
using pcl::ImageWindow::transparency_mode = TransparencyMode::value_type |
Represents a transparency rendering mode supported by the PixInsight core application. Valid transparency rendering modes are defined in the TransparencyMode namespace.
Definition at line 322 of file ImageWindow.h.
|
default |
Constructs a null image window. A null ImageWindow does not correspond to an existing image window in the PixInsight core application.
pcl::ImageWindow::ImageWindow | ( | int | width, |
int | height, | ||
int | numberOfChannels = 1 , |
||
int | bitsPerSample = 32 , |
||
bool | floatSample = true , |
||
bool | color = false , |
||
bool | initialProcessing = true , |
||
const IsoString & | id = IsoString() |
||
) |
Creates a new image window with the specified image parameters.
width | Image width in pixels. Must be >= 1. There is no specific upper limit. |
height | Image height in pixels. Must be >= 1. There is no specific upper limit. |
numberOfChannels | Number of channels in the image. Should not be less than the number of nominal channels: 1 for grayscale images, 3 for color images. Channels in excess of nominal channels are generated as alpha channels. This parameter is one by default. |
bitsPerSample | Number of bits per sample. Supported values are 8, 16 and 32 for integer images; 32 and 64 for floating point images. This parameter is 32 by default. |
floatSample | True to create a floating point image; false to create an integer image. This parameter is true by default. |
color | True to create a RGB color image; false to create a grayscale image. This parameter is false by default. |
initialProcessing | True if the core application should assign a ProcessContainer instance to hold the initial processing for this image. The initial processing items will be automatically generated by the core application as a function of the current processing thread context. This parameter is true by default. |
id | Identifier for the new image. If an empty string is specified, the core application will assign an automatically generated identifier. If the specified identifier is not unique, the core application will make it unique by appending an automatically generated suffix. This parameter is an empty string by default. |
The newly created image is initialized with zero pixel sample values (black pixels). This includes all nominal and alpha channels.
The new image window will be hidden. To make it visible on the core application, you must call its Show() member function explicitly.
|
inline |
Copy constructor. Constructs an ImageWindow object as an alias of an existing ImageWindow object.
It cannot be overemphasized that this constructor does not create a new image window in the PixInsight core application. It only creates an alias object for an existing image window in the calling module. In all respects, the alias and aliased objects are completely interchangeable; their behaviors are exactly identical since they refer to the same server-side object.
Definition at line 402 of file ImageWindow.h.
|
inline |
Move constructor.
Definition at line 410 of file ImageWindow.h.
|
inlineoverride |
Destroys an ImageWindow object.
This destructor does not destroy the actual image window object, which is part of the PixInsight core application. Only the managed alias object living in the calling module is destroyed.
Definition at line 422 of file ImageWindow.h.
|
static |
Returns a pointer to the current active dynamic interface.
The active dynamic interface is the interface that has been activated in dynamic mode.
|
static |
Returns the current active image window. Returns ImageWindow::Null() if there are no image windows, if all image windows are hidden, or if all image windows have been iconized.
The active image window is the topmost image window of the stack of image windows in the current workspace. Most commands that apply to views, images and previews, are executed on the active image window by default, even if it doesn't have the keyboard focus.
|
static |
Returns a container with all existing image windows, including visible and hidden windows, and optionally iconized windows.
includeIconicWindows | If this parameter is false, iconic image windows will not be included in the returned container. |
Begins a new interactive rectangular selection procedure on the viewport of this image window.
Calling this function is equivalent to:
Definition at line 2929 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
void pcl::ImageWindow::BeginSelection | ( | int | x, |
int | y, | ||
uint32 | flags = 0 |
||
) |
Starts a new interactive rectangular selection procedure on the viewport of this image window.
x,y | Image coordinates of the starting point of a new rectangular selection. |
flags | Currently not used; reserved for future extensions of PCL. Must be set to zero. |
Dynamic interfaces use BeginSelection() in response to an OnMousePress event to start a rectangular selection. ModifySelection() is then called from an OnMouseMove event handler, and the final selection coordinates are obtained by calling SelectionRect() from an OnMouseRelease event handler.
void pcl::ImageWindow::BringToFront | ( | ) |
Brings this image window to the top of the stack of image windows in its parent workspace of the PixInsight core application's GUI.
Calling this function implicitly shows this image window, if it was previously hidden or iconized. If this window is a child of the current workspace, calling this function also activates it and gives it the keyboard focus.
void pcl::ImageWindow::CancelSelection | ( | ) |
Aborts the current interactive selection procedure.
bool pcl::ImageWindow::Close | ( | ) |
Requests closing this image window. Returns true if the window was actually closed.
When an image window is closed, its image and all of its numerous associated resources are destroyed. The close operation is irreversible in PixInsight.
If the image in this window is not modified, the window will be closed and true will be returned.
If the image in this window is modified and has not been saved to a disk file, the PixInsight core application will ask the user if it is ok to throw away the changes by closing this window. If the user answers affirmatively, the window will be closed and this function will return true. If the user says no, the window will not be closed and the function will return false.
void pcl::ImageWindow::CommitPendingUpdates | ( | ) |
Executes all pending viewport update requests for this image window.
Viewport update requests are not executed immediately by the core PixInsight application. For the sake of performance, The GUI tries to optimize screen updates by performing the minimum possible redrawing work.
This means that update requests are placed on a queue, waiting while the main GUI thread is busy or until a sufficiently large update region becomes available.
With this function, an interface can force the immediate screen update for all pending update viewport regions. If multiple update regions are pending, the core application will still minimize the required drawing work by grouping all of them into the minimum possible amount of larger regions.
|
inline |
Creates a new preview in this image window. Returns the newly created preview as a View object.
Calling this function is equivalent to:
Definition at line 784 of file ImageWindow.h.
View pcl::ImageWindow::CreatePreview | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
const IsoString & | previewId = IsoString() |
||
) |
Creates a new preview in this image window. Returns the newly created preview as a View object.
x0,y0 | Position (horizontal, vertical) of the left-top corner of the preview rectangle in image coordinates. |
x1,y1 | Position (horizontal, vertical) of the right-bottom corner of the preview rectangle in image coordinates. |
previewId | Preview identifier. If an empty string is specified, the core application will generate an automatic identifier for the newly created preview. If the specified identifier is already in use, the core application will make it unique by appending an automatically generated suffix. |
The preview rectangle must define a non-empty rectangular area completely included in the boundaries of the image in this window.
|
inline |
Returns the alpha channel index displayed for the image in the current view. If the current display channel does not correspond to an alpha channel, a negative integer value is returned.
Alpha channel indices are relative to the first alpha channel in an image. For example, the first alpha channel is always indexed as alpha channel #0, and so on.
Definition at line 1770 of file ImageWindow.h.
display_channel pcl::ImageWindow::CurrentChannel | ( | ) | const |
Returns the current display channel in the core application's GUI.
The returned value can be identified with the symbolic constants defined int the DisplayChannel namespace.
|
static |
Returns the current GUI working mode in the PixInsight core application.
The returned value can be identified with the symbolic constants defined in the ImageMode namespace.
View pcl::ImageWindow::CurrentView | ( | ) | const |
Returns the current view of this image window.
The current view is the view currently selected for direct user interaction in the core application GUI for this image window. The current view receives cursor and pointing device (mouse) events.
|
static |
Returns the current cursor tolerance in viewport coordinates, as globally established in the PixInsight core application.
This value is the threshold distance in pixels, in viewport coordinates, used to activate actions based on object proximity.
For example, if an interface implements an interactive procedure for resizing a rectangle based on mouse movement events, when the mouse cursor gets closer to a given side of the rectangle by less than the current cursor tolerance, the cursor shape should be changed to give feedback to the user; e.g. to a double arrow shape corresponding to the side being resized.
void pcl::ImageWindow::Deiconize | ( | ) |
Deiconizes this image window, if it was previously iconized.
void pcl::ImageWindow::DeleteICCProfile | ( | ) |
Causes this image window to be associated with the default ICC profile globally defined in the PixInsight core application.
If this image window has its own associated ICC profile, this funtion destroys it and frees its allocated space.
If this image window is visible and has color management enabled, its screen rendition is updated immediately after calling this function.
void pcl::ImageWindow::DeletePreview | ( | const IsoString & | previewId | ) |
Destroys an existing preview in this window and frees all of its associated view resources.
previewId | Identifier of the preview that will be destroyed. |
The PixInsight core application might ask the user for permission before attempting to destroy a preview in an image window.
void pcl::ImageWindow::DeletePreviews | ( | ) |
Destroys all previews in this image window.
The PixInsight core application reserves the right to ask the user for permission before attempting to destroy all previews in an image window.
|
inline |
Disables color management for this image window.
See the documentation for EnableColorManagement() for additional information on color management in PixInsight.
If this image window is visible, its screen rendition is updated immediately after calling this function.
Definition at line 1149 of file ImageWindow.h.
|
inline |
Disables the gamut check proofing feature for this image window.
See the documentation for EnableGamutCheck() for additional information on the gamut check color proofing feature.
If this image window is visible, has color management enabled, and has proofing enabled, its screen rendition is updated immediately after calling this function. If color proofing is disabled, calling this function has no effect.
Definition at line 1221 of file ImageWindow.h.
|
inline |
Disables the mask of this image window.
Definition at line 996 of file ImageWindow.h.
|
inline |
Disables soft-proofing for this image window.
See the documentation for EnableProofing() for additional information on color proofing.
If this image window is visible and has color management enabled, its screen rendition is updated immediately after calling this function.
Definition at line 1184 of file ImageWindow.h.
double pcl::ImageWindow::DisplayPixelRatio | ( | ) | const |
Returns the ratio between physical screen pixels and device-independent coordinate units for this image window (actually, for the workspace that this window belongs to).
The returned value is greater than or equal to one. Typical pixel ratios are 2.0 for high-dpi displays such as Retina monitors, or 1.0 for normal 96 dpi monitors.
The display pixel ratio is never used by ImageWindow, since all viewport coordinates are always specified in physical display pixels. However, knowing this ratio is useful to properly scale interactive graphical contents generated by dynamic processes. For example, drawing vector graphics with one-pixel wide pens is fine for normal monitors, but may cause visibility problems on a 4K monitor, and is clearly inappropriate on a 5K monitor.
The following example shows how to scale a Pen's width to adapt a drawing to the physical display where the window is being shown to the user:
Bitmap pcl::ImageWindow::DynamicCursorBitmap | ( | ) | const |
Returns a RGBA bitmap as a copy of the current shape of the pointing device's cursor for the active dynamic session.
Point pcl::ImageWindow::DynamicCursorHotSpot | ( | ) | const |
Returns the cursor hot spot position for the active dynamic session.
Cursor hot spot coordinates are relative to the left-top corner of the cursor shape bitmap.
void pcl::ImageWindow::EnableColorManagement | ( | bool | = true | ) |
Enables color management for this image window.
Color management uses ICC profiles for this image (either a profile associated with this image or a global profile) and the monitor device to control how this image is rendered on the screen. Color management transformations are applied to yield a visual representation that takes into account the actual meaning of numerical pixel sample values, considering the chromatic responses of the screen and of the devices and color spaces that have originated this image.
If color management is disabled for an image, its pixel sample values are sent directly to the screen, avoiding ICC profile transformations. This improves output performance, but may give a false representation of the image on the screen.
If this image window is visible, its screen rendition is updated immediately after calling this function.
void pcl::ImageWindow::EnableGamutCheck | ( | bool | = true | ) |
Enables the gamut check proofing feature for this image window.
The gamut check feature represents out-of-gamut colors (i.e., colors that are not defined in the color space of the image) with a special color (selectable via global color management preferences) for quick visual detection.
If this image window is visible, has color management enabled, and has proofing enabled, its screen rendition is updated immediately after calling this function. If color proofing is disabled, calling this function has no effect.
void pcl::ImageWindow::EnableMask | ( | bool | = true | ) |
Enables the mask of this image window.
void pcl::ImageWindow::EnableProofing | ( | bool | = true | ) |
Enables soft-proofing for this image window.
Color proofing is used to emulate an output device (usually a printer) on the screen. Proofing requires three ICC profiles: the image profile (either an embedded profile or the default profile), the monitor profile, and a proofing profile that describes the emulated device. Color proofing is useful to preview the final printed result without rendering images to physical media.
If this image window is visible and has color management enabled, its screen rendition is updated immediately after calling this function.
void pcl::ImageWindow::EndSelection | ( | ) |
Terminates the current interactive selection procedure.
ImageOptions pcl::ImageWindow::FileInfo | ( | ) | const |
Returns an ImageOptions structure with information about the image in this image window.
String pcl::ImageWindow::FilePath | ( | ) | const |
Returns the full file path to the image file loaded in this image window, or an empty string if this window holds is a new image.
String pcl::ImageWindow::FileURL | ( | ) | const |
Returns the URL of the remote resource from which this image has been downloaded, or an empty string if this window has not been downloaded from a remote location.
void pcl::ImageWindow::FitWindow | ( | ) |
Adjusts this image window to the minimum size required to show the entire image at the current zoom factor or, if that cannot be achieved, to show the maximum possible portion of the image without exceeding the visible area of its parent workspace in the core application's GUI.
This function will move the window on its parent workspace only if it is strictly necessary.
void pcl::ImageWindow::ForceClose | ( | ) |
Closes this image window unconditionally. The window will be closed immediately without asking questions, irrespective of whether the image or its associated metadata have been modified.
|
static |
Returns the current transparency background brush and its foreground and background colors in the core application's GUI.
[out] | fgColor | The foreground color of the background brush. |
[out] | bgColor | The background color of the background brush. |
The returned value can be identified with the symbolic constants defined int the BackgroundBrush namespace.
The obtained colors are AARRGGBB values. The alpha values are always 0xff, since the background brush cannot be transparent.
In PixInsight, pixel opacity is defined by the first alpha channel of the image: a pixel is opaque if the corresponding alpha channel value is white; a pixel is completely transparent if the corresponding alpha value is black. Intermediate alpha values define semitransparent pixels.
The background brush is a two-color brush used to render transparent regions of images. It is a global object used for all images in the PixInsight core application.
|
static |
Gets the current default image resolution parameters.
[out] | xRes | Reference to a variable where the default horizontal resolution will be stored. |
[out] | yRes | Reference to a variable where the default vertical resolution will be stored. |
[out] | metric | Reference to a variable whose stored value will indicate the current default resolution units. If this variable is true, default resolution is expressed in pixels per centimeter; if it is false, resolution is expressed in pixels per inch. |
Resolution is expressed in pixels per resolution unit (centimeter if metric is true; inch if metric is false).
Default resolution parameters are applied to all newly created images in the PixInsight core application.
|
static |
Obtains a copy of the current global RGB working space (RGBWS) in the PixInsight core application.
[out] | rgbws | Reference to an object where the parameters of the current global RGBWS will be copied. |
The global RGBWS is the default RGBWS that is associated with newly created image windows (both as new images and when images are loaded from disk files). Global RGBWS parameters can be modified by the user through the standard RGBWorkingSpace process in the core application.
bool pcl::ImageWindow::GetICCProfile | ( | ICCProfile & | icc | ) | const |
Obtains a copy of the current ICC profile associated with this image.
[out] | icc | Reference to an object where a copy of the current ICC profile in this image will be stored. |
|
inline |
Obtains a copy of the FITS header keywords currently defined for the image in this window. Returns true if this image has FITS keywords.
[out] | keywords | Reference to a container that will receive a copy of the FITS keywords defined in this image. |
Definition at line 1306 of file ImageWindow.h.
void pcl::ImageWindow::GetResolution | ( | double & | xRes, |
double & | yRes, | ||
bool & | metric | ||
) | const |
Gets the current image resolution parameters in this image window.
[out] | xRes | Reference to a variable where the horizontal resolution will be stored. |
[out] | yRes | Reference to a variable where the vertical resolution will be stored. |
[out] | metric | Reference to a variable whose stored value will indicate the current resolution units in this image window. If this variable is true, resolution is expressed in pixels per centimeter; if it is false, resolution is expressed in pixels per inch. |
Resolution is expressed in pixels per resolution unit (centimeter if metric is true; inch if metric is false).
void pcl::ImageWindow::GetRGBWS | ( | RGBColorSystem & | rgbws | ) | const |
Obtains a copy of the RGB working space (RGBWS) associated with this image window.
[out] | rgbws | Reference to an object where the parameters of the current RGBWS in this window will be copied. |
void pcl::ImageWindow::GetSampleFormat | ( | int & | bitsPerSample, |
bool & | floatSample | ||
) | const |
Retrieves the pixel sample data format used by the image in this window.
[out] | bitsPerSample | On output, will be equal to the number of bits per sample in the image in this window. Can be 8, 16 or 32 for an integer image; 32 or 64 for a floating point image. |
[out] | floatSample | On output, will be true if the image in this window uses floating point samples; false if it uses integer samples. |
void pcl::ImageWindow::GetViewportSize | ( | int & | width, |
int & | height | ||
) | const |
Gets the current sizes of the viewport in this image window.
[out] | width | Reference to a variable where the viewport width in pixels will be stored. |
[out] | height | Reference to a variable where the viewport height in pixels will be stored. |
The provided sizes represent the entire image in this image window, as represented on its viewport after applying the current zoom factor. Viewport sizes can also be thought of as the available navigation ranges in an image window.
Converts a point p in the global coordinate system to the viewport coordinate system. Returns a point with the resulting viewport coordinates.
Definition at line 2693 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
Converts a rectangle r in the global coordinate system to the viewport coordinate system. Returns a rectangle with the resulting viewport coordinates.
Definition at line 2705 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::GlobalToViewport | ( | int & | x, |
int & | y | ||
) | const |
Converts the specified x and y integer coordinates from the global coordinate system to the viewport coordinate system.
The converted viewport coordinates are rounded to the nearest integers.
bool pcl::ImageWindow::HasMaskReferences | ( | ) | const |
Returns true iff this image window is acting as a mask for other image window(s).
bool pcl::ImageWindow::HasPendingUpdates | ( | ) | const |
Returns true iff there are pending viewport updates for this image window.
|
inline |
Returns true iff there are one or more previews currently defined in this image window.
Definition at line 700 of file ImageWindow.h.
|
inline |
Returns true iff this image has been downloaded from a remote location, in which case the source URL can be obtained by calling FileURL().
Definition at line 592 of file ImageWindow.h.
void pcl::ImageWindow::Hide | ( | ) |
Hides this image window if it is currently visible on its parent workspace.
|
inline |
Hides the mask of this image window, i.e. disables mask visibility.
Definition at line 1014 of file ImageWindow.h.
|
inline |
Disables transparency renditions for this image window.
Calling this function is equivalent to:
Definition at line 1907 of file ImageWindow.h.
void pcl::ImageWindow::Iconize | ( | ) |
Iconizes this image window.
void pcl::ImageWindow::ImageScalarToViewport | ( | double * | d, |
size_type | n | ||
) | const |
Converts a set of real floating-point scalars from the image coordinate system to the viewport coordinate system.
d | Pointer to the first element in the array of scalars that will be converted from image coordinates to viewport coordinates. |
n | Number of scalars in the p array. |
double pcl::ImageWindow::ImageScalarToViewport | ( | double | ) | const |
Converts a real floating-point scalar d in the image coordinate system to the viewport coordinate system. Returns the resulting scalar in viewport coordinates.
void pcl::ImageWindow::ImageScalarToViewport | ( | int * | d, |
size_type | n | ||
) | const |
Converts a set of integer scalars from the image coordinate system to the viewport coordinate system.
d | Pointer to the first element in the array of scalars that will be converted from image coordinates to viewport coordinates. |
n | Number of scalars in the p array. |
Converted scalars in viewport coordinates are rounded to the nearest integers.
int pcl::ImageWindow::ImageScalarToViewport | ( | int | ) | const |
Converts an integer scalar d in the image coordinate system to the viewport coordinate system. Returns the resulting scalar in viewport coordinates.
The resulting scalar in viewport coordinates is rounded to the nearest integer.
|
inline |
Converts a set of points in a dynamic array from the image coordinate system to the viewport coordinate system.
a | Reference to a dynamic array of points that will be converted from image coordinates to viewport coordinates. |
Definition at line 2599 of file ImageWindow.h.
|
inline |
Converts a point p in the image coordinate system to the viewport coordinate system. Returns a point with the resulting viewport coordinates.
If the template argument T corresponds to an integer type, the converted viewport coordinates in the resulting point are rounded to the nearest integers.
Definition at line 2542 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
|
inline |
Converts a rectangle r in the image coordinate system to the viewport coordinate system. Returns a rectangle with the resulting viewport coordinates.
If the template argument T corresponds to an integer type, the converted viewport coordinates in the resulting rectangle are rounded to the nearest integers.
Definition at line 2559 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::ImageToViewport | ( | double & | x, |
double & | y | ||
) | const |
Converts the specified x and y real floating-point coordinates from the image coordinate system to the viewport coordinate system.
Converts a set of real floating-point points from the image coordinate system to the viewport coordinate system.
p | Pointer to the first point in the array of points that will be converted from image coordinates to viewport coordinates. |
n | Number of points in the p array. |
void pcl::ImageWindow::ImageToViewport | ( | int & | x, |
int & | y | ||
) | const |
Converts the specified x and y integer coordinates from the image coordinate system to the viewport coordinate system.
The converted viewport coordinates are rounded to the nearest integers.
Converts a set of integer points from the image coordinate system to the viewport coordinate system.
p | Pointer to the first point in the array of points that will be converted from image coordinates to viewport coordinates. |
n | Number of points in the p array. |
Converted point viewport coordinates are rounded to the nearest integers.
|
inline |
Activates or deactivates mask inversion for this image window.
Definition at line 977 of file ImageWindow.h.
bool pcl::ImageWindow::IsACopy | ( | ) | const |
Returns true iff the image in this window has been loaded from a file as a copy.
The File > Save command (and all related menu items) is always disabled for images loaded as copies in the PixInsight core application. This means that the only way to write an image copy is the File > Save As command. This is a security enhancement to avoid File > Save accidents, e.g. by pressing Ctrl+S inattentively. The same applies to the save
command-line internal command, which requires an explicit file path specification for image copies.
|
inline |
Returns true iff the current display channel (in the core application) corresponds to an alpha channel of the image in the current view.
Definition at line 1756 of file ImageWindow.h.
bool pcl::ImageWindow::IsColorManagementEnabled | ( | ) | const |
Returns true iff color management is active for this image window.
|
static |
Returns true iff default ICC profile embedding is globally enabled for grayscale images in the PixInsight core application.
Modules implementing file format support may call this function to provide coherent default states for ICC profile embedding selectable options in their interfaces; e.g. "Embed ICC Profile" check boxes on format options dialogs presented to the user during file write operations. However, the PixInsight core application always provides coherent default states for all embedding flags to all modules, so this function is not frequently used.
|
static |
Returns true iff default ICC profile embedding is globally enabled for RGB images in the PixInsight core application.
Modules implementing file format support may call this function to provide coherent default states for ICC profile embedding selectable options in their interfaces; e.g. "Embed ICC Profile" check boxes on format options dialogs presented to the user during file write operations. However, the PixInsight core application always provides coherent default states for all embedding flags to all modules, so this function is not frequently used.
|
static |
Returns true iff default properties embedding is globally enabled in the PixInsight core application.
Modules implementing file formats should call this function to provide coherent default states for properties embedding selectable options in their interfaces; e.g. "Embed Properties" check boxes on dialogs presented to the user to gather file and format-specific options during file write operations.
|
static |
Returns true iff default thumbnail embedding is globally enabled in the PixInsight core application.
Modules implementing file formats should call this function to provide coherent default states for thumbnail embedding selectable options in their interfaces; e.g. "Embed Thumbnail" check boxes on dialogs presented to the user to gather file and format-specific options during file write operations.
|
static |
Returns true iff a dynamic session is currently active in the core PixInsight application.
A dynamic session is active if there is a processing interface working in dynamic mode, and one or more views have been selected by the active dynamic interface as dynamic targets.
bool pcl::ImageWindow::IsGamutCheckEnabled | ( | ) | const |
Returns true iff the gamut check soft-proofing feature is currently enabled for this image window.
bool pcl::ImageWindow::IsIconic | ( | ) | const |
Returns true iff this image window is iconic.
bool pcl::ImageWindow::IsMaskCompatible | ( | const ImageWindow & | ) |
Returns true iff a specified image window could be selected as a mask for this image window.
For a given image M to be a valid mask for an image I:
bool pcl::ImageWindow::IsMaskEnabled | ( | ) | const |
Returns true iff the mask is current enabled for this image window.
bool pcl::ImageWindow::IsMaskInverted | ( | ) | const |
Returns true iff mask inversion is currently active for this image window.
bool pcl::ImageWindow::IsMaskVisible | ( | ) | const |
Returns true iff the mask is currently visible for this image window.
|
inline |
Returns true iff the image in this image window has been modified and is unsaved. An image is modified if its modification counter is not zero.
Definition at line 614 of file ImageWindow.h.
bool pcl::ImageWindow::IsNew | ( | ) | const |
Returns true iff the image in this window has not been loaded from a disk file, but created as a new image in the core application (e.g., by the NewImage standard process).
bool pcl::ImageWindow::IsProofingEnabled | ( | ) | const |
Returns true iff soft-proofing is currently enabled for this image window.
bool pcl::ImageWindow::IsSelection | ( | ) | const |
Returns true iff an interactive selection procedure is currently active on the viewport of this image window.
|
inline |
Returns true iff transparent image areas are currently visible for this image window.
Transparencies are visible if the current rendering mode is not TransparencyMode::Hide.
Definition at line 1881 of file ImageWindow.h.
bool pcl::ImageWindow::IsValidView | ( | const View & | ) | const |
Returns true iff the specified view is a view of this image window, that is, either the main view of this image window, or one of its previews.
bool pcl::ImageWindow::IsVisible | ( | ) | const |
Returns true iff this image window is currently visible.
FITSKeywordArray pcl::ImageWindow::Keywords | ( | ) | const |
Returns a copy of the FITS header keywords currently defined for the image in this window. Returns an empty array if this image has no FITS keywords.
View pcl::ImageWindow::MainView | ( | ) | const |
Returns the main view of this image window.
The main view holds the entire image of this window. There is only one main view in an image window.
ImageWindow pcl::ImageWindow::Mask | ( | ) | const |
Returns the image window that is currently acting as a mask for this window, or ImageWindow::Null() if this window has no assigned mask.
mask_mode pcl::ImageWindow::MaskMode | ( | ) | const |
Returns the current mask rendering mode for this image window.
Supported mask rendering modes are defined in the MaskMode namespace.
size_type pcl::ImageWindow::ModifyCount | ( | ) | const |
Returns the modification counter for this image window. The modification counter contains the amount of changes made to the image since it was created, loaded from a disk file, or saved to a disk file.
|
inline |
Modifies the identifier and rectangular area properties of an existing preview.
Calling this function is equivalent to:
Definition at line 828 of file ImageWindow.h.
void pcl::ImageWindow::ModifyPreview | ( | const IsoString & | previewId, |
int | x0, | ||
int | y0, | ||
int | x1, | ||
int | y1, | ||
const IsoString & | newId = IsoString() |
||
) |
Modifies the identifier and rectangular area properties of an existing preview.
previewId | Identifier of a preview whose properties will be modified. |
x0,y0 | Position (horizontal, vertical) of the left-top corner of the new preview rectangle in image coordinates. |
x1,y1 | Position (horizontal, vertical) of the right-bottom corner of the new preview rectangle in image coordinates. |
newId | New preview identifier. If an empty string is specified, this function will not modify the current preview identifier. If the specified identifier is already in use in this window, the core application will make it unique by appending an automatically generated suffix. |
The preview rectangle must define a rectangular area of at least one pixel, completely included in the boundaries of the image in this window.
Updates an ongoing interactive rectangular selection procedure on the viewport of this image window.
Calling this function is equivalent to:
Definition at line 2960 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
void pcl::ImageWindow::ModifySelection | ( | int | x, |
int | y, | ||
uint32 | flags = 0 |
||
) |
Updates an ongoing interactive rectangular selection procedure on the viewport of this image window.
x,y | Image coordinates to update the current rectangular selection. The selection rectangle is defined by this position and the starting position defined in the call to BeginSelection() that originated the current selection procedure. |
flags | Currently not used; reserved for future extensions of PCL. Must be set to zero. |
|
static |
Returns a reference to a null ImageWindow instance. A null ImageWindow does not correspond to an existing image window in the PixInsight core application.
int pcl::ImageWindow::NumberOfPreviews | ( | ) | const |
Returns the number of previews currently defined in this image window.
|
static |
Opens an image file and loads one or more images into new image windows.
url | A path specification or URL that points to an image file to be loaded by the PixInsight core application. The file name must include a file extension, since it is the only way to select a file format, necessary to read and decode images. |
id | Identifier for the new image(s). If an empty string is specified, the application will assign an automatically generated identifier. If the specified identifier is not unique, the application will make it unique by appending an automatically generated suffix. This parameter is an empty string by default. |
formatHints | A string of format hints that will be sent to the file format instance created to load the image. Format hints are useful to modify the behavior of a file format suuport module lo load a specific image, overriding global preferences and format settings. See the FileFormatInstance::Open() member function for more information on format hints. This parameter is an empty string by default. |
asCopy | True to open the images as copies. The File > Save command (and all related menu items) is always disabled for images loaded as copies in the PixInsight core application. This means that the only way to write an image copy is the File > Save As command. This is a security enhancement to avoid File > Save accidents, e.g. by pressing Ctrl+S inattentively. The same applies to the save internal command-line command, which requires an explicit file path specification for image copies. This parameter is false by default. |
allowMessages | True to allow the core application to show warning message boxes (e.g., to inform about inexact read operations) and color management dialog boxes (upon ICC profile mismatches or missing ICC profiles). If this parameter is false, no dialog box or warning message box will be shown, and default actions will be taken as appropriate for conflicting ICC profiles. However, all warning messages will be sent to the processing console when this parameter is false. Error messages will always be shown. This parameter is true by default. |
The PixInsight core application will find and select a file format to read the specified image file, among the installed file format modules. Format selection is exclusively a function of the specified file extension (e.g., .fit will select the FITS format, .tif the TIFF format, .jpg for JPEG, and so on).
File and directory paths in the PixInsight environment employ UNIX directory separators (the slash character, '/') on all supported platforms. As an exception, on Windows PCL allows you to use also DOS separators (backslash, '\'), but their use is discouraged since its support might be discontinued in future PCL versions.
URLs must be valid and conform to the URI specification from RFC 3986 (Uniform Resource Identifier: Generic Syntax). At least the file, HTTP, HTTPS, FTP and FTPS protocols are supported. More protocols may be available, depending on PixInsight core versions.
Returns an array of ImageWindow objects. Each object in the array corresponds to an image loaded into a new image window from the specified file. In general, the returned array will contain only one object, since most image file formats can store just a single image. For formats that can store multiple images, more than one ImageWindow can be created as a result of opening a single file.
Newly created image windows will be hidden. To make them visible on the core application's workspace, you must call their ImageWindow::Show() member function explicitly.
|
inline |
Copy assignment operator. Detaches this object from its previously referenced server-side image window and makes it an alias of the specified window. Returns a reference to this object.
When this operator is used, the calling object is detached from the previously referenced window. Note that an image window cannot be destroyed when it becomes unreferenced, as it is an internal UI object that belongs to the core application, not to the calling module, even if the window has been created by the calling module.
Definition at line 437 of file ImageWindow.h.
|
inline |
Move assignment operator. Returns a reference to this object.
Definition at line 446 of file ImageWindow.h.
Finds a preview by its identifier. If the specified previewId identifier corresponds to an existing preview in this image window, it is returned as a View object. If no preview in this image window has the specified previewId identifier, or if this window has no previews, this function returns an alias of View::Null().
|
inline |
Returns true if a preview with the specified previewId identifier is currently defined in this image window; false if no preview with such identifier exists in this window, or if this window has no previews.
Definition at line 731 of file ImageWindow.h.
Returns the rectangular area in image coordinates of a preview with the specified previewId identifier.
If no preview is defined in this window with the specified identifier, this function returns an empty rectangle.
Returns a dynamic array of View objects corresponding to the previews currently defined in this image window. If this window has no previews, an empty array is returned.
void pcl::ImageWindow::PurgeProperties | ( | ) |
Destroys all existing properties for all views in this image window.
void pcl::ImageWindow::Regenerate | ( | ) |
Regenerates the screen rendition for the visible viewport region in this image window. This includes regeneration of screen renditions depending on active dynamic interfaces.
|
inline |
Regenerates the screen rendition for a rectangular region of the viewport, specified in image coordinates.
Calling this function is equivalent to:
Definition at line 2770 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::RegenerateImageRect | ( | double | x0, |
double | y0, | ||
double | x1, | ||
double | y1 | ||
) |
Regenerates the screen rendition for a rectangular region of the viewport, specified in image coordinates.
x0,y0 | Image coordinates (horizontal, vertical) of the upper left corner of the regenerated region. |
x1,y1 | Image coordinates (horizontal, vertical) of the lower right corner of the regenerated region. |
The specified region will be updated on the screen. Only the visible portion of the specified region will be regenerated and updated, that is, its intersection with the visible viewport region.
|
inline |
Regenerates the screen rendition for a rectangular region of the viewport, specified in viewport coordinates.
Calling this function is equivalent to:
Definition at line 2741 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::RegenerateViewportRect | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1 | ||
) |
Regenerates the screen rendition for a rectangular region of the viewport, specified in viewport coordinates.
x0,y0 | Viewport coordinates (horizontal, vertical) of the upper left corner of the regenerated region. |
x1,y1 | Viewport coordinates (horizontal, vertical) of the lower right corner of the regenerated region. |
The specified region will be updated on the screen. Only the visible portion of the specified region will be regenerated and updated, that is, its intersection with the visible viewport region.
|
inline |
Removes the current mask selection of this image window.
Definition at line 964 of file ImageWindow.h.
void pcl::ImageWindow::RemoveMaskReferences | ( | ) |
Removes all mask references for this image window.
All images that were masked by this window will be unmasked after calling this function. Use it with great care, since removing masking relations without direct user intervention is potentially dangerous.
|
inline |
Causes a complete regeneration of the whole viewport and its associated UI resources.
Calling this function may be necessary to force a regeneration after changing the geometry of the image in the current view of this image window.
Definition at line 2721 of file ImageWindow.h.
|
inline |
Restores the default shape of the pointing device's cursor for the active dynamic session.
Definition at line 2345 of file ImageWindow.h.
References pcl::Bitmap::Null().
void pcl::ImageWindow::ResetKeywords | ( | ) |
Deletes all existing FITS header keywords in this image window.
void pcl::ImageWindow::SelectChannel | ( | display_channel | c | ) |
Selects the current display channel in the core application's GUI.
c | Specifies the new display channel. Supported display channels are identified through symbolic constants defined in the DisplayChannel namespace. |
Not all display channels are valid for all images in all contexts. For example, if the image in the current view is a grayscale image, the only valid display channels are the combined RGB/K channel (DisplayChannel::RGBK) and, if the image has n alpha channels, values in the range DisplayChannel::Alpha to DisplayChannel::Alpha+n-1. If an invalid display channel is specified, this function is simply ignored.
View pcl::ImageWindow::SelectedPreview | ( | ) | const |
Returns the currently selected preview, or an alias of View::Null() if no preview is currently selected in this image window.
Returns the current rectangular selection in image coordinates.
flags | Currently not used; reserved for future extensions of PCL. Must be set to nullptr. |
Before calling this function, a rectangular selection procedure should have been started with BeginSelection().
|
inline |
Selects the main view as the current view in this image window.
Definition at line 675 of file ImageWindow.h.
|
static |
Sets the current GUI working mode in the PixInsight core application.
mode | Specifies the new GUI mode. Supported modes are identified through symbolic constants defined in the ImageMode namespace. |
Not all GUI modes are valid in all contexts. For example, if the current view is a preview, the New Preview mode cannot be selected. If the specified mode is not currently valid, this function is simply ignored.
|
inline |
Causes this window to select the view with the specified identifier as its current selected preview. Refer to the SelectedPreview() function for further information on the concept of selected preview.
Definition at line 766 of file ImageWindow.h.
void pcl::ImageWindow::SelectPreview | ( | View & | ) |
Causes this window to select the specified view as its selected preview. Refer to the SelectedPreview() function for further information on the concept of selected preview.
void pcl::ImageWindow::SelectView | ( | View & | ) |
Selects the specified view as the current view in this image window.
void pcl::ImageWindow::SendToBack | ( | ) |
Pushes this image window to the bottom of the stack of image windows in its parent workspace of the PixInsight core application's GUI.
If this is the only visible image window in its parent workspace, calling this function has no effect. If there are more visible image windows in the parent workspace and it is the current workspace, calling this function implicitly deactivates this image window and gives the keyboard focus to the new topmost image window in the window stack.
|
static |
Sets the transparency background brush in the core application's GUI.
brush | Specifies the new background brush that will be used to render transparent regions of images. Supported background brushes are identified through symbolic constants defined in the BackgroundBrush namespace. |
fgColor | New foreground color for the background brush. If zero is specified (the default value), the current foreground color will not be changed. |
bgColor | New background color for the background brush. If zero is specified (the default value), the current background color will not be changed. |
For a definition of background brushes and their meaning in PixInsight, see the documentation of GetBackgroundBrush().
void pcl::ImageWindow::SetColorManagementFeatures | ( | bool | cmEnabled, |
bool | proofing, | ||
bool | gamutCheck | ||
) |
Allows enabling or disabling all color management features at once.
cmEnabled | Enables (if true) or disables (if false) color management for this image window. |
proofing | Enables (if true) or disables (if false) soft-proofing for this image window. |
gamutCheck | Enables (if true) or disables (if false) the gamut check proofing feature for this image window. The state of this argument has no meaning if the proofing parameter is false. |
If this image window is visible, its screen rendition is updated immediately after calling this function.
Sets the shape of the pointing device's cursor for the active dynamic session as a RGBA bitmap.
Calling this function is equivalent to:
Definition at line 2336 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
void pcl::ImageWindow::SetDynamicCursor | ( | const Bitmap & | bmp, |
int | hx = 0 , |
||
int | hy = 0 |
||
) |
Sets the shape of the pointing device's cursor for the active dynamic session as an ARGB bitmap.
bmp | Reference to a bitmap that will be used as the new cursor shape for the Dynamic Operation GUI mode. |
hx,hy | Coordinates (horizontal, vertical) of the cursor hot spot relative to the upper left corner of the specified cursor shape bitmap. |
If there is no active dynamic session, this function is ignored.
Modules call this function to adapt the cursor shape to specific interactive operations during dynamic sessions. Custom cursor shapes must be used by dynamic interfaces to provide accurate and meaningful feedback to the user.
The specified cursor shape will be used in the Dynamic Operation working GUI mode. It will not affect standard cursor shapes used by the GUI in other working modes (as Readout, Zoom In, etc).
|
inline |
Sets the shape of the pointing device's cursor for the active dynamic session as an image in the XPM format.
Calling this function is equivalent to:
Definition at line 2299 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
void pcl::ImageWindow::SetDynamicCursor | ( | const char ** | xpm, |
int | hx = 0 , |
||
int | hy = 0 |
||
) |
Sets the shape of the pointing device's cursor for the active dynamic session as an image in the XPM format.
xpm | Address of an image in the XPM format, which will be used as the new cursor shape in Dynamic Operation GUI mode. |
hx,hy | Coordinates (horizontal, vertical) of the cursor hot spot relative to the upper left corner of the specified cursor shape image. |
See the documentation for SetDynamicCursor( const Bitmap&, int, int ) for more information on dynamic mode cursors.
|
static |
Sets the parameters of the global RGB working space (RGBWS) in the core PixInsight application.
rgbws | Reference to an object whose parameters will be copied to the global RGBWS. |
See the documentation for GetGlobalRGBWS() for a description of the global RGBWS in PixInsight.
void pcl::ImageWindow::SetICCProfile | ( | const ICCProfile & | icc | ) |
Sets the current ICC profile for this image window as a copy of an existing ICC profile.
icc | Reference to an object that will be used to set the current ICC profile for this image. |
If this image window is visible and has color management enabled, its screen rendition is updated immediately after calling this function.
void pcl::ImageWindow::SetICCProfile | ( | const String & | filePath | ) |
Sets the current ICC profile for this image window as a copy of an ICC profile loaded from a disk file.
filePath | A file path specification to an ICC profile that will be loaded and copied to the ICC profile of this image window. |
If this image window is visible and has color management enabled, its screen rendition is updated immediately after calling this function.
void pcl::ImageWindow::SetKeywords | ( | const FITSKeywordArray & | keywords | ) |
Sets the FITS header keywords for this image as a copy of the set of keywords in the specified container.
keywords | Reference to a FITS keyword array whose contents will be copied to the list of FITS keywords of this image. |
The previous set of FITS keywords in this image, if any, is lost and replaced by the specified set.
void pcl::ImageWindow::SetMask | ( | ImageWindow & | w, |
bool | inverted = false |
||
) |
Selects an image as the current mask for this image window.
w | Reference to an image window whose image will be selected as a mask for this window. |
inverted | True to activate mask inversion. |
void pcl::ImageWindow::SetMaskMode | ( | mask_mode | mode | ) |
Sets the current mask rendering mode for this image window.
mode | Specifies the new mode that will be used to render masks. Supported mask rendition modes are identified through symbolic constants defined in the MaskMode namespace. |
|
inline |
Sets equal image resolution parameters for both axes in this image window.
r | Resolution in pixels per resolution unit. This value is to be applied to both axes (horizontal, vertical) of the image in this window. |
metric | Indicates the resolution unit in which resolution is expressed. If this parameter is true, resolution is expressed in pixels per centimeter; if it is false, resolution is in pixels per inch. |
Definition at line 1588 of file ImageWindow.h.
void pcl::ImageWindow::SetResolution | ( | double | xRes, |
double | yRes, | ||
bool | metric = false |
||
) |
Sets image resolution parameters for this image window.
xRes | Horizontal resolution in pixels per resolution unit. Must be > 0. |
yRes | Vertical resolution in pixels per resolution unit. Must be > 0. |
metric | Indicates the resolution unit in which resolution is expressed for both axes. If this parameter is true, resolution is expressed in pixels per centimeter; if it is false, resolution is in pixels per inch. |
void pcl::ImageWindow::SetRGBWS | ( | const RGBColorSystem & | rgbws | ) |
Sets the RGB working space (RGBWS) for this image window.
rgbws | Reference to a RGBWS that will be associated with this image window. |
void pcl::ImageWindow::SetSampleFormat | ( | int | bitsPerSample, |
bool | floatSample | ||
) |
Converts the image in this window to the specified sample data format.
bitsPerSample | Number of bits per sample. Can be 8, 16 or 32 for an integer image; 32 or 64 for a floating point image. |
floatSample | True to transform this image to a floating point data format; false to transform this image to an integer data format. |
This function does nothing if the image in this window already has the specified sample data format.
|
static |
Attempts to set a new list of directories for storage of swap files.
To be able to set a new list of directories for swap file storage, a module must have enough privileges to change global settings on the PixInsight platform. If the calling module has insufficient privileges, this function returns false and no changes are done.
The specified list can contain zero or more path specifications to existing directories. If the specified list is empty, the PixInsight platform will perform a reset of the swap directories list to its default settings. This usually means that all swap files will be generated and maintained on the system's temporary storage directory (the value of the TEMP or TMP environmental variables by default) using single-threaded disk I/O operations.
void pcl::ImageWindow::SetTransparencyMode | ( | transparency_mode | mode, |
RGBA | color = 0 |
||
) |
Sets the current transparency rendering mode for this image window.
mode | Specifies the new mode that will be used to render transparent regions of images. Supported transparency modes are identified through symbolic constants defined in the TransparencyMode namespace. |
color | New color that will be used when the transparency mode is TransparencyMode::Color. If zero is specified (the default value), the current color will not be changed. |
|
inline |
Sets new viewport central location and zoom factor for this image window.
Calling this function is equivalent to:
See the documentation for SetViewport( double, double, int ).
Definition at line 1969 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
void pcl::ImageWindow::SetViewport | ( | double | cx, |
double | cy, | ||
int | zoom = 0 |
||
) |
Sets new viewport central location coordinates and zoom factor for this image window.
cx,cy | Position (horizontal, vertical) of the new central viewport location in image coordinates. |
zoom | New viewport zoom factor. Positive zoom factors are interpreted as magnifying factors; negative zoom factors are reduction factors: |
Zoom Factor Screen Zoom (screen pixels : image pixels) =========== ========================================== 0 Current zoom factor (no change) 1 or -1 1:1 (actual pixels) 2 2:1 (x2 magnification) 3 3:1 (x3 magnification) ... -2 1:2 (1/2 reduction) -3 1:3 (1/3 reduction) ...
If the specified viewport location cannot correspond to the viewport central position with the specified zoom factor, the nearest image coordinates are always selected automatically. For example, if you pass image coordinates cx=0 and cy=0 as arguments to this function, the GUI will set the viewport center to the necessary image location in order to display the upper left corner of the image just at the upper left corner of the viewport.
If the zoom argument is not specified, the current zoom factor of the active view is not changed since the default value of this parameter is zero; see the table above.
If this image window is visible, calling this function causes an immediate regeneration of the screen rendition for the visible viewport region. This includes regeneration of screen renditions depending on active dynamic interfaces.
|
inline |
Sets the viewport position in this image window to the specified position p in viewport coordinates.
Calling this function is equivalent to:
Definition at line 2127 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
void pcl::ImageWindow::SetViewportPosition | ( | int | x, |
int | y | ||
) |
Sets the viewport position in this image window to the specified x and y viewport coordinates.
If this image window is visible, calling this function causes an immediate regeneration of the screen rendition for the visible viewport region. This includes regeneration of screen renditions depending on active dynamic interfaces.
void pcl::ImageWindow::SetZoomFactor | ( | int | z | ) |
Sets the zoom factor for the viewport in this image window to the specified value z.
To learn how zoom factors are interpreted in PixInsight, see the documentation for SetViewport( double, double, int ).
void pcl::ImageWindow::Show | ( | bool | fitWindow = true | ) |
Shows this image window on its parent workspace.
fitWindow | If true, this function will call ZoomToFit() with default parameters after showing the window on its parent workspace. This is useful to ensure that a newly created image window will be displayed optimally as soon as it is shown for the first time. This option is enabled by default. |
Image windows are normally visible in PixInsight. Under normal working conditions, an image window can only be hidden if it has never been shown since it was created, or if it has been hidden explicitly, which can only happen programmatically.
void pcl::ImageWindow::ShowMask | ( | bool | = true | ) |
Shows the mask of this image window, i.e. enables mask visibility.
|
static |
Returns the current list of directories for storage of swap image files.
Swap files are generated and maintained by the PixInsight core application to store temporary image data. By default, the returned list contains a single string with the system's temporary storage directory (usually the value of the TEMP or TMP environmental variables).
When the returned list contains two or more directories, PixInsight uses parallel disk I/O operations to store and retrieve swap files, which greatly improves performance of history traversal operations, such as image undo/redo operations.
|
static |
Terminates the current dynamic session, if there is one active, and optionally closes the active dynamic interface.
If the calling module is the owner of the active dynamic interface, the dynamic session is terminated immediately.
If the calling module is not the owner of the active dynamic interface (i.e., if the active dynamic interface is a foreign object for the calling module), then the PixInsight core application will ask the user if it is ok to terminate the active dynamic session, providing complete information about the calling module. This is a security enforcement procedure.
RGBA pcl::ImageWindow::TransparencyColor | ( | ) | const |
Returns the color to be used in this image window to render transparent image regions, when the transparency mode is TransparencyMode::Color.
The returned color is an AARRGGBB value. The alpha value is always 0xff, since the transparency background cannot be transparent.
transparency_mode pcl::ImageWindow::TransparencyMode | ( | ) | const |
Returns the current transparency rendering mode for this image window.
Supported transparency modes are defined in the TransparencyMode namespace.
|
inline |
Requests a screen update for a rectangular region of the viewport, specified in image coordinates.
Calling this function is equivalent to:
Definition at line 2834 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::UpdateImageRect | ( | double | x0, |
double | y0, | ||
double | x1, | ||
double | y1 | ||
) |
Requests a screen update for a rectangular region of the viewport, specified in image coordinates.
x0,y0 | Image coordinates (horizontal, vertical) of the upper left corner of the update region. |
x1,y1 | Image coordinates (horizontal, vertical) of the lower right corner of the update region. |
The specified region will be updated on the screen. Only the visible portion of the specified region will be updated, that is, its intersection with the visible viewport region in the image coordinate system.
void pcl::ImageWindow::UpdateMaskReferences | ( | ) |
Updates the screen renditions of all visible image windows that are currently masked by this window. This includes only masked image windows with enabled mask visibility.
void pcl::ImageWindow::UpdateSelection | ( | ) |
Requests a screen viewport update for the current rectangular selection.
void pcl::ImageWindow::UpdateViewport | ( | ) |
Requests a screen update for the entire visible viewport region in this image window.
|
inline |
Requests a screen update for a rectangular region of the viewport, specified in viewport coordinates.
Calling this function is equivalent to:
Definition at line 2805 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::UpdateViewportRect | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1 | ||
) |
Requests a screen update for a rectangular region of the viewport, specified in viewport coordinates.
x0,y0 | Viewport coordinates (horizontal, vertical) of the upper left corner of the update region. |
x1,y1 | Viewport coordinates (horizontal, vertical) of the lower right corner of the update region. |
The specified region will be updated on the screen. Only the visible portion of the specified region will be updated, that is, its intersection with the visible viewport region.
void pcl::ImageWindow::UseGlobalRGBWS | ( | ) |
Associates this image window with the global RGB working space.
See the documentation for GetGlobalRGBWS() for a description of the global RGBWS in PixInsight.
bool pcl::ImageWindow::UsingGlobalRGBWS | ( | ) | const |
Returns true iff this image window is associated with the global RGB working space (RGBWS).
See the documentation for GetGlobalRGBWS() for a description of the global RGBWS in PixInsight.
Returns a RGBA bitmap with a screen rendition of a viewport region of this image window.
Calling this function is equivalent to:
Definition at line 2895 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
Returns a RGBA bitmap with a screen rendition of a viewport region of this image window.
x0,y0 | Viewport coordinates (horizontal, vertical) of the upper left corner of the source viewport region. |
x1,y1 | Viewport coordinates (horizontal, vertical) of the lower right corner of the source viewport region. |
flags | Currently not used; reserved for future extensions of PCL. Must be set to zero. |
The returned bitmap will contain a screen rendition for the specified source region of the image in the current view of this image window. It will be magnified or reduced according to the current zoom factor. It will not contain auxiliary vectorial elements (as preview rectangles), or other renditions of any kind that depend on active dynamic interfaces.
|
inline |
Gets the current height of the viewport in this image window.
Definition at line 2090 of file ImageWindow.h.
Point pcl::ImageWindow::ViewportPosition | ( | ) | const |
Returns the current viewport position in this image window.
The viewport position corresponds to the viewport coordinates of the upper left corner of the visible viewport region. These coordinates can be negative if the represented image is smaller than the size of the viewport control, that is, when the extended viewport space is visible around the screen rendition of the image.
void pcl::ImageWindow::ViewportScalarToImage | ( | double * | d, |
size_type | n | ||
) | const |
Converts a set of real floating-point scalars from the viewport coordinate system to the image coordinate system.
d | Pointer to the first element in the array of scalars that will be converted from viewport coordinates to image coordinates. |
n | Number of scalars in the p array. |
double pcl::ImageWindow::ViewportScalarToImage | ( | double | d | ) | const |
Converts a scalar d in the viewport coordinate system to the image coordinate system. Returns the resulting floating point real scalar in image coordinates.
void pcl::ImageWindow::ViewportScalarToImage | ( | int * | d, |
size_type | n | ||
) | const |
Converts a set of integer scalars from the viewport coordinate system to the image coordinate system.
d | Pointer to the first element in the array of scalars that will be converted from viewport coordinates to image coordinates. |
n | Number of scalars in the p array. |
Converted scalars in image coordinates are rounded to the nearest integers.
|
inline |
Converts a scalar d in the viewport coordinate system to the image coordinate system. Returns the resulting floating point real scalar in image coordinates.
Definition at line 2513 of file ImageWindow.h.
Converts a point p in the viewport coordinate system to the global coordinate system. Returns a point with the resulting global coordinates.
Definition at line 2660 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
Converts a rectangle r in the viewport coordinate system to the global coordinate system. Returns a rectangle with the resulting global coordinates.
Definition at line 2672 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::ViewportToGlobal | ( | int & | x, |
int & | y | ||
) | const |
Converts the specified x and y integer coordinates from the viewport coordinate system to the global coordinate system.
The converted global coordinates are rounded to the nearest integers.
|
inline |
Converts a set of points in a dynamic array from the viewport coordinate system to the image coordinate system.
a | Reference to a dynamic array of points that will be converted from viewport coordinates to image coordinates. |
Definition at line 2468 of file ImageWindow.h.
|
inline |
Converts a point p in the viewport coordinate system to the image coordinate system. Returns a point with the resulting floating point real image coordinates.
Definition at line 2415 of file ImageWindow.h.
References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.
|
inline |
Converts a rectangle r in the viewport coordinate system to the image coordinate system. Returns a rectangle with the resulting floating point real image coordinates.
Definition at line 2428 of file ImageWindow.h.
References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.
void pcl::ImageWindow::ViewportToImage | ( | double & | x, |
double & | y | ||
) | const |
Converts the specified x and y real floating point coordinates from the viewport coordinate system to the image coordinate system.
Converts a set of real floating-point points from the viewport coordinate system to the image coordinate system.
p | Pointer to the first point in the array of points that will be converted from viewport coordinates to image coordinates. |
n | Number of points in the p array. |
void pcl::ImageWindow::ViewportToImage | ( | int & | x, |
int & | y | ||
) | const |
Converts the specified x and y integer coordinates from the viewport coordinate system to the image coordinate system.
The converted image coordinates are rounded to the nearest integers.
Converts a set of integer points from the viewport coordinate system to the image coordinate system.
p | Pointer to the first point in the array of points that will be converted from viewport coordinates to image coordinates. |
n | Number of points in the p array. |
Converted point image coordinates are rounded to the nearest integers.
Rect pcl::ImageWindow::ViewportUpdateRect | ( | ) | const |
Returns a rectangle in viewport coordinates that includes all pending viewport update regions for this image window.
|
inline |
Gets the current width of the viewport in this image window.
Definition at line 2080 of file ImageWindow.h.
|
inline |
Returns the height in pixels of the current visible viewport region in this image window.
Definition at line 2154 of file ImageWindow.h.
Rect pcl::ImageWindow::VisibleViewportRect | ( | ) | const |
Gets the current visible viewport region in this image window.
The returned rectangle corresponds to the visible region of the image in viewport coordinates. It depends on the current viewport zoom factor and on the positions of the viewport's scroll bars, if they are visible.
|
inline |
Returns the width in pixels of the current visible viewport region in this image window.
Definition at line 2145 of file ImageWindow.h.
|
static |
Returns the image window where the specified file path has been loaded. If no image has been loaded from the specified path, this function returns ImageWindow::Null().
|
static |
Returns a image window with the specified image identifier. If no image exists with the specified identifier, this function returns ImageWindow::Null().
int pcl::ImageWindow::ZoomFactor | ( | ) | const |
Returns the current zoom factor in the viewport of this image window.
To learn how zoom factors are interpreted in PixInsight, see the documentation for SetViewport( double, double, int ).
|
inline |
Increments the current zoom factor for the viewport in this image window.
To learn how zoom factors are interpreted in PixInsight, see the documentation for SetViewport( double, double, int ).
Definition at line 2043 of file ImageWindow.h.
|
inline |
Decrements the current zoom factor for the viewport in this image window.
To learn how zoom factors are interpreted in PixInsight, see the documentation for SetViewport( double, double, int ).
Definition at line 2055 of file ImageWindow.h.
void pcl::ImageWindow::ZoomToFit | ( | bool | optimalFit = true , |
bool | allowMagnification = true , |
||
bool | allowAnimations = true , |
||
bool | noLimits = false |
||
) |
Selects the largest viewport zoom factor that allows showing the entire image in this image window, changing its size as necessary, but not its position on its parent workspace.
optimalFit | If true, the PixInsight core application will try to find an optimal zoom factor to fit the entire image window within the visible area of its parent workspace without causing too much obstruction of sibling windows and icons. This option is enabled by default. |
allowMagnification | If false, this function will not select a zoom factor greater than one, even if doing so would be possible for this window without exceeding the visible area of its parent workspace. This option is true by default. |
allowAnimations | If false, no graphical animation effects (such as fading effects) will be applied to the image window when resized, bypassing global preferences settings. Animations are enabled by default. |
noLimits | If true, the window will be resized ignoring the current maximization limit set for its parent workspace, making possible to occupy the entire visible area of the workspace, just to the limits of the main application window. This option is disabled by default. |