LuciadCPillar C# 2024.0.05
Luciad.Drawing.Image Class Reference

An image with a width, height and pixel data in a specified pixel format. More...

Inheritance diagram for Luciad.Drawing.Image:

Public Member Functions

void Dispose ()
 
System.Drawing.Color GetColor (uint x, uint y)
 Returns the color value at the given image location. More...
 

Static Public Member Functions

static Luciad.Drawing.Image Create (uint width, uint height, bool isAlphaPreMultiplied, Luciad.Drawing.PixelFormat pixelFormat, Luciad.Containers.ByteBuffer data)
 Creates an Image. More...
 

Properties

Luciad.Containers.ByteBuffer Bytes [get]
 The bytes that make up the pixels of this image. More...
 
uint Height [get]
 The height of this image in pixels. More...
 
bool IsAlphaPreMultiplied [get]
 Whether the image is using premultiplied alpha. More...
 
Luciad.Drawing.PixelFormat PixelFormat [get]
 The pixel format of this image. More...
 
uint Width [get]
 The width of this image in pixels. More...
 

Detailed Description

An image with a width, height and pixel data in a specified pixel format.

The origin of an image (pixel (0, 0)) is defined at the top left corner, with the x axis pointing right, and the y axis pointing down.

Member Function Documentation

◆ Create()

static Luciad.Drawing.Image Luciad.Drawing.Image.Create ( uint  width,
uint  height,
bool  isAlphaPreMultiplied,
Luciad.Drawing.PixelFormat  pixelFormat,
Luciad.Containers.ByteBuffer  data 
)
inlinestatic

Creates an Image.

Parameters
widththe width of the new image
heightthe height of the new image
isAlphaPreMultipliedtrue to indicate that the colors in the data buffer contain premultiplied alpha
pixelFormatthe pixel format
datathe pixel data. The buffer contains rows (left to right) of color data. The rows are ordered from top to bottom. The size of each color, and so also the size of the data buffer, is determined by the used PixelFormat.
Returns
a new image

◆ Dispose()

void Luciad.Drawing.Image.Dispose ( )
inline

◆ GetColor()

System.Drawing.Color Luciad.Drawing.Image.GetColor ( uint  x,
uint  y 
)
inline

Returns the color value at the given image location.

This will be an rgba color for Image instance with:

This will be a greyscale System.Drawing.Color for Image instance with:

Parameters
xthe x-coordinate of the pixel. A value of 0 corresponds with a left-most pixel.
ythe y-coordinate of the pixel. A value of 0 corresponds with a top-most pixel.
Returns
the System.Drawing.Color value at the given image location.

Property Documentation

◆ Bytes

Luciad.Containers.ByteBuffer Luciad.Drawing.Image.Bytes
get

The bytes that make up the pixels of this image.

[get]

Returns the bytes that make up the pixels of this image. The bytes must be immutable; multiple calls to this method must always result in the same bytes.
The amount of bytes that makes up one pixel depends on the PixelFormat of this image (see getPixelFormat() and luciad::sizeInBytes(PixelFormat)). In other words, the size of this array is equal to: getWidth() * getHeight() * luciad::sizeInBytes(getPixelFormat()).
The pixels are arranged in row-major order, starting in the upper-left corner.

◆ Height

uint Luciad.Drawing.Image.Height
get

The height of this image in pixels.

[get]

Returns the height of this image in pixels.

◆ IsAlphaPreMultiplied

bool Luciad.Drawing.Image.IsAlphaPreMultiplied
get

Whether the image is using premultiplied alpha.

[get]

Returns whether the image is using premultiplied alpha.

◆ PixelFormat

Luciad.Drawing.PixelFormat Luciad.Drawing.Image.PixelFormat
get

The pixel format of this image.

[get]

Returns the pixel format of this image.

◆ Width

uint Luciad.Drawing.Image.Width
get

The width of this image in pixels.

[get]

Returns the width of this image in pixels.