public PspBitmap(GuPixelFormats pixelFormat, int width, int height, byte *address, int bytesPerLine = -1) { GuPixelFormat = pixelFormat; Width = width; Height = height; Address = address; BitsPerPixel = PixelFormatDecoder.GetPixelsBits(pixelFormat); ColorFormat = PixelFormatDecoder.ColorFormatFromPixelFormat(pixelFormat); if (bytesPerLine < 0) { BytesPerLine = PixelFormatDecoder.GetPixelsSize(GuPixelFormat, width); } else { BytesPerLine = bytesPerLine; } }
private int GetOffset(int x, int y) { return(y * BytesPerLine + PixelFormatDecoder.GetPixelsSize(GuPixelFormat, x)); }