CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdGiPatchworkRasterImage Class Reference

#include <GiCubeMap.h>

Inheritance diagram for OdGiPatchworkRasterImage:
OdGiRasterImageParam OdGiRasterImage OdRxObject

Public Member Functions

 OdGiPatchworkRasterImage ()
 
virtual ~OdGiPatchworkRasterImage ()
 
void setRasterDimensions (OdUInt32 uWidth, OdUInt32 uHeight)
 
void setBackgroundColor (ODCOLORREF bkColor)
 
ODCOLORREF backgroundColor () const
 
void addRasterImage (const OdGiRasterImage *pRaster, OdInt32 nPosX, OdInt32 nPosY)
 
void removeRasterImage (const OdGiRasterImage *pRaster)
 
OdUInt32 numRasterImages () const
 
const OdGiRasterImagegetRasterImage (OdUInt32 nRaster, OdInt32 *pPosX=nullptr, OdInt32 *pPosY=nullptr) const
 
OdUInt32 pixelWidth () const
 
OdUInt32 pixelHeight () const
 
Units defaultResolution (double &xPelsPerUnit, double &yPelsPerUnit) const
 
OdUInt32 colorDepth () const
 
OdUInt32 numColors () const
 
ODCOLORREF color (OdUInt32 colorIndex) const
 
OdUInt32 paletteDataSize () const
 
void paletteData (OdUInt8 *bytes) const
 
OdUInt32 scanLineSize () const
 
