C# Class Axiom.Media.PixelBox

A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory. In case of a rectangle, depth must be 1. Pixels are stored as a succession of "depth" slices, each containing "height" rows of "width" pixels.
Inheritance: BasicBox
Datei anzeigen Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Property Type Description
data System.IntPtr
format PixelFormat
offset int
rowPitch int
slicePitch int

Public Methods

Method Description
Compressed ( PixelFormat format ) : bool

I don't know how to figure this out. For now, just deal with the DXT* formats

GetSubVolume ( BasicBox def ) : PixelBox

Return a subvolume of this PixelBox.

This function does not copy any data, it just returns a PixelBox object with a data pointer pointing somewhere inside the data of object. Throws an Exception if def is not fully contained.

PixelBox ( ) : System

Parameter constructor for setting the members manually

PixelBox ( BasicBox extents, PixelFormat format ) : System
PixelBox ( int width, int height, int depth, PixelFormat format ) : System
PixelBox ( int width, int height, int depth, PixelFormat format, IntPtr data ) : System

Constructor providing width, height and depth. This constructor assumes the pixel data is laid out consecutively in memory. (this means row after row, slice after slice, with no space in between)

SetConsecutive ( ) : void

Set the rowPitch and slicePitch so that the buffer is laid out consecutive in memory.

Private Methods

Method Description
PixelBox ( BasicBox extents, PixelFormat format, IntPtr data ) : System

Constructor providing extents in the form of a Box object. This constructor assumes the pixel data is laid out consecutively in memory. (this means row after row, slice after slice, with no space in between)

Method Details

Compressed() public static method

I don't know how to figure this out. For now, just deal with the DXT* formats
public static Compressed ( PixelFormat format ) : bool
format PixelFormat
return bool

GetSubVolume() public method

Return a subvolume of this PixelBox.
This function does not copy any data, it just returns a PixelBox object with a data pointer pointing somewhere inside the data of object. Throws an Exception if def is not fully contained.
public GetSubVolume ( BasicBox def ) : PixelBox
def BasicBox Defines the bounds of the subregion to return
return PixelBox

PixelBox() public method

Parameter constructor for setting the members manually
public PixelBox ( ) : System
return System

PixelBox() public method

public PixelBox ( BasicBox extents, PixelFormat format ) : System
extents BasicBox
format PixelFormat
return System

PixelBox() public method

public PixelBox ( int width, int height, int depth, PixelFormat format ) : System
width int
height int
depth int
format PixelFormat
return System

PixelBox() public method

Constructor providing width, height and depth. This constructor assumes the pixel data is laid out consecutively in memory. (this means row after row, slice after slice, with no space in between)
public PixelBox ( int width, int height, int depth, PixelFormat format, IntPtr data ) : System
width int Width of the region
height int Height of the region
depth int Depth of the region
format PixelFormat Format of this buffer
data System.IntPtr Pointer to the actual data
return System

SetConsecutive() public method

Set the rowPitch and slicePitch so that the buffer is laid out consecutive in memory.
public SetConsecutive ( ) : void
return void

Property Details

data protected_oe property

The data pointer. We do not own this.
protected IntPtr,System data
return System.IntPtr

format protected_oe property

The pixel format
protected PixelFormat format
return PixelFormat

offset protected_oe property

A byte offset into the data
protected int offset
return int

rowPitch protected_oe property

Number of elements between the leftmost pixel of one row and the left pixel of the next. This value must always be equal to getWidth() (consecutive) for compressed formats.
protected int rowPitch
return int

slicePitch protected_oe property

Number of elements between the top left pixel of one (depth) slice and the top left pixel of the next. This can be a negative value. Must be a multiple of rowPitch. This value must always be equal to getWidth()*getHeight() (consecutive) for compressed formats.
protected int slicePitch
return int