52 #ifndef __PCL_ImageView_h
53 #define __PCL_ImageView_h
57 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
87 using gui_mode = ImageMode::value_type;
94 using display_channel = DisplayChannel::value_type;
101 using background_brush = BackgroundBrush::value_type;
108 using transparency_mode = TransparencyMode::value_type;
145 int width = 0,
int height = 0,
int numberOfChannels = 1,
146 int bitsPerSample = 32,
bool floatSample =
true,
bool color =
false );
183 int w, dum; GetImageGeometry( w, dum, dum );
return w;
191 int dum, h; GetImageGeometry( dum, h, dum );
return h;
202 int w, h, dum; GetImageGeometry( w, h, dum );
return Rect( w, h );
293 EnableColorManagement( !disable );
328 EnableProofing( !disable );
367 EnableGamutCheck( !disable );
475 return CurrentChannel() >= DisplayChannel::Alpha;
489 return CurrentChannel() - DisplayChannel::Alpha;
535 return TransparencyMode() != pcl::TransparencyMode::Hide;
561 SetTransparencyMode( pcl::TransparencyMode::Hide );
621 SetViewport( center.
x, center.
y, zoom );
651 int z = ZoomFactor() + 1;
652 SetZoomFactor( (z > 0) ? z : +1 );
664 int z = ZoomFactor() - 1;
665 SetZoomFactor( (z > 0 || z < -1) ? z : -2 );
690 GetViewportSize( w, dum );
700 GetViewportSize( dum, h );
734 SetViewportPosition( p.
x, p.
y );
752 return VisibleViewportRect().Width();
761 return VisibleViewportRect().Height();
783 template <
typename T>
787 ViewportToImage( p1.
x, p1.
y );
796 template <
typename T>
800 ViewportToImage( r1.
x0, r1.
y0 );
801 ViewportToImage( r1.
x1, r1.
y1 );
836 template <
typename T>
839 ViewportToImage( a.Begin(), a.Length() );
881 template <
typename T>
884 return ViewportScalarToImage(
double( d ) );
910 template <
typename T>
914 ImageToViewport( p1.
x, p1.
y );
927 template <
typename T>
931 ImageToViewport( r1.
x0, r1.
y0 );
932 ImageToViewport( r1.
x1, r1.
y1 );
967 template <
typename T>
970 ImageToViewport( a.Begin(), a.Length() );
1032 ViewportToGlobal( p1.
x, p1.
y );
1044 ViewportToGlobal( r1.
x0, r1.
y0 );
1045 ViewportToGlobal( r1.
x1, r1.
y1 );
1065 GlobalToViewport( p1.
x, p1.
y );
1077 GlobalToViewport( r1.
x0, r1.
y0 );
1078 GlobalToViewport( r1.
x1, r1.
y1 );
1091 SetZoomFactor( ZoomFactor() );
1110 RegenerateViewportRect( r.
x0, r.
y0, r.
x1, r.
y1 );
1139 RegenerateImageRect( r.
x0, r.
y0, r.
x1, r.
y1 );
1174 UpdateViewportRect( r.
x0, r.
y0, r.
x1, r.
y1 );
1203 UpdateImageRect( r.
x0, r.
y0, r.
x1, r.
y1 );
1266 return ViewportBitmap( r.
x0, r.
y0, r.
x1, r.
y1, flags );
1298 BeginSelection( p.
x, p.
y, flags );
1329 ModifySelection( p.
x, p.
y, flags );
1424 struct EventHandlers
1428 EventHandlers() =
default;
1429 EventHandlers(
const EventHandlers& ) =
default;
1430 EventHandlers& operator =(
const EventHandlers& ) =
default;
1447 friend class ImageViewEventDispatcher;
Client-side interface to a PixInsight Bitmap object.
Client-side interface to a PixInsight Control 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.
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
Client-side interface to a PixInsight ImageView control.
void UpdateImageRect(double x0, double y0, double x1, double y1)
void UpdateImageRect(const pcl::DRect &r)
void SetTransparencyMode(transparency_mode mode, RGBA color=0)
void ImageToViewport(DPoint *p, size_type n) const
void ImageScalarToViewport(double *d, size_type n) const
bool IsAlphaChannelDisplayed() const
void ViewportToImage(Point *p, size_type n) const
bool IsTransparencyVisible() const
bool IsGamutCheckEnabled() const
void ViewportToImage(DPoint *p, size_type n) const
void ViewportToGlobal(int &x, int &y) const
void EnableColorManagement(bool=true)
DPoint ViewportToImage(const GenericPoint< T > &p) const
void SelectChannel(display_channel channel)
void ViewportToImage(int &x, int &y) const
void ViewportScalarToImage(int *d, size_type n) const
Rect SelectionRect(uint32 *flags=0) const
void ModifySelection(int x, int y, uint32 flags=0)
void BeginSelection(const Point &p, uint32 flags=0)
void GetImageGeometry(int &width, int &height, int &numberOfChannels) const
void GetSampleFormat(int &bitsPerSample, bool &floatSample) const
void ViewportToImage(Array< GenericPoint< T > > &a) const
Rect GlobalToViewport(const Rect &r) const
Rect ViewportUpdateRect() const
void RegenerateImageRect(const pcl::DRect &r)
Rect ViewportToGlobal(const Rect &r) const
void RegenerateViewportRect(const Rect &r)
ImageView(Control &parent=Control::Null(), int width=0, int height=0, int numberOfChannels=1, int bitsPerSample=32, bool floatSample=true, bool color=false)
transparency_mode TransparencyMode() const
void UpdateViewportRect(int x0, int y0, int x1, int y1)
double ImageScalarToViewport(double) const
void ImageToViewport(int &x, int &y) const
void SetViewport(double cx, double cy, int zoom=0)
void RegenerateImageRect(double x0, double y0, double x1, double y1)
bool IsProofingEnabled() const
void SetViewportPosition(int x, int y)
ImageVariant Image() const
void BeginSelection(int x, int y, uint32 flags=0)
bool IsColorManagementEnabled() const
void GetRGBWS(RGBColorSystem &rgbws) const
void UpdateViewportRect(const Rect &r)
Point ViewportPosition() const
void GlobalToViewport(int &x, int &y) const
int ImageScalarToViewport(int) const
double ViewportScalarToImage(T d) const
RGBA TransparencyColor() const
Bitmap ViewportBitmap(int x0, int y0, int x1, int y1, uint32 flags=0) const
void DisableColorManagement(bool disable=true)
bool HasPendingUpdates() const
DRect ViewportToImage(const GenericRectangle< T > &r) const
void SetICCProfile(const ICCProfile &icc)
void GetViewportSize(int &width, int &height) const
void SetViewportPosition(const Point &p)
void CommitPendingUpdates()
void ImageToViewport(Point *p, size_type n) const
int VisibleViewportWidth() const
GenericRectangle< T > ImageToViewport(const GenericRectangle< T > &r) const
void ModifySelection(const Point &p, uint32 flags=0)
bool GetICCProfile(ICCProfile &icc) const
void ViewportScalarToImage(double *d, size_type n) const
int VisibleViewportHeight() const
void ImageToViewport(double &x, double &y) const
void EnableGamutCheck(bool=true)
void SetSampleFormat(int bitsPerSample, bool floatSample)
display_channel CurrentChannel() const
Bitmap ViewportBitmap(const Rect &r, uint32 flags=0) const
void SetColorManagementFeatures(bool cmEnabled, bool proofing, bool gamutCheck)
Point ViewportToGlobal(const Point &p) const
int ViewportHeight() const
void EnableProofing(bool=true)
void DisableProofing(bool disable=true)
void SetZoomFactor(int z)
void ViewportToImage(double &x, double &y) const
gui_mode CurrentMode() const
void SetViewport(const DPoint ¢er, int zoom=0)
bool IsColorImage() const
void ImageScalarToViewport(int *d, size_type n) const
void SelectMode(gui_mode mode)
Point GlobalToViewport(const Point &p) const
int CurrentAlphaChannel() const
void ImageToViewport(Array< GenericPoint< T > > &a) const
void DisableGamutCheck(bool disable=true)
double ViewportScalarToImage(double d) const
void RegenerateViewportRect(int x0, int y0, int x1, int y1)
void SetRGBWS(const RGBColorSystem &rgbws)
void SetICCProfile(const String &filePath)
int ViewportWidth() const
GenericPoint< T > ImageToViewport(const GenericPoint< T > &p) const
Rect VisibleViewportRect() const
Colorimetrically defined RGB working color space.
void OnScrollViewport(scroll_event_handler handler, Control &receiver)
void(Control::*)(ImageView &sender, int dx, int dy) scroll_event_handler