void scanLines (OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
 
const OdUInt8scanLines () const
 
PixelFormatInfo pixelFormat () const
 
OdUInt32 scanLinesAlignment () const
 
int transparentColor () const
 
ImageSource imageSource () const
 
const OdStringsourceFileName () const
 
TransparencyMode transparencyMode () const
 
OdUInt32 supportedParams () const
 
void setImageSource (ImageSource source)
 
void setSourceFileName (const OdString &fileName)
 
void setTransparencyMode (TransparencyMode mode)
 
voidimp () const
 
OdRxObjectPtr clone () const
 
void copyFrom (const OdRxObject *pSource)
 
- Public Member Functions inherited from OdGiRasterImageParam
 ODRX_DECLARE_MEMBERS (OdGiRasterImageParam)
 
- Public Member Functions inherited from OdGiRasterImage
 ODRX_DECLARE_MEMBERS (OdGiRasterImage)
 
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
 
- 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 OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static OdGiRasterImagePtr createObject (OdUInt32 nWidth, OdUInt32 nHeight, ODCOLORREF bkColor=0)
 
- 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 ()
 
static void rxInit ()
 
static void rxUninit ()
 

Protected Member Functions

const RIEntry * findEntry (OdUInt32 nScanline, OdUInt32 nPixel) const
 
void encodeBkColor ()
 

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

Represents set of separate raster image tiles as single raster image.

Corresponding C++ library: TD_Gi

Remarks
Transforming an image does not affect the orignal image. Supports only true color raster images. Raster images with palette is not supported. <group OdGi_Classes>
See also
<link gi_raster_images, Work with Raster Images>

Definition at line 45 of file GiCubeMap.h.

Constructor & Destructor Documentation

◆ OdGiPatchworkRasterImage()

OdGiPatchworkRasterImage::OdGiPatchworkRasterImage ( )

Default constructor for the OdGiRasterImageWrapper class.

◆ ~OdGiPatchworkRasterImage()

virtual OdGiPatchworkRasterImage::~OdGiPatchworkRasterImage ( )
virtual

Destructor for the OdGiRasterImageWrapper class.

Member Function Documentation

◆ addRasterImage()

void OdGiPatchworkRasterImage::addRasterImage ( const OdGiRasterImage * pRaster,
OdInt32 nPosX,
OdInt32 nPosY )

Adds original OdGiRasterImage object to specified position inside final raster image.

Parameters
pRaster[in] Pointer to the original image object.
nPosX[in] X-axis position.
nPosY[in] Y-axis position.

◆ backgroundColor()

ODCOLORREF OdGiPatchworkRasterImage::backgroundColor ( ) const
inline

Retrieves raster image background color.

Returns
Background color.

Definition at line 98 of file GiCubeMap.h.

◆ clone()

OdRxObjectPtr OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::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()

static OdGiRasterImagePtr OdGiPatchworkRasterImage::createObject ( OdUInt32 nWidth,
OdUInt32 nHeight,
ODCOLORREF bkColor = 0 )
static

Creates an OdGiRasterImageAlphaChannelAdder object with the specified parameters.

Parameters
nWidth[in] Raster image width.
nHeight[in] Raster image height.
bkColor[in] Background color.
Returns
Returns a SmartPointer to the newly created object.

◆ defaultResolution()

Units OdGiPatchworkRasterImage::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.

◆ encodeBkColor()

void OdGiPatchworkRasterImage::encodeBkColor ( )
protected

◆ findEntry()

const RIEntry * OdGiPatchworkRasterImage::findEntry ( OdUInt32 nScanline,
OdUInt32 nPixel ) const
protected

◆ getRasterImage()

const OdGiRasterImage * OdGiPatchworkRasterImage::getRasterImage ( OdUInt32 nRaster,
OdInt32 * pPosX = nullptr,
OdInt32 * pPosY = nullptr ) const
inline

Returns underlying raster image at specified index.

Parameters
nRaster[in] Raster image index.
Returns
Original raster image.

Definition at line 123 of file GiCubeMap.h.

◆ imageSource()

ImageSource OdGiPatchworkRasterImage::imageSource ( ) const
virtual

Retrieves the image source.

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

Reimplemented from OdGiRasterImage.

◆ imp()

void * OdGiPatchworkRasterImage::imp ( ) const
virtual

Retrieves the user-end implementation of raster image functionality.

Remarks
If not overridden by a user-end raster image implementation, always returns null.

Reimplemented from OdGiRasterImage.

◆ numColors()

OdUInt32 OdGiPatchworkRasterImage::numColors ( ) const
virtual

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

Returns
number of colors in the palette.

Implements OdGiRasterImage.

◆ numRasterImages()

OdUInt32 OdGiPatchworkRasterImage::numRasterImages ( ) const
inline

Returns number of underlying raster images.

Returns
Number of raster images.

Definition at line 117 of file GiCubeMap.h.

◆ paletteData()

void OdGiPatchworkRasterImage::paletteData ( OdUInt8 * bytes) const
virtual

Retrieves the size (in bytes) of the palette data 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 OdGiPatchworkRasterImage::paletteDataSize ( ) const
virtual

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

Returns
number of bytes that represents palette data size.

Implements OdGiRasterImage.

◆ pixelFormat()

PixelFormatInfo OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::pixelHeight ( ) const
virtual

Retrieves the image height in pixels of this RasterImage object.

Returns
image height in pixels.

Implements OdGiRasterImage.

◆ pixelWidth()

OdUInt32 OdGiPatchworkRasterImage::pixelWidth ( ) const
virtual

Retrieves the image width in pixels of this RasterImage object.

Returns
image width in pixels.

Implements OdGiRasterImage.

◆ removeRasterImage()

void OdGiPatchworkRasterImage::removeRasterImage ( const OdGiRasterImage * pRaster)

Removes original OdGiRasterImage object from final raster image.

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

◆ scanLines() [1/2]

const OdUInt8 * OdGiPatchworkRasterImage::scanLines ( ) const
virtual

Retrieves the set of scanlines.

Returns
set of scanlines.
Remarks
Implementation of this function is optional; NULL can be returned if it is inconvenient to implement. The caller must take into account that the return value can be NULL. If this method returns NULL, scanlines can be accessed by a second version of the scanLines() method with arguments where a memory buffer for scalines data is preallocated by the caller.

Implements OdGiRasterImage.

◆ scanLines() [2/2]

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

Retrieves the specified set of scanlines in BMP format from 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.

Implements OdGiRasterImage.

◆ scanLinesAlignment()

OdUInt32 OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::scanLineSize ( ) const
virtual

Retrieves the scanline size of this RasterImage object.

Remarks
This function 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.

◆ setBackgroundColor()

void OdGiPatchworkRasterImage::setBackgroundColor ( ODCOLORREF bkColor)
inline

Sets raster image background color.

Parameters
bkColor[in] Background color.

Definition at line 93 of file GiCubeMap.h.

◆ setImageSource()

void OdGiPatchworkRasterImage::setImageSource ( ImageSource source)
virtual

Sets an image source.

Parameters
source[in] New image source value.

Reimplemented from OdGiRasterImageParam.

◆ setRasterDimensions()

void OdGiPatchworkRasterImage::setRasterDimensions ( OdUInt32 uWidth,
OdUInt32 uHeight )
inline

Sets final raster image dimensions.

Parameters
uWidth[in] Raster image width.
uHeight[in] Raster image height.

Definition at line 87 of file GiCubeMap.h.

◆ setSourceFileName()

void OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::setTransparencyMode ( TransparencyMode mode)
virtual

Sets an image transparency mode.

Parameters
mode[in] New transparency mode value.

Reimplemented from OdGiRasterImageParam.

◆ sourceFileName()

const OdString & OdGiPatchworkRasterImage::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 OdGiPatchworkRasterImage::supportedParams ( ) const
virtual

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

Returns
bitflags that represent supported parameters.

Implements OdGiRasterImageParam.

◆ transparencyMode()

TransparencyMode OdGiPatchworkRasterImage::transparencyMode ( ) const
virtual

Retrieves the transparency mode for 32bpp formats.

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

Reimplemented from OdGiRasterImage.

◆ transparentColor()

int OdGiPatchworkRasterImage::transparentColor ( ) const
virtual

Retrieves the index of transparent color in the image.

Returns
transparent color.
Remarks
If there is no transparent color, -1 should be returned.

Reimplemented from OdGiRasterImage.


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