public RasterByteOrder Order { get; set; } @property (nonatomic, assign) LTRasterByteOrder order public RasterByteOrder getOrder(); public:property RasterByteOrder Order {RasterByteOrder get();void set ( RasterByteOrder );}
Order # get and set (RasterImage)
The color order of this RasterImage.
The RasterImage object supports storing the image data in one of the following color orders:
| Order | Notes |
|---|---|
| RasterByteOrder.Rgb |
The image data contains the color in the RGB order. For example, for 24-bits per pixel images the data is stored as the 3 bytes representing the red, green and blue component respectively. Palettized images (with bits per pixel less than or equal to 8) will also report a byte order of RGB although the image data stored is really indices into the palette.
16-bit bitmaps use 5 bits for R, G and B components and one bit for alpha |
| RasterByteOrder.Bgr | The image data contains the color in the BGR order. For example, for 24-bits per pixel images the data is stored as the 3 bytes representing the blue, green and red component respectively. |
| RasterByteOrder.Rgb565 | The image data contains the color in RGB color order with 5 bits for red and blue component and 6 bits for green component (16 bits per pixel). There is no alpha information. |
| RasterByteOrder.Gray | The image data contains the grayscale colors. For 12 and 16-bits per pixel images, the image data contains the grayscale values of the pixel, for 8-bits per pixel gray scale images, the image data contains an index into the grayscale palette. |
| RasterByteOrder.Romm | The image data is compressed in memory using ROMM. Only valid for 24-bits per pixel images. |
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;using Leadtools.ImageProcessing.Color;using Leadtools.Dicom;using Leadtools.Drawing;using Leadtools.Controls;using Leadtools.Svg;public void OrderExample(){RasterCodecs codecs = new RasterCodecs();string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp");// Load the image as BGR (default) and get the first pixel valueRasterImage image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1);Console.WriteLine("Order is {0}", image.Order);image.Dispose();// Load the image as RGB and get the first pixel valueimage = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Rgb, 1, 1);Console.WriteLine("Order is {0}", image.Order);image.Dispose();codecs.Dispose();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}
import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.util.ArrayList;import java.util.List;import org.junit.*;import org.junit.runner.JUnitCore;import org.junit.runner.Result;import org.junit.runner.notification.Failure;import static org.junit.Assert.*;import leadtools.*;import leadtools.codecs.*;import leadtools.imageprocessing.core.*;import leadtools.svg.*;import leadtools.imageprocessing.CloneCommand;import leadtools.imageprocessing.FillCommand;import leadtools.imageprocessing.FlipCommand;import leadtools.imageprocessing.GrayscaleCommand;import leadtools.imageprocessing.color.InvertCommand;import leadtools.imageprocessing.color.PosterizeCommand;public void orderExample() {final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images";RasterCodecs codecs = new RasterCodecs();String srcFileName = combine(LEAD_VARS_IMAGES_DIR, "Image1.cmp");// Load the image as BGR (default) and get the first pixel valueRasterImage image = codecs.load(srcFileName, 24, CodecsLoadByteOrder.BGR, 1, 1);System.out.printf("Order is %s%n", image.getOrder());image.dispose();// Load the image as RGB and get the first pixel valueimage = codecs.load(srcFileName, 24, CodecsLoadByteOrder.RGB, 1, 1);System.out.printf("Order is %s%n", image.getOrder());// Save itcodecs.save(image, srcFileName, RasterImageFormat.CMP, 0);// Clean upimage.dispose();codecs.dispose();assertTrue("file unsuccessfully saved to " + srcFileName, (new File(srcFileName)).exists());System.out.printf("File saved successfully to %s%n", srcFileName);}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
