- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Attributes | Friends

# ImageDescriptor Class Reference

This reference page is linked to from the following overview topics: Images.

Search for all occurrences

## Detailed Description

Describe an image, specifically how to interpret pixel data.

This class derives from PixelDescriptor and adds a bounding rectangle and spatial resolution.

Definition at line 1353 of file image.h.

`#include <image.h>`

Inheritance diagram for ImageDescriptor:
[legend]

List of all members.

## Public Types
enum | ResUnit { k_PixelsPerInch = 1, k_PixelsPerCentimeter = 2 }
| Resolution units (mainly used so resolution is preserved in PSD & TIFF files) More...
## Public Member Functions
| ImageDescriptor (int x, int y, int nx, int ny, MemoryChannelOrder order=orderRGBA, bool premult=true, char nc=4, ChannelType ct=uChar)
| Constructor -- make a descriptor...
| ImageDescriptor (int nx, int ny, MemoryChannelOrder order=orderRGBA, bool premult=true, char nc=4, ChannelType ct=uChar)
| Constructor -- make a descriptor...
| ImageDescriptor ()
| default constructor -- RGBA, premult, 4 channel uChar, size 0 x 0 pixels.
int | numBytes () const
| return the number of bytes the raw image pixels will occupy -- not necessarily accurate for VirtualImages
int | strideBytes () const
| return the number of bytes wide that the image is
int | xSize () const
| return the x Size of the image
int | ySize () const
| return the y Size of the image
int | cSize () const
| return the channel count of the image
bool | sizeEqual (const ImageDescriptor &o) const
| return true if the x and y dimensions are equal
void | setSize (int nx, int ny)
| Set the size of the image in pixels.
const ImgTile & | getBounds () const
| return the bounds of the image
void | getResolutionInfo (float &xRes, float &yRes, ResUnit &unit) const
| return the horizontal and vertical resolution of the image
void | setResolutionInfo (float xRes, float yRes, ResUnit unit)
| set the horizontal and vertical resolution of the image
## Protected Attributes
ImgTile | m_Bounds
| Bounds of the image -- some images may not have a 0,0 origin.
float | m_xResolution
| horizontal resolution in pixels per unit
float | m_yResolution
| vertical resolution in pixels per unit
ResUnit | m_ResolutionUnits
| units -- 1 == inch, 2 == centimeter (same as in PSD files)
## Friends
class | Image

## Member Enumeration Documentation

enum ResUnit

Search for all occurrences

Resolution units (mainly used so resolution is preserved in PSD & TIFF files)

Enumerator:

  k_PixelsPerInch | pixels per inch Search for all occurrences
  k_PixelsPerCentimeter | pixels per centimeter Search for all occurrences

Definition at line 1357 of file image.h.

                     { k_PixelsPerInch       = 1,
                       k_PixelsPerCentimeter = 2
        };

## Constructor & Destructor Documentation

ImageDescriptor | ( | int | x,
|  | int | y,
|  | int | nx,
|  | int | ny,
|  | MemoryChannelOrder | order = `orderRGBA`,
|  | bool | premult = `true`,
|  | char | nc = `4`,
|  | ChannelType | ct = `uChar`
| ) |  | `[inline]`

Constructor -- make a descriptor...

Parameters:

  x | x origin of the image
  y | y origin of the image
  nx | xSize of the image
  ny | ySize of the image
  order | channel ordering of the image
  premult | Are the RGB channels premultiplied by the A?
  nc | number of channels -- currently only 4 is supported
  ct | data type of the channels -- currently only uChar is supported.

Definition at line 1382 of file image.h.

                                                             :
            PixelDescriptor(nc, ct, order, premult),
            m_Bounds(x, y, nx, ny),
            m_xResolution(100.0f), m_yResolution(100.0f),
            m_ResolutionUnits(k_PixelsPerInch) {}

ImageDescriptor | ( | int | nx,
|  | int | ny,
|  | MemoryChannelOrder | order = `orderRGBA`,
|  | bool | premult = `true`,
|  | char | nc = `4`,
|  | ChannelType | ct = `uChar`
| ) |  | `[inline]`

Constructor -- make a descriptor...

Parameters:

  nx | xSize of the image
  ny | ySize of the image
  order | channel ordering of the image
  premult | Are the RGB channels premultiplied by the A?
  nc | number of channels -- currently only 4 is supported
  ct | data type of the channels -- currently only uChar is supported.

