---
title: "CmxRasterImage"
url: "https://reference.aspose.com/imaging/java/com.aspose.imaging.fileformats.cmx.objectmodel.specs/cmxrasterimage/"
product: "Aspose.Imaging for Java API Reference"
description: "Represents the data specified for raster images."
---

**Inheritance:**
java.lang.Object

**All Implemented Interfaces:**
[com.aspose.imaging.fileformats.cmx.objectmodel.specs.ICmxObjectSpec](../../com.aspose.imaging.fileformats.cmx.objectmodel.specs/icmxobjectspec)
```
public class CmxRasterImage implements ICmxObjectSpec
```

Represents the data specified for raster images.
## Constructors

| Constructor | Description |
| --- | --- |
| [CmxRasterImage()](#CmxRasterImage--) |  |
## Methods

| Method | Description |
| --- | --- |
| [getType()](#getType--) | Gets the type of the image. |
| [setType(int value)](#setType-int-) | Sets the type of the image. |
| [getCompression()](#getCompression--) | Gets the compression. |
| [setCompression(int value)](#setCompression-int-) | Sets the compression. |
| [getSize()](#getSize--) | Gets the size of the image. |
| [setSize(long value)](#setSize-long-) | Sets the size of the image. |
| [getCompressedSize()](#getCompressedSize--) | Gets the compressed size of the image. |
| [setCompressedSize(long value)](#setCompressedSize-long-) | Sets the compressed size of the image. |
| [isMask()](#isMask--) | Gets a value indicating whether this instance is mask. |
| [setMask(boolean value)](#setMask-boolean-) | Sets a value indicating whether this instance is mask. |
| [getColorModel()](#getColorModel--) | Gets the color model. |
| [setColorModel(long value)](#setColorModel-long-) | Sets the color model. |
| [getWidth()](#getWidth--) | Gets the width of the image. |
| [setWidth(long value)](#setWidth-long-) | Sets the width of the image. |
| [getHeight()](#getHeight--) | Gets the height of the image. |
| [setHeight(long value)](#setHeight-long-) | Sets the height of the image. |
| [getBitsPerPixel()](#getBitsPerPixel--) | Gets the bits per pixel. |
| [setBitsPerPixel(long value)](#setBitsPerPixel-long-) | Sets the bits per pixel. |
| [getBytesPerLine()](#getBytesPerLine--) | Gets the size of the line. |
| [setBytesPerLine(long value)](#setBytesPerLine-long-) | Sets the size of the line. |
| [getColorPalette()](#getColorPalette--) | Gets the color palette array. |
| [setColorPalette(int[] value)](#setColorPalette-int---) | Sets the color palette array. |
| [getRawData()](#getRawData--) | Gets the raw byte data of the image. |
| [setRawData(byte[] value)](#setRawData-byte---) | Sets the raw byte data of the image. |
| [toString()](#toString--) | Returns a String that represents this instance. |
| [equals(Object o)](#equals-java.lang.Object-) | Check if objects are equal. |
| [hashCode()](#hashCode--) | Get hash code of the current object. |
### CmxRasterImage() {#CmxRasterImage--}
```
public CmxRasterImage()
```


### getType() {#getType--}
```
public final int getType()
```


Gets the type of the image.

**Returns:**
int - the type of the image.
### setType(int value) {#setType-int-}
```
public final void setType(int value)
```


Sets the type of the image.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | int | the type of the image. |

### getCompression() {#getCompression--}
```
public final int getCompression()
```


Gets the compression.

**Returns:**
int - the compression.
### setCompression(int value) {#setCompression-int-}
```
public final void setCompression(int value)
```


Sets the compression.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | int | the compression. |

### getSize() {#getSize--}
```
public final long getSize()
```


Gets the size of the image. Measures in bytes.

**Returns:**
long - the size of the image.
### setSize(long value) {#setSize-long-}
```
public final void setSize(long value)
```


Sets the size of the image. Measures in bytes.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the size of the image. |

### getCompressedSize() {#getCompressedSize--}
```
public final long getCompressedSize()
```


Gets the compressed size of the image. Measures in bytes.

**Returns:**
long - the compressed size of the image.
### setCompressedSize(long value) {#setCompressedSize-long-}
```
public final void setCompressedSize(long value)
```


Sets the compressed size of the image. Measures in bytes.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the compressed size of the image. |

### isMask() {#isMask--}
```
public final boolean isMask()
```


Gets a value indicating whether this instance is mask.

**Returns:**
boolean - a value indicating whether this instance is mask.
### setMask(boolean value) {#setMask-boolean-}
```
public final void setMask(boolean value)
```


Sets a value indicating whether this instance is mask.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | boolean | a value indicating whether this instance is mask. |

### getColorModel() {#getColorModel--}
```
public final long getColorModel()
```


Gets the color model.

**Returns:**
long - the color model.
### setColorModel(long value) {#setColorModel-long-}
```
public final void setColorModel(long value)
```


Sets the color model.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the color model. |

### getWidth() {#getWidth--}
```
public final long getWidth()
```


Gets the width of the image. Measures in pixels.

**Returns:**
long - the width of the image.
### setWidth(long value) {#setWidth-long-}
```
public final void setWidth(long value)
```


Sets the width of the image. Measures in pixels.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the width of the image. |

### getHeight() {#getHeight--}
```
public final long getHeight()
```


Gets the height of the image. Measures in pixels.

**Returns:**
long - the height of the image.
### setHeight(long value) {#setHeight-long-}
```
public final void setHeight(long value)
```


Sets the height of the image. Measures in pixels.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the height of the image. |

### getBitsPerPixel() {#getBitsPerPixel--}
```
public final long getBitsPerPixel()
```


Gets the bits per pixel.

**Returns:**
long - the bits per pixel.
### setBitsPerPixel(long value) {#setBitsPerPixel-long-}
```
public final void setBitsPerPixel(long value)
```


Sets the bits per pixel.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the bits per pixel. |

### getBytesPerLine() {#getBytesPerLine--}
```
public final long getBytesPerLine()
```


Gets the size of the line. Measures in bytes.

**Returns:**
long - the size of the line.
### setBytesPerLine(long value) {#setBytesPerLine-long-}
```
public final void setBytesPerLine(long value)
```


Sets the size of the line. Measures in bytes.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | long | the size of the line. |

### getColorPalette() {#getColorPalette--}
```
public final int[] getColorPalette()
```


Gets the color palette array. Elements is ARGB color values represents in `int`

**Returns:**
int[] - the color palette array.
### setColorPalette(int[] value) {#setColorPalette-int---}
```
public final void setColorPalette(int[] value)
```


Sets the color palette array. Elements is ARGB color values represents in `int`

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | int[] | the color palette array. |

### getRawData() {#getRawData--}
```
public final byte[] getRawData()
```


Gets the raw byte data of the image.

**Returns:**
byte[] - the raw byte data of the image.
### setRawData(byte[] value) {#setRawData-byte---}
```
public final void setRawData(byte[] value)
```


Sets the raw byte data of the image.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | byte[] | the raw byte data of the image. |

### toString() {#toString--}
```
public String toString()
```


Returns a String that represents this instance.

**Returns:**
java.lang.String - A String that represents this instance.
### equals(Object o) {#equals-java.lang.Object-}
```
public boolean equals(Object o)
```


Check if objects are equal.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| o | java.lang.Object | The other object. |

**Returns:**
boolean - The equality comparison result.
### hashCode() {#hashCode--}
```
public int hashCode()
```


Get hash code of the current object.

**Returns:**
int - The hash code.
