CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
OdGiRasterImageDesc Class Reference

#include <GiRasterWrappers.h>

Inheritance diagram for OdGiRasterImageDesc:
OdGiRasterImageParam OdGiRasterImage OdRxObject

Public Member Functions

 OdGiRasterImageDesc ()
 
virtual ~OdGiRasterImageDesc ()
 
void setFrom (const OdGiRasterImage *pSourceImage)
 
OdRxObjectPtr clone () const
 
void copyFrom (const OdRxObject *pSource)
 
OdUInt32 pixelWidth () const
 
OdUInt32 pixelHeight () const
 
OdUInt32 colorDepth () const
 
OdUInt32 numColors () const
 
ODCOLORREF color (OdUInt32 colorIndex) const
 
OdUInt32 paletteDataSize () const
 
void paletteData (OdUInt8 *bytes) const
 
OdUInt32 scanLineSize () const
 
const OdUInt8scanLines () const
 
void scanLines (OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
 
PixelFormatInfo pixelFormat () const
 
OdUInt32 scanLinesAlignment () const
 
Units defaultResolution (double &xPelsPerUnit, double &yPelsPerUnit) const
 
void setPixelWidth (OdUInt32 pixelWidth)
 
void setPixelHeight (OdUInt32 pixelHeight)
 
void setColorDepth (OdUInt32 colorDepth)
 
OdGiRasterImage::PixelFormatInfopixelFormat ()
 
void setPalette (OdUInt32 paletteSize, OdUInt8 *paletteData)
 
void setScanLinesAlignment (OdUInt32 alignment)
 
void setDefaultResolution (Units units, double xPelsPerUnit, double yPelsPerUnit)
 
OdUInt32 supportedParams () const
 
OdGiRasterImage::ImageSource imageSource () const
 
void setImageSource (OdGiRasterImage::ImageSource source)
 
const OdStringsourceFileName () const
 
void setSourceFileName (const OdString &fileName)
 
OdGiRasterImage::TransparencyMode transparencyMode () const
 
void setTransparencyMode (OdGiRasterImage::TransparencyMode mode)
 
- Public Member Functions inherited from OdGiRasterImageParam
 ODRX_DECLARE_MEMBERS (OdGiRasterImageParam)
 
virtual OdUInt32 supportedParams () const =0
 
virtual void setImageSource (ImageSource source)
 
virtual void setSourceFileName (const OdString &fileName)
 
virtual void setTransparencyMode (TransparencyMode mode)
 
- Public Member Functions inherited from OdGiRasterImage
 ODRX_DECLARE_MEMBERS (OdGiRasterImage)
 
virtual OdUInt32 pixelWidth () const =0
 
virtual OdUInt32 pixelHeight () const =0
 
virtual Units defaultResolution (double &xPelsPerUnit, double &yPelsPerUnit) const
 
virtual OdUInt32 colorDepth () const =0
 
virtual OdUInt32 numColors () const =0
 
virtual int transparentColor () const
 
virtual ODCOLORREF color (OdUInt32 colorIndex) const =0
 
virtual OdUInt32 paletteDataSize () const =0
 
virtual void paletteData (OdUInt8 *bytes) const =0
 
virtual OdUInt32 scanLineSize () const
 
virtual const OdUInt8scanLines () const =0
 
virtual void scanLines (OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const =0
 
virtual PixelFormatInfo pixelFormat () const =0
 
virtual OdUInt32 scanLinesAlignment () const =0
 
virtual ImageSource imageSource () const
 
virtual const OdStringsourceFileName () const
 
virtual TransparencyMode transparencyMode () const
 
OdSmartPtr< OdGiRasterImagechangeImageSource (ImageSource source, const OdChar *pFileName=NULL)
 
OdSmartPtr< OdGiRasterImagechangeSourceFileName (const OdString &fileName)
 
OdSmartPtr< OdGiRasterImagechangeTransparencyMode (TransparencyMode mode)
 
OdSmartPtr< OdGiRasterImageconvert (bool convertPaletteToRGB, double brightness=50.0, double contrast=50.0, double fade=0.0, ODCOLORREF backgroundColor=0, bool flipX=false, bool flipY=false, bool rotate90=false, const OdGiRasterImage *pDestDesc=0, bool transparency=false) const
 
virtual OdSmartPtr< OdGiRasterImagecrop (OdUInt32 x, OdUInt32 y, OdUInt32 width, OdUInt32 height) const
 
virtual voidimp () const
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static OdGiRasterImagePtr createObject (OdUInt32 pixelWidth, OdUInt32 pixelHeight, Units units=kNone, double xPelsPerUnit=0.0, double yPelsPerUnit=0.0)
 
static OdGiRasterImagePtr createObject (OdUInt32 pixelWidth, OdUInt32 pixelHeight, OdUInt32 colorDepth, Units units=kNone, double xPelsPerUnit=0.0, double yPelsPerUnit=0.0)
 
static OdGiRasterImagePtr createObject (const OdGiRasterImage *pSourceImage)
 
- Static Public Member Functions inherited from OdGiRasterImage
static double millimetersInUnit (Units units)
 
static OdUInt32 calcBMPScanLineSize (OdUInt32 pixelWidth, int colorDepth)
 
static OdUInt32 calcColorMask (OdUInt8 numColorBits, OdUInt8 colorOffset=0)
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Additional Inherited Members

- Public Types inherited from OdGiRasterImageParam
enum  ParamType { kImageSource = (1 << 0) , kTransparencyMode = (1 << 1) , kSourceFileName = (1 << 2) }
 
- Public Types inherited from OdGiRasterImage
enum  Units {
  kNone = 0 , kMillimeter , kCentimeter , kMeter ,
  kKilometer , kInch , kFoot , kYard ,
  kMile , kMicroinches , kMils , kAngstroms ,
  kNanometers , kMicrons , kDecimeters , kDekameters ,
  kHectometers , kGigameters , kAstronomical , kLightYears ,
  kParsecs
}
 
enum  ImageSource {
  kUndefinedSource = -1 , kFromDwg = 0 , kFromOleObject = 1 , kFromRender = 2 ,
  kFromUnderlay = 10 , kFromImageBGRA32 = 11 , kFromPdfUnderlay = kFromOleObject , kFromFile = kFromDwg
}
 
enum  TransparencyMode { kTransparencyDef = -1 , kTransparencyOff = 0 , kTransparency1Bit = 1 , kTransparency8Bit = 2 }
 
typedef struct OdGiRasterImage::tagPixelFormatInfo PixelFormatInfo
 

Detailed Description

This class is a dummy implementation of the OdGiRasterImage interface.

Remarks
This class is intended to be used to preset image parameters for OdDbRasterImageDef objects without the actual loading of raster image files. Corresponding C++ library: TD_Gi <group OdGi_Classes>
See also
<link gi_raster_images, Work with Raster Images>

Definition at line 45 of file GiRasterWrappers.h.

Constructor & Destructor Documentation

◆ OdGiRasterImageDesc()

OdGiRasterImageDesc::OdGiRasterImageDesc ( )

Default constructor for the OdGiRasterImageDesc class. Sets the following data members:

Value Description m_pixelWidth 0 Image width in pixels. m_pixelHeight 0 Image height in pixels. m_colorDepth 0 Number of bits that represent image color depth. m_palSize 0 Color palette size. m_alignment 1 Scanline alignment in bytes. m_units kNone Measurement units. m_xPelsPerUnit 0.0 Pixel per units in the x direction. m_yPelsPerUnit 0.0 Pixel per units in the y direction. m_pPal NULL Pointer to color palette. m_imageSource kUndefinedSource Image source type. m_transparencyMode kTransparencyDef Transparency mode.

◆ ~OdGiRasterImageDesc()

virtual OdGiRasterImageDesc::~OdGiRasterImageDesc ( )
virtual

Destructor for the OdGiRasterImageDesc class, clears palette colors.

Member Function Documentation

◆ clone()

OdRxObjectPtr OdGiRasterImageDesc::clone ( ) const
virtual

Creates a clone of this object, and returns a pointer to the clone.

Returns
smart pointer to the cloned object.

Reimplemented from OdRxObject.

◆ color()

ODCOLORREF OdGiRasterImageDesc::color ( OdUInt32  colorIndex) const
virtual

Retrieves the color for the specified index from the palette of this RasterImage object.

Parameters
colorIndex[in] Color index.
Returns
color at the specified index as ODCOLORREF (OdUInt32 value).

Implements OdGiRasterImage.

◆ colorDepth()

OdUInt32 OdGiRasterImageDesc::colorDepth ( ) const
virtual

Retrieves the number of bits per pixel used for colors by this RasterImage object.

Returns
number of bits per pixel that represents color depth.

Implements OdGiRasterImage.

◆ copyFrom()

void OdGiRasterImageDesc::copyFrom ( const OdRxObject pSource)
virtual

Copies data of a source object to the current object.

Parameters
pSource[in] Input source object.

Reimplemented from OdRxObject.

◆ createObject() [1/3]

static OdGiRasterImagePtr OdGiRasterImageDesc::createObject ( const OdGiRasterImage pSourceImage)
static

Creates an OdGiRasterImageDesc object with the specified parameters.

Parameters
pSourceImage[in] Source raster image to copy parameters from.
Returns
Returns a SmartPointer to the newly created object.

◆ createObject() [2/3]

static OdGiRasterImagePtr OdGiRasterImageDesc::createObject ( OdUInt32  pixelWidth,
OdUInt32  pixelHeight,
OdUInt32  colorDepth,
Units  units = kNone,
double  xPelsPerUnit = 0.0,
double  yPelsPerUnit = 0.0 
)
static

Creates an OdGiRasterImageDesc object with the specified parameters.

Parameters
pixelWidth[in] Image width in pixels.
pixelHeight[in] Image height in pixels.
colorDepth[in] Number of bits per pixel used for colors.
units[in] Units / pixel.
xPelsPerUnit[in] Pixels per unit value (x direction).
yPelsPerUnit[in] Pixels per unit value (y direction).
Returns
Returns a SmartPointer to the newly created object.

◆ createObject() [3/3]

static OdGiRasterImagePtr OdGiRasterImageDesc::createObject ( OdUInt32  pixelWidth,
OdUInt32  pixelHeight,
Units  units = kNone,
double  xPelsPerUnit = 0.0,
double  yPelsPerUnit = 0.0 
)
static

Creates an OdGiRasterImageDesc object with the specified parameters.

Parameters
pixelWidth[in] Image width in pixels.
pixelHeight[in] Image height in pixels.
units[in] Units / pixel.
xPelsPerUnit[in] Pixels per unit value (x direction).
yPelsPerUnit[in] Pixels per unit value (y direction).
Returns
Returns a SmartPointer to the newly created object.

◆ defaultResolution()

Units OdGiRasterImageDesc::defaultResolution ( double &  xPelsPerUnit,
double &  yPelsPerUnit 
) const
virtual

Retrieves the default image resolution in pixels per unit of this RasterImage object.

Parameters
xPelsPerUnit[out] Receives the pixels per unit value (x direction).
yPelsPerUnit[out] Receives the pixels per unit value (y direction).
Returns
units that are used to measure image dimensions.
Remarks
If the returned value is kNone, then xPelsPerUnit and yPelsPerUnit are not set.

Reimplemented from OdGiRasterImage.

◆ imageSource()

OdGiRasterImage::ImageSource OdGiRasterImageDesc::imageSource ( ) const
virtual

Retrieves the image source.

Returns
image source represented by a value from the OdGiRasterImage::ImageSource enumeration.

Reimplemented from OdGiRasterImage.

◆ numColors()

OdUInt32 OdGiRasterImageDesc::numColors ( ) const
virtual

Retrieves the number of colors in the palette of this RasterImage object.

Returns
number of bits per pixel that represents color depth.

Implements OdGiRasterImage.

◆ paletteData()

void OdGiRasterImageDesc::paletteData ( OdUInt8 bytes) const
virtual

Retrieves the palette in BMP format of this RasterImage object.

Parameters
bytes[out] Receives the palette data.
Remarks
It is up to the caller to allocate sufficient memory for the palette data.

Implements OdGiRasterImage.

◆ paletteDataSize()

OdUInt32 OdGiRasterImageDesc::paletteDataSize ( ) const
virtual

Retrieves the size (in bytes) of the palette data of this RasterImage object.

Returns
palette data size as OdUInt32 value.

Implements OdGiRasterImage.

◆ pixelFormat() [1/2]

OdGiRasterImage::PixelFormatInfo & OdGiRasterImageDesc::pixelFormat ( )

Retrieves the pixel format for this RasterImage object.

Returns
the pixel format of the palette, unless there is no palette, in which case it returns the pixel format of the image itself.

◆ pixelFormat() [2/2]

PixelFormatInfo OdGiRasterImageDesc::pixelFormat ( ) const
virtual

Retrieves the pixel format for this RasterImage object.

Returns
the pixel format of the palette, unless there is no palette, in which case it returns the pixel format of the image itself.

Implements OdGiRasterImage.

◆ pixelHeight()

OdUInt32 OdGiRasterImageDesc::pixelHeight ( ) const
virtual

Retrieves the image height in pixels of this RasterImage object.

Returns
image height in pixels.

Implements OdGiRasterImage.

◆ pixelWidth()

OdUInt32 OdGiRasterImageDesc::pixelWidth ( ) const
virtual

Retrieves the image width in pixels of this RasterImage object.

Returns
image width in pixels.

Implements OdGiRasterImage.

◆ scanLines() [1/2]

const OdUInt8 * OdGiRasterImageDesc::scanLines ( ) const
virtual

Retrieves scan lines for this object.

Returns
NULL for an OdGiRasterImageDesc object.

Implements OdGiRasterImage.

◆ scanLines() [2/2]

void OdGiRasterImageDesc::scanLines ( OdUInt8 scnLines,
OdUInt32  firstScanline,
OdUInt32  numLines = 1 
) const
virtual

Retrieves the specified set of scanlines in BMP format for this RasterImage object, or the pixel data in BMP format for this RasterImage object.

Parameters
scnLines[out] Receives the scanline data.
firstScanline[in] Index of first scanline to retrieve.
numLines[in] Number of scanlines to retrieve.
Remarks
The number of accessible scanlines is equal to the value returned by pixelHeight(). The number of accessible bytes in a scanline is equal to the value returned by scanLineSize(). The scanline returned by firstScanline == 0 is the first scanline in the image. The scanline returned by firstScanline == (pixelHeight() - 1) is the last scanline in the image.
It us up to the caller to allocate sufficient memory for the scanline data.
Returns nothing for an OdGiRasterImageDesc object.

Implements OdGiRasterImage.

◆ scanLinesAlignment()

OdUInt32 OdGiRasterImageDesc::scanLinesAlignment ( ) const
virtual

Retrieves the scanline alignment, in bytes, for this RasterImage object. Example: scanLinesAlignment() returns 4 for Windows BMP.

Returns
scanline alignment as OdUInt32 value.

Implements OdGiRasterImage.

◆ scanLineSize()

OdUInt32 OdGiRasterImageDesc::scanLineSize ( ) const
virtual

Retrieves the scanline size of this RasterImage object.

Returns
the number of bytes between the beginning of scanline N and the beginning of scanline N+1 (taking into account any padding that is added to the end of the scanline).

Reimplemented from OdGiRasterImage.

◆ setColorDepth()

void OdGiRasterImageDesc::setColorDepth ( OdUInt32  colorDepth)

Sets the number of bits per pixel used for colors by this RasterImageDesc object.

Parameters
colorDepth[in] Color depth.

◆ setDefaultResolution()

void OdGiRasterImageDesc::setDefaultResolution ( Units  units,
double  xPelsPerUnit,
double  yPelsPerUnit 
)

Sets the default raster image resolution for this RasterImage object.

Parameters
units[in] Units / pixel.
xPelsPerUnit[in] Pixels per unit value (x direction).
yPelsPerUnit[in] Pixels per unit value (y direction).

◆ setFrom()

void OdGiRasterImageDesc::setFrom ( const OdGiRasterImage pSourceImage)

Copies parameters from an original OdGiRasterImage object.

Parameters
pSourceImage[in] Pointer to the original image object.

◆ setImageSource()

void OdGiRasterImageDesc::setImageSource ( OdGiRasterImage::ImageSource  source)
virtual

Sets an image source.

Parameters
source[in] New image source value.

Reimplemented from OdGiRasterImageParam.

◆ setPalette()

void OdGiRasterImageDesc::setPalette ( OdUInt32  paletteSize,
OdUInt8 paletteData 
)

Sets the palette in BMP format for this RasterImageDesc object.

Parameters
paletteData[in] Palette data.
paletteSize[in] Palette size in bytes.

◆ setPixelHeight()

void OdGiRasterImageDesc::setPixelHeight ( OdUInt32  pixelHeight)

Sets the image height in pixels of this RasterImageDesc object.

Parameters
pixelHeight[in] Pixel height.

◆ setPixelWidth()

void OdGiRasterImageDesc::setPixelWidth ( OdUInt32  pixelWidth)

Sets the image width in pixels of this RasterImageDesc object.

Parameters
pixelWidth[in] Pixel width.

◆ setScanLinesAlignment()

void OdGiRasterImageDesc::setScanLinesAlignment ( OdUInt32  alignment)

Sets the scanline alignment, in bytes, for this RasterImage object.

Parameters
alignment[in] Scanline alignment. Example: Alignment is 4 for Windows BMP.

◆ setSourceFileName()

void OdGiRasterImageDesc::setSourceFileName ( const OdString fileName)
virtual

Sets an image source file name.

Parameters
fileName[in] New value for image source file name.

Reimplemented from OdGiRasterImageParam.

◆ setTransparencyMode()

void OdGiRasterImageDesc::setTransparencyMode ( OdGiRasterImage::TransparencyMode  mode)
virtual

Sets an image transparency mode.

Parameters
mode[in] New transparency mode value.

Reimplemented from OdGiRasterImageParam.

◆ sourceFileName()

const OdString & OdGiRasterImageDesc::sourceFileName ( ) const
virtual

Retrieves the image source file name.

Returns
full path to a file from which image is loaded.

Reimplemented from OdGiRasterImage.

◆ supportedParams()

OdUInt32 OdGiRasterImageDesc::supportedParams ( ) const
virtual

Retrieves the ParamType bitflags with which parameters are supported by this interface.

Returns
bitflags that represent supported parameters.

Implements OdGiRasterImageParam.

◆ transparencyMode()

OdGiRasterImage::TransparencyMode OdGiRasterImageDesc::transparencyMode ( ) const
virtual

Retrieves the transparency mode for 32bpp formats.

Returns
transparency mode represented by a value from the TransparencyMode enumeration.

Reimplemented from OdGiRasterImage.


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