public class RGBPixelBuffer extends DicomPixelBufferBase
DicomPixelBuffer.PixelType
Constructor and Description |
---|
RGBPixelBuffer(byte[] pixels) |
RGBPixelBuffer(byte[] pixels,
int offset,
int length)
Creates a new buffer from a portion of an existing byte array
|
RGBPixelBuffer(int size) |
RGBPixelBuffer(int[] pixels) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer() |
int |
getNumChannels()
Number of "color" channels in the buffer
|
int |
getNumPixels() |
int |
getPixels(int x,
int dx,
int nx,
DicomPixelBuffer.PixelType type,
DicomPixelInterpolator interp,
java.nio.ByteBuffer pixels)
Populates a buffer of pixel values from those stored in this buffer,
using a supplied interpolator.
|
int |
getPixels(int x,
int dx,
int nx,
DicomPixelBuffer.PixelType type,
DicomPixelInterpolator interp,
int[] pixels,
int offset)
Populates a buffer of pixel values from those stored in this buffer,
using a supplied interpolator.
|
DicomPixelBuffer.PixelType |
getPixelType() |
int |
getValue(int idx)
Return the internal pixel value at idx.
|
getMaxIntensity, getMinIntensity, getRescaledValue, getRescaleIntercept, getRescaleSlope, isSigned, setRescale
public RGBPixelBuffer(int size)
public RGBPixelBuffer(byte[] pixels)
public RGBPixelBuffer(byte[] pixels, int offset, int length)
pixels
- buffer of pixels to copy fromoffset
- offset in buffer to start copylength
- total length of bytes (i.e. must be multiple of 3 for rgb)public RGBPixelBuffer(int[] pixels)
public DicomPixelBuffer.PixelType getPixelType()
getPixelType
in interface DicomPixelBuffer
getPixelType
in class DicomPixelBufferBase
public int getNumPixels()
public int getValue(int idx)
DicomPixelBufferBase
getValue
in interface DicomPixelBuffer
getValue
in class DicomPixelBufferBase
idx
- value indexpublic byte[] getBuffer()
public int getPixels(int x, int dx, int nx, DicomPixelBuffer.PixelType type, DicomPixelInterpolator interp, java.nio.ByteBuffer pixels)
DicomPixelBuffer
getPixels
in interface DicomPixelBuffer
getPixels
in class DicomPixelBufferBase
x
- starting pixel index in this bufferdx
- pixel step in this buffernx
- number of pixels to interpolate fromtype
- type of pixels to outputinterp
- interpolator for converting pixels for output displaypixels
- output bufferpublic int getPixels(int x, int dx, int nx, DicomPixelBuffer.PixelType type, DicomPixelInterpolator interp, int[] pixels, int offset)
DicomPixelBuffer
getPixels
in interface DicomPixelBuffer
getPixels
in class DicomPixelBufferBase
x
- starting pixel index in this bufferdx
- pixel step in this buffernx
- number of pixels to interpolate fromtype
- type of pixels to outputinterp
- interpolator for converting pixels for output displaypixels
- output arrayoffset
- offset in output arraypublic int getNumChannels()
DicomPixelBuffer