import * as em from "./Enums"; import * as ds from "./Types"; import { ObjectManager } from "./ObjectManager"; import { DrawingContext } from "./DrawingContext"; import { type BilevelBitmap } from "./BilevelBitmap"; import { type GrayscaleBitmap } from "./GrayscaleBitmap"; import { type Bitmap } from "./Bitmap"; /** * Represents a drawing context for a {@link Bitmap}. **/ export declare class BmpContext extends DrawingContext { /** * Creates a new {@link Bitmap} with BmpContext and optionally fills the {@link Bitmap} with a background color. * @param width The width of drawing surface, in context units (not in pixels, unless scale is 1.0). * @param height The height of drawing surface, in context units (not in pixels, unless scale is 1.0). * @param scale The optional scale factor for mapping from context units to pixels. * The default is 1.0 which means that the width and height are in pixels. * @param backColor An optional background color to fill the drawing surface. **/ constructor(width: number, height: number, scale?: number, backColor?: ds.Color | null); /** * Creates a new {@link Bitmap} with BmpContext and optionally fills the {@link Bitmap} with a background color. * @param om An object manager that controls the lifetime of the BmpContext object. * @param width The width of drawing surface, in context units (not in pixels, unless scale is 1.0). * @param height The height of drawing surface, in context units (not in pixels, unless scale is 1.0). * @param scale The optional scale factor for mapping from context units to pixels. * The default is 1.0 which means that the width and height are in pixels. * @param backColor An optional background color to fill the drawing surface. **/ constructor(om: ObjectManager, width: number, height: number, scale?: number, backColor?: ds.Color | null); /** * Gets the type of {@link DrawingContext}. **/ get type(): em.ContextType; /** * Gets the resolution of the {@link DrawingContext}, in dots per Inch. **/ get resolution(): number; /** * Gets the width of the context, in context graphic units. **/ get width(): number; /** * Gets the height of the context, in context graphic units. **/ get height(): number; /** * Gets the {@link Bitmap} object associated with this drawing context. **/ get bitmap(): Bitmap; /** * Gets or sets the current blend mode for drawing operations. **/ get blendMode(): em.BlendMode; /** * Gets or sets the current blend mode for drawing operations. **/ set blendMode(blendMode: em.BlendMode); /** * Gets or sets the sampling mode to use when drawing images with resizing. **/ get interpolationMode(): em.InterpolationMode; /** * Gets or sets the sampling mode to use when drawing images with resizing. **/ set interpolationMode(interpolationMode: em.InterpolationMode); /** * Gets or sets a value indicating whether the graphic objects are drawn without anti-aliasing. **/ get aliased(): boolean; /** * Gets or sets a value indicating whether the graphic objects are drawn without anti-aliasing. **/ set aliased(value: boolean); /** * Gets or sets a value specifying whether text is always drawn with antialiasing * regardless the value of the 'aliased' property. **/ get forceAntialiasingForText(): boolean; /** * Gets or sets a value specifying whether text is always drawn with antialiasing * regardless the value of the 'aliased' property. **/ set forceAntialiasingForText(value: boolean); /** * Gets or sets a value indicating whether the antialiasing algorithm should produce better quality with lower speed. **/ get slowAntialiasing(): boolean; /** * Gets or sets a value indicating whether the antialiasing algorithm should produce better quality with lower speed. **/ set slowAntialiasing(value: boolean); /** * Gets or sets a {@link BilevelBitmap} to monitor changes in the target bitmap. * Its pixels are used as boolean flags indicating changes in the corresponding pixels of the target bitmap. * When a pixel in the target bitmap is changed, the corresponding pixel in this bitmap is set to 1 (true). * The {@link BilevelBitmap} must have the same pixel size as the target bitmap. * It is user's responsibility to clear this bitmap (fill it with zeros) before any drawing on the target occurs. **/ get updatedPixelMask(): BilevelBitmap | null; /** * Gets or sets a {@link BilevelBitmap} to monitor changes in the target bitmap. * Its pixels are used as boolean flags indicating changes in the corresponding pixels of the target bitmap. * When a pixel in the target bitmap is changed, the corresponding pixel in this bitmap is set to 1 (true). * The {@link BilevelBitmap} must have the same pixel size as the target bitmap. * It is user's responsibility to clear this bitmap (fill it with zeros) before any drawing on the target occurs. **/ set updatedPixelMask(pixelMask: BilevelBitmap | null); /** * Gets or sets a {@link Bitmap} providing background for all drawing and filling operations. * The same bitmap cannot be used as background and target at the same time. * The background bitmap must be of the same pixel size as the target bitmap. **/ get backgroundBitmap(): Bitmap | null; /** * Gets or sets a {@link Bitmap} providing background for all drawing and filling operations. * The same bitmap cannot be used as background and target at the same time. * The background bitmap must be of the same pixel size as the target bitmap. **/ set backgroundBitmap(background: Bitmap | null); /** * Gets or sets a value indicating that copying pixels from the {@link BmpContext#backgroundBitmap} * to the target bitmap should not be marked as changed in the {@link BmpContext#updatedPixelMask}. * The default is false, indicating that pixels copied from the background bitmap * to the target are marked as changed. **/ get backgroundContainsUnmodifiedImage(): boolean; /** * Gets or sets a value indicating that copying pixels from the {@link BmpContext#backgroundBitmap} * to the target bitmap should not be marked as changed in the {@link BmpContext#updatedPixelMask}. * The default is false, indicating that pixels copied from the background bitmap * to the target are marked as changed. **/ set backgroundContainsUnmodifiedImage(value: boolean); /** * Gets or sets a {@link GrayscaleBitmap} providing transparency mask for all drawing and filling operations. * Pixels in the mask with value 0 are fully opaque and will completely mask any drawing (i.e. the pixels of the target bitmap will remain unchanged). * Pixels in the mask with value 255 are fully transparent, i.e. any drawing will have the same effect as if there was no mask. * Pixels with values between 0 and 255 will modify the transparency of the pixels being drawn according to their value. * Note that the transparency mask bitmap must be of the same pixel size as the target bitmap. **/ get transparencyMask(): GrayscaleBitmap | null; /** * Gets or sets a {@link GrayscaleBitmap} providing transparency mask for all drawing and filling operations. * Pixels in the mask with value 0 are fully opaque and will completely mask any drawing (i.e. the pixels of the target bitmap will remain unchanged). * Pixels in the mask with value 255 are fully transparent, i.e. any drawing will have the same effect as if there was no mask. * Pixels with values between 0 and 255 will modify the transparency of the pixels being drawn according to their value. * Note that the transparency mask bitmap must be of the same pixel size as the target bitmap. **/ set transparencyMask(mask: GrayscaleBitmap | null); }