CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiRasterWrappers.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __OD_GI_RASTER_WRAPPERS__
25#define __OD_GI_RASTER_WRAPPERS__
26
27#include "Gi/GiExport.h"
28#include "Gi/GiRasterImage.h"
29#include "Gi/GiImage.h"
30#include "UInt8Array.h"
31
32#include "TD_PackPush.h"
33
46{
47 OdUInt32 m_pixelWidth, m_pixelHeight, m_colorDepth, m_palSize, m_alignment;
49 Units m_units;
50 double m_xPelsPerUnit, m_yPelsPerUnit;
51 OdUInt8* m_pPal;
52 OdGiRasterImage::ImageSource m_imageSource;
53 OdGiRasterImage::TransparencyMode m_transparencyMode;
54 OdString m_fileName;
55public:
74
79
91 static OdGiRasterImagePtr createObject(OdUInt32 pixelWidth, OdUInt32 pixelHeight, Units units = kNone, double xPelsPerUnit = 0.0, double yPelsPerUnit = 0.0);
92
104 static OdGiRasterImagePtr createObject(OdUInt32 pixelWidth, OdUInt32 pixelHeight, OdUInt32 colorDepth, Units units = kNone, double xPelsPerUnit = 0.0, double yPelsPerUnit = 0.0);
105
114
119 void setFrom(const OdGiRasterImage *pSourceImage);
131 void copyFrom(const OdRxObject *pSource);
162 ODCOLORREF color(OdUInt32 colorIndex) const;
176 void paletteData(OdUInt8* bytes) const;
191 const OdUInt8* scanLines() const;
212 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
240 Units defaultResolution(double& xPelsPerUnit, double& yPelsPerUnit) const;
241
246 void setPixelWidth(OdUInt32 pixelWidth);
251 void setPixelHeight(OdUInt32 pixelHeight);
252
257 void setColorDepth(OdUInt32 colorDepth);
267
273 void setPalette(OdUInt32 paletteSize, OdUInt8* paletteData);
274
282
289 void setDefaultResolution(Units units, double xPelsPerUnit, double yPelsPerUnit);
312 const OdString &sourceFileName() const;
317 void setSourceFileName(const OdString &fileName);
329};
330
331class OdGiImageBGRA32;
332
344{
345protected:
348public:
358
363
402 ODCOLORREF color(OdUInt32 colorIndex) const;
416 void paletteData(OdUInt8* bytes) const;
440 const OdUInt8* scanLines() const;
458 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
488 OdGiRasterImage::Units defaultResolution(double& xPelsPerUnit, double& yPelsPerUnit) const;
523 void copyFrom(const OdRxObject *pSource);
524};
525
534{
535protected:
537public:
542
547
567 void copyFrom(const OdRxObject *pSource);
568};
569
578{
579private:
580 OdGiPixelBGRA32Array m_pxArray;
581public:
586
591
609 void copyFrom(const OdRxObject *pSource);
610};
611
620{
621 OdUInt32 m_pixelWidth, m_pixelHeight, m_colorDepth, m_alignment;
623 Units m_units;
624 double m_xPelsPerUnit, m_yPelsPerUnit;
625 OdGiRasterImage::ImageSource m_imageSource;
626 OdString m_fileName;
627 OdGiRasterImage::TransparencyMode m_transparencyMode;
628 int m_transparentColor;
629 OdUInt8Array m_palData;
630 OdUInt8Array m_pixData;
631public:
648
653
658 void setFrom(const OdGiRasterImage* pOrig);
659
689 Units defaultResolution(double& xPelsPerUnit, double& yPelsPerUnit) const;
708 ODCOLORREF color(OdUInt32 colorIndex) const;
722 void paletteData(OdUInt8* bytes) const;
749 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
763 const OdUInt8* scanLines() const;
788 int transparentColor() const;
800 const OdString &sourceFileName() const;
822 void setSourceFileName(const OdString &fileName);
839 void copyFrom(const OdRxObject *pSource);
840};
841
856{
857 OdGiRasterImagePtr m_pOrig;
858public:
867
872 void setOriginal(const OdGiRasterImage* pOrig);
878 const OdGiRasterImage *original() const;
906 Units defaultResolution(double& xPelsPerUnit, double& yPelsPerUnit) const;
925 ODCOLORREF color(OdUInt32 colorIndex) const;
939 void paletteData(OdUInt8* bytes) const;
966 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
980 const OdUInt8* scanLines() const;
1005 int transparentColor() const;
1017 const OdString &sourceFileName() const;
1039 void setSourceFileName(const OdString &fileName);
1050 void* imp() const;
1062 void copyFrom(const OdRxObject *pSource);
1063};
1064
1077{
1078 RGBQUAD m_palette[2];
1079 int m_transpColor;
1080public:
1089
1099 static OdGiRasterImagePtr createObject(const OdGiRasterImage* pOrig, ODCOLORREF foregroundColor, ODCOLORREF backgroundColor, bool transparent);
1100
1108 void setOriginal(const OdGiRasterImage* pOrig, ODCOLORREF foregroundColor, ODCOLORREF backgroundColor, bool transparent);
1109
1123 ODCOLORREF color(OdUInt32 colorIndex) const;
1137 void paletteData(OdUInt8* bytes) const;
1152 int transparentColor() const;
1164 void copyFrom(const OdRxObject *pSource);
1165};
1166
1179{
1180public:
1185
1190
1213 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
1227 const OdUInt8* scanLines() const;
1239 void copyFrom(const OdRxObject *pSource);
1240};
1241
1254{
1255public:
1260
1265
1290 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
1303 const OdUInt8* scanLines() const;
1315 void copyFrom(const OdRxObject *pSource);
1316};
1317
1330{
1331public:
1340
1355 ODCOLORREF color(OdUInt32 colorIndex) const;
1363 void paletteData(OdUInt8* bytes) const;
1364
1382 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
1395 const OdUInt8* scanLines() const;
1407 void copyFrom(const OdRxObject *pSource);
1408protected:
1409 virtual ODCOLORREF colorXform(ODCOLORREF color) const;
1410};
1411
1424{
1425public:
1430
1435
1454 void copyFrom(const OdRxObject *pSource);
1455protected:
1456 virtual ODCOLORREF colorXform(ODCOLORREF color) const;
1457};
1458
1471{
1472public:
1477
1482
1488 static OdGiRasterImagePtr createObject(const OdGiRasterImage* pOrig, const ODCOLORREF& clrTint );
1500 void copyFrom(const OdRxObject *pSource);
1501protected:
1502 virtual ODCOLORREF colorXform(ODCOLORREF color) const;
1503protected:
1507};
1508
1521{
1522 int m_threshold;
1523public:
1532
1540 static OdGiRasterImagePtr createObject(const OdGiRasterImage* pOrig, int threshold = 127);
1552 void copyFrom(const OdRxObject *pSource);
1558 void setThreshold(OdUInt8 treshold) { m_threshold = treshold; if (m_threshold > 254) m_threshold = 254; };
1564 int threshold() const { return m_threshold; }
1565protected:
1566 virtual ODCOLORREF colorXform(ODCOLORREF color) const;
1567};
1568
1580{
1581protected:
1585public:
1586
1597
1602
1611 static OdGiRasterImagePtr createObject( const OdGiRasterImage* pOrig, ODCOLORREF cutColor, OdUInt8 threshold = 0 );
1612
1634 const OdUInt8* scanLines() const;
1652 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
1653
1684 ODCOLORREF color(OdUInt32 colorIndex) const;
1698 void paletteData(OdUInt8* bytes) const;
1725 OdGiRasterImage::Units defaultResolution(double& xPelsPerUnit, double& yPelsPerUnit) const;
1760 void copyFrom(const OdRxObject *pSource);
1761
1762protected:
1764};
1765//DOM-IGNORE-BEGIN
1766#if 0 // @@@TODO: implement at least nearest, bilinear and bicubic resamplers
1767
1779class ODGI_EXPORT OdGiNearestRasterResampler : public OdGiRasterImageWrapper
1780{
1781 OdUInt32 m_newPixWidth, m_newPixHeight;
1782public:
1783 OdGiNearestRasterResampler();
1784 virtual ~OdGiNearestRasterResampler();
1785
1792 static OdGiRasterImagePtr createObject(const OdGiRasterImage* pOrig, OdUInt32 newPixWidth, OdUInt32 newPixHeight);
1810 void scanLines(OdUInt8* scnLines, OdUInt32 firstScanline, OdUInt32 numLines = 1) const;
1811
1823 const OdUInt8* scanLines() const;
1827 OdRxObjectPtr clone() const;
1833 void copyFrom(const OdRxObject *pSource);
1834};
1835//DOM-IGNORE-END
1836#endif
1837
1838#include "TD_PackPop.h"
1839
1840#endif // __OD_GI_RASTER_WRAPPERS__
#define ODGI_EXPORT
Definition: GiExport.h:35
#define ODCOLORREF
Definition: OdPlatform.h:933
unsigned int OdUInt32
unsigned char OdUInt8
OdUInt32 numColors() const
OdUInt32 paletteDataSize() const
ODCOLORREF color(OdUInt32 colorIndex) const
void setOriginal(const OdGiRasterImage *pOrig, ODCOLORREF foregroundColor, ODCOLORREF backgroundColor, bool transparent)
PixelFormatInfo pixelFormat() const
void copyFrom(const OdRxObject *pSource)
void paletteData(OdUInt8 *bytes) const
OdRxObjectPtr clone() const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig, ODCOLORREF foregroundColor, ODCOLORREF backgroundColor, bool transparent)
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig)
void copyFrom(const OdRxObject *pSource)
OdRxObjectPtr clone() const
virtual ODCOLORREF colorXform(ODCOLORREF color) const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig)
ODCOLORREF color(OdUInt32 colorIndex) const
virtual ODCOLORREF colorXform(ODCOLORREF color) const
OdRxObjectPtr clone() const
void paletteData(OdUInt8 *bytes) const
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
const OdUInt8 * scanLines() const
void copyFrom(const OdRxObject *pSource)
const OdUInt8 * scanLines() const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig)
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
void copyFrom(const OdRxObject *pSource)
OdRxObjectPtr clone() const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig, int threshold=127)
virtual ODCOLORREF colorXform(ODCOLORREF color) const
void copyFrom(const OdRxObject *pSource)
OdGiRasterImage::PixelFormatInfo pixelFormat() const
const OdUInt8 * scanLines() const
OdUInt32 scanLinesAlignment() const
void setTransparencyMode(OdGiRasterImage::TransparencyMode mode)
OdRxObjectPtr clone() const
void paletteData(OdUInt8 *bytes) const
OdGiRasterImage::ImageSource imageSource() const
void copyFrom(const OdRxObject *pSource)
OdGiRasterImage::Units defaultResolution(double &xPelsPerUnit, double &yPelsPerUnit) const
const OdGiRasterImage * m_pOrigImage
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
OdGiRasterImage::TransparencyMode transparencyMode() const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig, ODCOLORREF cutColor, OdUInt8 threshold=0)
OdUInt8 getAlphaValue(OdUInt8 red, OdUInt8 green, OdUInt8 blue) const
ODCOLORREF color(OdUInt32 colorIndex) const
void copyFrom(const OdRxObject *pSource)
static OdGiRasterImagePtr createObject(OdGiImageBGRA32 *pImage, OdGiRasterImage::TransparencyMode transparencyMode=OdGiRasterImage::kTransparency8Bit)
OdRxObjectPtr clone() const
void copyFrom(const OdRxObject *pSource)
static OdGiRasterImagePtr createObject(OdGiImageBGRA32 *pImage, OdGiRasterImage::TransparencyMode transparencyMode=OdGiRasterImage::kTransparency8Bit)
OdRxObjectPtr clone() const
OdGiRasterImage::Units defaultResolution(double &xPelsPerUnit, double &yPelsPerUnit) const
OdGiRasterImage::TransparencyMode transparencyMode() const
void setTransparencyMode(OdGiRasterImage::TransparencyMode mode)
OdUInt32 numColors() const
OdUInt32 pixelHeight() const
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
OdGiRasterImage::TransparencyMode m_transparencyMode
OdUInt32 pixelWidth() const
OdUInt32 scanLinesAlignment() const
ODCOLORREF color(OdUInt32 colorIndex) const
OdUInt32 scanLineSize() const
void paletteData(OdUInt8 *bytes) const
OdUInt32 paletteDataSize() const
OdRxObjectPtr clone() const
static OdGiRasterImagePtr createObject(OdGiImageBGRA32 *pImage, OdGiRasterImage::TransparencyMode transparencyMode=OdGiRasterImage::kTransparency8Bit)
virtual ~OdGiRasterImageBGRA32()
OdUInt32 supportedParams() const
OdGiRasterImage::PixelFormatInfo pixelFormat() const
const OdUInt8 * scanLines() const
OdUInt32 colorDepth() const
void copyFrom(const OdRxObject *pSource)
OdGiImageBGRA32 * m_pBGRAImage
OdGiRasterImage::ImageSource imageSource() const
OdUInt32 supportedParams() const
const OdString & sourceFileName() const
ODCOLORREF color(OdUInt32 colorIndex) const
OdGiRasterImage::PixelFormatInfo & pixelFormat()
const OdUInt8 * scanLines() const
OdUInt32 scanLinesAlignment() const
void setSourceFileName(const OdString &fileName)
static OdGiRasterImagePtr createObject(OdUInt32 pixelWidth, OdUInt32 pixelHeight, Units units=kNone, double xPelsPerUnit=0.0, double yPelsPerUnit=0.0)
virtual ~OdGiRasterImageDesc()
void setPixelWidth(OdUInt32 pixelWidth)
OdUInt32 numColors() const
void setDefaultResolution(Units units, double xPelsPerUnit, double yPelsPerUnit)
OdRxObjectPtr clone() const
OdGiRasterImage::TransparencyMode transparencyMode() const
OdGiRasterImage::ImageSource imageSource() const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pSourceImage)
void setFrom(const OdGiRasterImage *pSourceImage)
Units defaultResolution(double &xPelsPerUnit, double &yPelsPerUnit) const
void setImageSource(OdGiRasterImage::ImageSource source)
void setScanLinesAlignment(OdUInt32 alignment)
OdUInt32 pixelHeight() const
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
OdUInt32 scanLineSize() const
PixelFormatInfo pixelFormat() const
void setTransparencyMode(OdGiRasterImage::TransparencyMode mode)
static OdGiRasterImagePtr createObject(OdUInt32 pixelWidth, OdUInt32 pixelHeight, OdUInt32 colorDepth, Units units=kNone, double xPelsPerUnit=0.0, double yPelsPerUnit=0.0)
void paletteData(OdUInt8 *bytes) const
void setPixelHeight(OdUInt32 pixelHeight)
void setPalette(OdUInt32 paletteSize, OdUInt8 *paletteData)
void copyFrom(const OdRxObject *pSource)
OdUInt32 paletteDataSize() const
OdUInt32 colorDepth() const
void setColorDepth(OdUInt32 colorDepth)
OdUInt32 pixelWidth() const
OdUInt32 supportedParams() const
ImageSource imageSource() const
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
OdUInt32 colorDepth() const
const OdString & sourceFileName() const
TransparencyMode transparencyMode() const
void setTransparencyMode(TransparencyMode mode)
const OdUInt8 * scanLines() const
PixelFormatInfo pixelFormat() const
int transparentColor() const
ODCOLORREF color(OdUInt32 colorIndex) const
virtual ~OdGiRasterImageHolder()
OdUInt32 paletteDataSize() const
OdUInt32 pixelHeight() const
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pImage)
void setImageSource(ImageSource source)
Units defaultResolution(double &xPelsPerUnit, double &yPelsPerUnit) const
OdRxObjectPtr clone() const
OdUInt32 scanLinesAlignment() const
void setSourceFileName(const OdString &fileName)
void setFrom(const OdGiRasterImage *pOrig)
void paletteData(OdUInt8 *bytes) const
OdUInt32 pixelWidth() const
OdUInt32 numColors() const
OdUInt32 scanLineSize() const
void copyFrom(const OdRxObject *pSource)
virtual const OdUInt8 * scanLines() const =0
OdUInt32 paletteDataSize() const
void setSourceFileName(const OdString &fileName)
Units defaultResolution(double &xPelsPerUnit, double &yPelsPerUnit) const
virtual ~OdGiRasterImageWrapper()
void setOriginal(const OdGiRasterImage *pOrig)
OdUInt32 colorDepth() const
OdUInt32 scanLineSize() const
OdRxObjectPtr clone() const
PixelFormatInfo pixelFormat() const
void setTransparencyMode(TransparencyMode mode)
OdUInt32 numColors() const
const OdUInt8 * scanLines() const
const OdGiRasterImage * original() const
OdUInt32 scanLinesAlignment() const
const OdString & sourceFileName() const
OdUInt32 pixelHeight() const
TransparencyMode transparencyMode() const
void paletteData(OdUInt8 *bytes) const
void copyFrom(const OdRxObject *pSource)
void * imp() const
OdGiRasterImagePtr cloneOriginal() const
ODCOLORREF color(OdUInt32 colorIndex) const
OdUInt32 supportedParams() const
void setImageSource(ImageSource source)
OdUInt32 pixelWidth() const
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
int transparentColor() const
ImageSource imageSource() const
virtual ODCOLORREF colorXform(ODCOLORREF color) const
void copyFrom(const OdRxObject *pSource)
OdRxObjectPtr clone() const
virtual ~OdGiTintRasterTransformer()
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig, const ODCOLORREF &clrTint)
static OdGiRasterImagePtr createObject(const OdGiRasterImage *pOrig)
void copyFrom(const OdRxObject *pSource)
const OdUInt8 * scanLines() const
void scanLines(OdUInt8 *scnLines, OdUInt32 firstScanline, OdUInt32 numLines=1) const
OdRxObjectPtr clone() const
virtual void copyFrom(const OdRxObject *pSource)
virtual OdRxObjectPtr clone() const
GLsizei GLsizei GLchar * source
Definition: gles2_ext.h:282
GLfloat GLfloat blue
Definition: gles2_ext.h:147
GLfloat green
Definition: gles2_ext.h:147