DngCreator.WriteByteBuffer(Stream, Size, ByteBuffer, Int64) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Write the android.graphics.ImageFormat#RAW_SENSOR
pixel data to a DNG file with
the currently configured metadata.
[Android.Runtime.Register("writeByteBuffer", "(Ljava/io/OutputStream;Landroid/util/Size;Ljava/nio/ByteBuffer;J)V", "")]
public void WriteByteBuffer (System.IO.Stream dngOutput, Android.Util.Size size, Java.Nio.ByteBuffer pixels, long offset);
[<Android.Runtime.Register("writeByteBuffer", "(Ljava/io/OutputStream;Landroid/util/Size;Ljava/nio/ByteBuffer;J)V", "")>]
member this.WriteByteBuffer : System.IO.Stream * Android.Util.Size * Java.Nio.ByteBuffer * int64 -> unit
Parameters
- dngOutput
- Stream
an java.io.OutputStream
to write the DNG file to.
- size
- Size
the Size
of the image to write, in pixels.
- pixels
- ByteBuffer
an java.nio.ByteBuffer
of pixel data to write.
- offset
- Int64
the offset of the raw image in bytes. This indicates how many bytes will be skipped in the input before any pixel data is read.
- Attributes
Exceptions
if an error was encountered in the input or output stream.
if not enough metadata information has been set to write a well-formatted DNG file.
Remarks
Write the android.graphics.ImageFormat#RAW_SENSOR
pixel data to a DNG file with the currently configured metadata.
Raw pixel data must have 16 bits per pixel, and the input must contain at least offset + 2 * width * height)
bytes. The width and height of the input are taken from the width and height set in the DngCreator
metadata tags, and will typically be equal to the width and height of CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
. Prior to API level 23, this was always the same as CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
. The pixel layout in the input is determined from the reported color filter arrangement (CFA) set in CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
. If insufficient metadata is available to write a well-formatted DNG file, an java.lang.IllegalStateException
will be thrown.
Any mark or limit set on this ByteBuffer
is ignored, and will be cleared by this method.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.