52 #ifndef __PCL_Bitmap_h
53 #define __PCL_Bitmap_h
57 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
95 namespace BitmapFormat
101 ARGB32_Premultiplied,
108 NumberOfBitmapFormats,
135 namespace SVGRenderOption
139 IgnoreAspectRatio = 0x00000000,
140 PreserveAspectRatio = 0x00000001,
142 HighQuality = 0x00000010,
143 Default = PreserveAspectRatio|Fast
156 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
158 class PCL_CLASS ImageVariant;
211 using pixel_format = BitmapFormat::value_type;
218 using display_channel = DisplayChannel::value_type;
225 using mask_mode = MaskMode::value_type;
239 Bitmap(
int width,
int height, pixel_format fmt = BitmapFormat::ARGB32 );
505 int zoom = 1, display_channel displayChannel = DisplayChannel::RGBK,
bool transparency =
true,
506 const ImageVariant* mask =
nullptr, mask_mode maskMode = MaskMode::Default,
bool maskInverted =
false,
507 const uint8** LUT =
nullptr,
bool fastDownsample =
true,
bool (*callback)() =
nullptr );
519 int w, dum; GetDimensions( w, dum );
return w;
527 int dum, h; GetDimensions( dum, h );
return h;
538 int w, h; GetDimensions( w, h );
return pcl::Rect( w, h );
553 operator bool()
const
583 return Pixel( p.
x, p.
y );
615 SetPixel( p.
x, p.
y, v );
871 return Subimage( r.
x0, r.
y0, r.
x1, r.
y1 );
919 Copy( p, src, src.
Bounds() );
963 Fill( Bounds(), fillWith );
991 Or( Bounds(), orWith );
1039 Or( p, src, src.
Bounds() );
1081 And( Bounds(), andWith );
1129 And( p, src, src.
Bounds() );
1171 Xor( Bounds(), xorWith );
1219 Xor( p, src, src.
Bounds() );
1268 XorRect( Bounds(), xorWith );
1285 Xor( rect, 0x00ffffff );
1316 XorRect( rect, 0x00ffffff );
1331 InvertRect( Bounds() );
1365 ReplaceColor( Bounds(), replaceThis, replaceWith );
1501 void* CloneHandle()
const override;
Client-side interface to a PixInsight module-defined action object.
Client-side interface to a PixInsight BitmapBox control.
Client-side interface to a PixInsight Bitmap object.
void Load(const void *data, size_type size, const char *format="SVG", uint32 flags=0)
void GetDimensions(int &width, int &height) const
Bitmap Subimage(const pcl::Rect &r) const
static Bitmap FromSVG(const IsoString &svgSource, int width=0, int height=0, SVGRenderOptions options=SVGRenderOption::Default)
pixel_format PixelFormat() const
Bitmap(const char *filePath)
Bitmap(int width, int height, pixel_format fmt=BitmapFormat::ARGB32)
Bitmap(const void *data, size_type size, const char *format="SVG", uint32 flags=0)
Bitmap(const IsoString &filePath)
Bitmap Subimage(int x0, int y0, int x1, int y1) const
Bitmap(const Bitmap &bmp, const pcl::Rect &r)
void SetPixelFormat(pixel_format fmt)
static Bitmap FromSVGFile(const String &filePath, int width=0, int height=0, SVGRenderOptions options=SVGRenderOption::Default)
static Bitmap Render(const ImageVariant &image, int zoom=1, display_channel displayChannel=DisplayChannel::RGBK, bool transparency=true, const ImageVariant *mask=nullptr, mask_mode maskMode=MaskMode::Default, bool maskInverted=false, const uint8 **LUT=nullptr, bool fastDownsample=true, bool(*callback)()=nullptr)
Bitmap(const String &filePath)
Bitmap(const Bitmap &bmp, int x0, int y0, int x1, int y1)
Bitmap(const Bitmap &bmp)
Client-side interface to a PixInsight Brush object.
Client-side interface to a PixInsight ComboBox control.
Client-side interface to a PixInsight Cursor object.
A type-safe collection of enumerated flags.
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.
Base class of client-side interface classes to PixInsight graphics contexts
Client-side interface to a PixInsight graphics context object.
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.
High-level interface to an image window object in the PixInsight core application.
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
High-level interface to an installed process.
A collection of rendering options for raster image representation of SVG documents.
Client-side interface to a PixInsight TabBox control.
Client-side interface to a PixInsight TreeBox control.
Root base class for all user interface objects.
Client-side interface to a PixInsight vector graphics context.
void InvertRect(const pcl::Rect &rect)
void And(const pcl::Point &p, const Bitmap &src, const pcl::Rect &r)
void And(const pcl::Point &p, const Bitmap &src)
void Xor(const pcl::Point &p, const Bitmap &src)
void And(const Bitmap &src)
void Xor(const pcl::Rect &rect, RGBA xorWith)
void Or(const pcl::Point &p, const Bitmap &src, const pcl::Rect &r)
void Copy(const Bitmap &src)
void XorRect(const pcl::Rect &rect, RGBA xorWith)
void Or(const Bitmap &src)
void Xor(const pcl::Point &p, const Bitmap &src, const pcl::Rect &r)
void Copy(const pcl::Point &p, const Bitmap &src, const pcl::Rect &r)
void Copy(const pcl::Point &p, const Bitmap &src)
void Invert(const pcl::Rect &rect)
void Fill(const pcl::Rect &rect, RGBA fillWith)
void Xor(const Bitmap &src)
void XorRect(RGBA xorWith)
void Or(const pcl::Rect &rect, RGBA orWith)
void And(const pcl::Rect &rect, RGBA andWith)
void Or(const pcl::Point &p, const Bitmap &src)
void ReplaceColor(const pcl::Rect &rect, RGBA replaceThis, RGBA replaceWith)
void SetAlpha(const pcl::Rect &rect, uint8 newAlpha)
void SetAlpha(uint8 newAlpha)
void ReplaceColor(RGBA replaceThis, RGBA replaceWith)
void Load(const String &filePath)
void Save(const String &filePath, int quality=-1) const
RGBA Pixel(const pcl::Point &p) const
RGBA Pixel(int x, int y) const
void SetPixel(int x, int y, RGBA v)
const RGBA * ScanLine(int y) const
void SetPixel(const pcl::Point &p, RGBA v)
void SetAlpha(RGBA &rgba, uint8 a)
double PhysicalPixelRatio() const
void SetPhysicalPixelRatio(double ratio)