/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef OD_GS_SR_BASE_CLASSES_H #define OD_GS_SR_BASE_CLASSES_H #include "Gs/GsBaseInclude.h" #include "ExGsHelpers.h" class OdColorConverterCallback; /** * Base device class for software rendering, independent from bitmap devices */ class OdGsSrBaseDevice : public OdGsBaseVectorizeDevice, public OdGiRasterImage { protected: public: OdGsSrBaseDevice() {} virtual ~OdGsSrBaseDevice() {} // OdGiRasterImage interface /** \details Retrieves the image width in pixels of the RasterImage object. \returns Number of pixels as an OdUInt32 value that represents width of the raster image. */ virtual OdUInt32 pixelWidth() const; /** \details Retrieves the image height in pixels of the RasterImage object. \returns Number of pixels as an OdUInt32 value that represents height of the raster image. */ virtual OdUInt32 pixelHeight() const; /** \details Retrieves the number of bits per pixel used for colors by the RasterImage object. \returns Number of bits per pixel that represents color depth. */ virtual OdUInt32 colorDepth() const; /** \details Retrieves the number of colors in the palette of the RasterImage object. \returns Number of colors in the palette. */ virtual OdUInt32 numColors() const; /** \details Retrieves the color for the specified index from the palette of the RasterImage object. \param colorIndex [in] Color index. \returns Color at the specified index as an ODCOLORREF (OdUInt32) value. */ virtual ODCOLORREF color(OdUInt32 colorIndex) const; /** \details Retrieves the size (in bytes) of the palette data of the RasterImage object. \returns Number of bytes that represent palette data size. */ virtual OdUInt32 paletteDataSize() const; /** \details Retrieves the palette in BMP format of the RasterImage object. \param bytes [out] Receives the palette data. \remarks It is up to the caller to allocate sufficient memory for the palette data. */ virtual void paletteData(OdUInt8* pBytes) const; /** \details Retrieves the specified set of scanlines in BMP format from the RasterImage object or the pixel data in BMP format for the RasterImage object. \param scnLines [out] Receives the scanline data. \param firstScanline [in] Index of the first scanline to retrieve. \param 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. \remarks It us up to the caller to allocate sufficient memory for the scanline data. */ OdGiRasterImage::PixelFormatInfo pixelFormat() const; OdGiRasterImage::ImageSource imageSource() const; OdUInt32 scanLinesAlignment() const; OdColorConverterCallback* getColorConverter(); }; /** * Base view class for software rendering, independent from bitmap views */ class OdGsSrBaseView : public OdGsBaseVectorizeViewDef, protected OdGsPropertiesDirectRenderOutput { protected: public: OdGsSrBaseView() {} virtual ~OdGsSrBaseView() {} //void directRenderOutputPoint(const OdGePoint3d& point, const OdCmEntityColor& color); //void directRenderOutputLineFlat(const OdGePoint3d& pt1, const OdGePoint3d& pt2, // const OdCmEntityColor& color); //void directRenderOutputTriangleFlat(const OdGePoint3d& pt1, const OdGePoint3d& pt2, const OdGePoint3d& pt3, // const OdCmEntityColor& color); //void directRenderOutputTriangleGouraud(const OdGePoint3d& pt1, const OdGePoint3d& pt2, const OdGePoint3d& pt3, // const OdCmEntityColor& clr1, const OdCmEntityColor& clr2, const OdCmEntityColor& clr3); //void directRenderOutputPolygoneFlat(OdUInt32 nPts, const OdGePoint3d* pPts, // const OdCmEntityColor& color); //void directRenderOutputPolygoneGouraud(OdUInt32 nPts, const OdGePoint3d* pPts, // const OdCmEntityColor* pClrs); //void directRenderOutputImage(const OdGePoint3d* pRect, const OdGiRasterImage* pImage, // const OdGsPropertiesDirectRenderOutput::DirectRenderImageParams& driParams); OdUInt32 directRenderOutputFlags() const; void setMode(OdGsView::RenderMode mode); }; #endif // OD_GS_SR_BASE_CLASSES_H