import * as em from "./Enums"; import * as ds from "./Types"; import { ObjectManager } from "./ObjectManager"; import { ObjectBase } from "./ObjectBase"; import { type Bitmap } from "./Bitmap"; /** * Represents a grayscale image or transparency mask with 8 bits per pixel. **/ export declare class GrayscaleBitmap extends ObjectBase { /** * Creates a {@link GrayscaleBitmap} instance with optionally initialized pixels. * @param width The grayscale bitmap width, in pixels. * @param height The grayscale bitmap height, in pixels. * @param gbProperties The settings for creating a grayscale bitmap. **/ constructor(width: number, height: number, gbProperties?: ds.GrayscaleBitmapProperties); /** * Creates a {@link GrayscaleBitmap} instance with optionally initialized pixels. * @param om An object manager that controls the lifetime of the {@link GrayscaleBitmap} object. * @param width The grayscale bitmap width, in pixels. * @param height The grayscale bitmap height, in pixels. * @param gbProperties The settings for creating a grayscale bitmap. **/ constructor(om: ObjectManager, width: number, height: number, gbProperties?: ds.GrayscaleBitmapProperties); /** * Gets the width of the {@link GrayscaleBitmap}, in pixels. **/ get width(): number; /** * Gets the height of the {@link GrayscaleBitmap}, in pixels. **/ get height(): number; /** * Gets or sets a value indicating whether the image is used to define an alpha mask of another image. **/ get transparencyMask(): boolean; /** * Gets or sets a value indicating whether the image is used to define an alpha mask of another image. **/ set transparencyMask(value: boolean); /** * Gets or sets a value specifying whether 0 represents white and 255 represents black (if true) or vice versa (if false). **/ get whiteIsZero(): boolean; /** * Gets or sets a value specifying whether 0 represents white and 255 represents black (if true) or vice versa (if false). **/ set whiteIsZero(value: boolean); /** * Creates a {@link Bitmap} instance from the current {@link GrayscaleBitmap}. * @returns A new instance of the {@link Bitmap} class. **/ toBitmap(): Bitmap; /** * Creates a semi-transparent {@link Bitmap} from the current {@link GrayscaleBitmap}. * This method treats the current {@link GrayscaleBitmap} as a transparency mask, regardless of the transparencyMask property value. * @param shadowColor The color to fill opaque pixels of the target bitmap. * @param [opacityFactor=1] Additional factor to scale the alpha channel. * @param [zeroIsOpaque=false] Specifies whether zero values correspond to fully opaque (true) or fully transparent (false) pixels. * @returns A new instance of the {@link Bitmap} class. **/ toShadowBitmap(shadowColor: ds.Color, opacityFactor?: number, zeroIsOpaque?: boolean): Bitmap; /** * Clears the {@link GrayscaleBitmap} with the specified value. * @param value The value (between 0 and 255) to fill the image. * @param bounds The target rectangle of the {@link GrayscaleBitmap}. **/ clear(value: number, bounds?: ds.Bounds | null): void; /** * Creates a new {@link GrayscaleBitmap} with a copy of the image. * @param [metadataOnly=false] specifies whether to copy the image metadata only, not actual pixel data. * @returns A new instance of the {@link GrayscaleBitmap}. **/ clone(metadataOnly?: boolean): GrayscaleBitmap; /** * Modifies pixel intensities such that available range of values (0..255) is fully covered. **/ autoContrast(): void; /** * Modifies pixel intensities, clipping extremely low and extremely high values, * such that available range of values (0..255) is fully covered. * @param lowClipFraction The fraction of extremely low values to be clipped, not greater than 0.1. * @param highClipFraction The fraction of extremely high values to be clipped, not greater than 0.1. **/ autoContrast(lowClipFraction: number, highClipFraction: number): void; /** * Adjusts the levels of an image histogram. * The method maps the input range of values (blackPoint..whitePoint) to the output * range (outputBlack..outputWhite) using the specified gamma correction (midtone). * @param blackPoint The input black point (between 0 and 255). * @param whitePoint The input white point (between 0 and 255). * @param outputBlack The output black point (between 0 and 255). * @param outputWhite The output white point (between 0 and 255). * @param [midtone=1.0] The value of gamma correction. **/ adjustLevels(blackPoint: number, whitePoint: number, outputBlack: number, outputWhite: number, midtone?: number): void; /** * Inverts the pixel colors from black to white and vice versa. **/ invertColors(): void; /** * Creates a new {@link GrayscaleBitmap} with a fragment of the image. * @param x The X coordinate of the clipping rectangle. * @param y The Y coordinate of the clipping rectangle. * @param width The width of the clipping rectangle. * @param height The height of the clipping rectangle. * @param metadataOnly Specifies whether to copy the image metadata only, not actual pixel data. The default is false. * @returns A new {@link GrayscaleBitmap} with a fragment of the source image. **/ clip(x: number, y: number, width: number, height: number, metadataOnly?: boolean): GrayscaleBitmap; /** * Creates a new {@link GrayscaleBitmap} with a fragment of the image. * @param bounds Clipping rectangle of the source image to be extracted as a new {@link GrayscaleBitmap}. * @param metadataOnly Specifies whether to copy the image metadata only, not actual pixel data. The default is false. * @returns A new {@link GrayscaleBitmap} with a fragment of the source image. **/ clip(bounds: ds.Bounds, metadataOnly?: boolean): GrayscaleBitmap; /** * Applies a Gaussian blur to this {@link GrayscaleBitmap}. * @param [radius=9] The radius of the blur, in pixels. * @param borderMode The mapping mode for the pixels outside of the border, "RepeatEdge" if null. * @param [borderColor=0] The color used to blend with the edge pixels of the image (between 0 and 255). **/ applyGaussianBlur(radius?: number, borderMode?: em.GaussianBlurBorderMode | null, borderColor?: number): void; /** * When applied to a grayscale mask built from a color image using the {@link Bitmap#toGrayscaleBitmap} method, modifies it * so that the result can be used as a transparency mask to produce "Glow" or "Soft Edges" effects. * @param [infRadius=4] The radius of inflation (positive, glow) or deflation (negative, soft edges), in pixels. * @param [blurRadius=6] The radius of Gaussian blur, in pixels. **/ applyGlow(infRadius?: number, blurRadius?: number): void; }