mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028316: Coding Rules - Elimilate confusing aliases of Standard_Real type in V3d_View
Quantity_Factor, Quantity_Parameter, Quantity_Ratio, Quantity_Coefficient, Quantity_PlaneAngle, Quantity_Length, V3d_Parameter and V3d_Coordinate have been replaced by Standard_Real in visualization classes.
This commit is contained in:
@@ -350,7 +350,7 @@ bool Image_AlienPixMap::savePPM (const TCollection_AsciiString& theFileName) con
|
||||
|
||||
// Write pixel data
|
||||
Quantity_Color aColor;
|
||||
Quantity_Parameter aDummy;
|
||||
Standard_Real aDummy;
|
||||
Standard_Byte aByte;
|
||||
for (Standard_Size aRow = 0; aRow < SizeY(); ++aRow)
|
||||
{
|
||||
|
@@ -193,7 +193,7 @@ void Image_PixMap::Clear()
|
||||
// =======================================================================
|
||||
Quantity_Color Image_PixMap::PixelColor (const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
Quantity_Parameter& theAlpha) const
|
||||
Standard_Real& theAlpha) const
|
||||
{
|
||||
if (IsEmpty()
|
||||
|| theX < 0 || (Standard_Size )theX >= SizeX()
|
||||
@@ -209,10 +209,7 @@ Quantity_Color Image_PixMap::PixelColor (const Standard_Integer theX,
|
||||
{
|
||||
const Standard_ShortReal& aPixel = Value<Standard_ShortReal> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel)),
|
||||
Quantity_Parameter (Standard_Real (aPixel)),
|
||||
Quantity_Parameter (Standard_Real (aPixel)),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (aPixel, aPixel, aPixel, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_AlphaF:
|
||||
{
|
||||
@@ -224,100 +221,67 @@ Quantity_Color Image_PixMap::PixelColor (const Standard_Integer theX,
|
||||
{
|
||||
const Image_ColorRGBAF& aPixel = Value<Image_ColorRGBAF> (theY, theX);
|
||||
theAlpha = aPixel.a();
|
||||
return Quantity_Color (Quantity_Parameter (aPixel.r()),
|
||||
Quantity_Parameter (aPixel.g()),
|
||||
Quantity_Parameter (aPixel.b()),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (aPixel.r(), aPixel.g(), aPixel.b(), Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_BGRAF:
|
||||
{
|
||||
const Image_ColorBGRAF& aPixel = Value<Image_ColorBGRAF> (theY, theX);
|
||||
theAlpha = aPixel.a();
|
||||
return Quantity_Color (Quantity_Parameter (aPixel.r()),
|
||||
Quantity_Parameter (aPixel.g()),
|
||||
Quantity_Parameter (aPixel.b()),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (aPixel.r(), aPixel.g(), aPixel.b(), Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_RGBF:
|
||||
{
|
||||
const Image_ColorRGBF& aPixel = Value<Image_ColorRGBF> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (aPixel.r()),
|
||||
Quantity_Parameter (aPixel.g()),
|
||||
Quantity_Parameter (aPixel.b()),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (aPixel.r(), aPixel.g(), aPixel.b(), Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_BGRF:
|
||||
{
|
||||
const Image_ColorBGRF& aPixel = Value<Image_ColorBGRF> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (aPixel.r()),
|
||||
Quantity_Parameter (aPixel.g()),
|
||||
Quantity_Parameter (aPixel.b()),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (aPixel.r(), aPixel.g(), aPixel.b(), Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_RGBA:
|
||||
{
|
||||
const Image_ColorRGBA& aPixel = Value<Image_ColorRGBA> (theY, theX);
|
||||
theAlpha = Standard_Real (aPixel.a()) / 255.0;
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel.r()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.g()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel.r()) / 255.0, Standard_Real (aPixel.g()) / 255.0, Standard_Real (aPixel.b()) / 255.0, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_BGRA:
|
||||
{
|
||||
const Image_ColorBGRA& aPixel = Value<Image_ColorBGRA> (theY, theX);
|
||||
theAlpha = Standard_Real (aPixel.a()) / 255.0;
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel.r()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.g()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel.r()) / 255.0, Standard_Real (aPixel.g()) / 255.0, Standard_Real (aPixel.b() / 255.0), Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_RGB32:
|
||||
{
|
||||
const Image_ColorRGB32& aPixel = Value<Image_ColorRGB32> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel.r()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.g()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel.r()) / 255.0, Standard_Real (aPixel.g()) / 255.0, Standard_Real (aPixel.b()) / 255.0, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_BGR32:
|
||||
{
|
||||
const Image_ColorBGR32& aPixel = Value<Image_ColorBGR32> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel.r()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.g()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel.r()) / 255.0, Standard_Real (aPixel.g()) / 255.0, Standard_Real (aPixel.b()) / 255.0, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_RGB:
|
||||
{
|
||||
const Image_ColorRGB& aPixel = Value<Image_ColorRGB> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel.r()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.g()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel.r()) / 255.0, Standard_Real (aPixel.g()) / 255.0, Standard_Real (aPixel.b()) / 255.0, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_BGR:
|
||||
{
|
||||
const Image_ColorBGR& aPixel = Value<Image_ColorBGR> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel.r()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.g()) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel.r()) / 255.0, Standard_Real (aPixel.g()) / 255.0, Standard_Real (aPixel.b()) / 255.0, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_Gray:
|
||||
{
|
||||
const Standard_Byte& aPixel = Value<Standard_Byte> (theY, theX);
|
||||
theAlpha = 1.0; // opaque
|
||||
return Quantity_Color (Quantity_Parameter (Standard_Real (aPixel) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel) / 255.0),
|
||||
Quantity_Parameter (Standard_Real (aPixel) / 255.0),
|
||||
Quantity_TOC_RGB);
|
||||
return Quantity_Color (Standard_Real (aPixel) / 255.0, Standard_Real (aPixel) / 255.0, Standard_Real (aPixel) / 255.0, Quantity_TOC_RGB);
|
||||
}
|
||||
case Image_Format_Alpha:
|
||||
{
|
||||
|
@@ -105,7 +105,7 @@ public: // high-level API
|
||||
inline Quantity_Color PixelColor (const Standard_Integer theX,
|
||||
const Standard_Integer theY) const
|
||||
{
|
||||
Quantity_Parameter aDummy;
|
||||
Standard_Real aDummy;
|
||||
return PixelColor (theX, theY, aDummy);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public: // high-level API
|
||||
//! Beware that this method takes coordinates in opposite order in contrast to ::Value() and ::ChangeValue().
|
||||
Standard_EXPORT Quantity_Color PixelColor (const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
Quantity_Parameter& theAlpha) const;
|
||||
Standard_Real& theAlpha) const;
|
||||
|
||||
//! Sets the pixel color. This function is relatively slow.
|
||||
//! Beware that this method takes coordinates in opposite order in contrast to ::Value() and ::ChangeValue().
|
||||
|
Reference in New Issue
Block a user