Definition at line 1401 of file image.h.

                                                             :
            PixelDescriptor(nc, ct, order, premult),
            m_Bounds(0, 0, nx, ny) {}

ImageDescriptor | ( |  | ) | `[inline]`

default constructor -- RGBA, premult, 4 channel uChar, size 0 x 0 pixels.

Definition at line 1409 of file image.h.

                          :
            PixelDescriptor(4, uChar,  orderRGBA, true),
            m_Bounds(0,0,0,0) {}

## Member Function Documentation

int numBytes | ( |  | ) | const `[inline]`

Search for all occurrences

return the number of bytes the raw image pixels will occupy -- not necessarily accurate for VirtualImages

Definition at line 1415 of file image.h.

    { return m_Bounds.nx * m_Bounds.ny * pixelSize(); }

int strideBytes | ( |  | ) | const `[inline]`

Search for all occurrences

return the number of bytes wide that the image is

Definition at line 1418 of file image.h.

    { return m_Bounds.nx * pixelSize(); }

int xSize | ( |  | ) | const `[inline]`

Search for all occurrences

return the x Size of the image

Definition at line 1421 of file image.h.

    { return m_Bounds.nx;  }

int ySize | ( |  | ) | const `[inline]`

Search for all occurrences

return the y Size of the image

Definition at line 1424 of file image.h.

    { return m_Bounds.ny;  }

int cSize | ( |  | ) | const `[inline]`

Search for all occurrences

return the channel count of the image

Definition at line 1427 of file image.h.

    { return m_cCount; }

bool sizeEqual | ( | const ImageDescriptor & | o | ) | const `[inline]`

Search for all occurrences

return true if the x and y dimensions are equal

Parameters:

  o | the other descriptor to compare against.

Definition at line 1432 of file image.h.

            { return ((xSize() == o.xSize()) && (ySize() == o.ySize())); }

void setSize | ( | int | nx,
|  | int | ny
| ) |  | `[inline]`

Search for all occurrences

Set the size of the image in pixels.

Definition at line 1436 of file image.h.

    { m_Bounds.nx = nx; m_Bounds.ny = ny; }

const ImgTile& getBounds | ( |  | ) | const `[inline]`

Search for all occurrences

return the bounds of the image

Definition at line 1439 of file image.h.

    { return m_Bounds; }

void getResolutionInfo | ( | float & | xRes,
|  | float & | yRes,
|  | ResUnit & | unit
| ) |  | const `[inline]`

Search for all occurrences

return the horizontal and vertical resolution of the image

Parameters:

  xRes | returned X Resolution in Pixels per unit
  yRes | returned y Resolution in Pixels per unit
  unit | returned resolution unit

Definition at line 1447 of file image.h.

        {
            xRes = m_xResolution; yRes = m_yResolution, unit = m_ResolutionUnits;
        }

void setResolutionInfo | ( | float | xRes,
|  | float | yRes,
|  | ResUnit | unit
| ) |  | `[inline]`

Search for all occurrences

set the horizontal and vertical resolution of the image

Parameters:

  xRes | new X Resolution in Pixels per unit
  yRes | new y Resolution in Pixels per unit
  unit | new resolution unit

Definition at line 1458 of file image.h.

        {
            m_xResolution = xRes; m_yResolution = yRes, m_ResolutionUnits = unit;
        }

## Friends And Related Function Documentation

friend class Image `[friend]`

Search for all occurrences

Definition at line 1463 of file image.h.

## Member Data Documentation

ImgTile m_Bounds `[protected]`

Search for all occurrences

Bounds of the image -- some images may not have a 0,0 origin.

Definition at line 1362 of file image.h.

float m_xResolution `[protected]`

Search for all occurrences

horizontal resolution in pixels per unit

Definition at line 1364 of file image.h.

float m_yResolution `[protected]`

Search for all occurrences

vertical resolution in pixels per unit

Definition at line 1365 of file image.h.

ResUnit m_ResolutionUnits `[protected]`

Search for all occurrences

units -- 1 == inch, 2 == centimeter (same as in PSD files)

Definition at line 1366 of file image.h.

The documentation for this class was generated from the following file:

- Mudbox/image.h

ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor
ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor ImageDescriptor