1 // Created on: 2010-07-18
2 // Created by: Kirill GAVRILOV
3 // Copyright (c) 2010-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <Image_PixMap.hxx>
17 #include <NCollection_AlignedAllocator.hxx>
18 #include <Standard_ProgramError.hxx>
22 IMPLEMENT_STANDARD_RTTIEXT(Image_PixMap,Standard_Transient)
24 // =======================================================================
25 // function : Image_PixMap
27 // =======================================================================
28 Image_PixMap::Image_PixMap()
29 : myImgFormat (Image_Format_Gray)
34 // =======================================================================
35 // function : ~Image_PixMap
37 // =======================================================================
38 Image_PixMap::~Image_PixMap()
43 Standard_Size Image_PixMap::SizePixelBytes (const Image_Format thePixelFormat)
45 switch (thePixelFormat)
47 case Image_Format_GrayF:
48 case Image_Format_AlphaF:
50 case Image_Format_RGF:
51 return sizeof(float) * 2;
52 case Image_Format_RGBAF:
53 case Image_Format_BGRAF:
54 return sizeof(float) * 4;
55 case Image_Format_RGBF:
56 case Image_Format_BGRF:
57 return sizeof(float) * 3;
58 case Image_Format_RGBA:
59 case Image_Format_BGRA:
61 case Image_Format_RGB32:
62 case Image_Format_BGR32:
64 case Image_Format_RGB:
65 case Image_Format_BGR:
67 case Image_Format_Gray:
68 case Image_Format_Alpha:
70 case Image_Format_UNKNOWN:
76 // =======================================================================
77 // function : SetFormat
79 // =======================================================================
80 void Image_PixMap::SetFormat (Image_Format thePixelFormat)
82 if (myImgFormat == thePixelFormat)
88 && SizePixelBytes (myImgFormat) != SizePixelBytes (thePixelFormat))
90 throw Standard_ProgramError("Image_PixMap::SetFormat() - incompatible pixel format");
94 myImgFormat = thePixelFormat;
97 // =======================================================================
98 // function : InitWrapper
100 // =======================================================================
101 bool Image_PixMap::InitWrapper (Image_Format thePixelFormat,
102 Standard_Byte* theDataPtr,
103 const Standard_Size theSizeX,
104 const Standard_Size theSizeY,
105 const Standard_Size theSizeRowBytes)
108 myImgFormat = thePixelFormat;
109 if ((theSizeX == 0) || (theSizeY == 0) || (theDataPtr == NULL))
114 Handle(NCollection_BaseAllocator) anEmptyAlloc;
115 myData.Init (anEmptyAlloc, Image_PixMap::SizePixelBytes (thePixelFormat),
116 theSizeX, theSizeY, theSizeRowBytes, theDataPtr);
120 // =======================================================================
121 // function : InitTrash
123 // =======================================================================
124 bool Image_PixMap::InitTrash (Image_Format thePixelFormat,
125 const Standard_Size theSizeX,
126 const Standard_Size theSizeY,
127 const Standard_Size theSizeRowBytes)
130 myImgFormat = thePixelFormat;
131 if ((theSizeX == 0) || (theSizeY == 0))
136 // use argument only if it greater
137 const Standard_Size aSizeRowBytes = std::max (theSizeRowBytes, theSizeX * SizePixelBytes (thePixelFormat));
138 Handle(NCollection_BaseAllocator) anAlloc = new NCollection_AlignedAllocator (16);
139 myData.Init (anAlloc, Image_PixMap::SizePixelBytes (thePixelFormat),
140 theSizeX, theSizeY, aSizeRowBytes, NULL);
141 return !myData.IsEmpty();
144 // =======================================================================
145 // function : InitZero
147 // =======================================================================
148 bool Image_PixMap::InitZero (Image_Format thePixelFormat,
149 const Standard_Size theSizeX,
150 const Standard_Size theSizeY,
151 const Standard_Size theSizeRowBytes,
152 const Standard_Byte theValue)
154 if (!InitTrash (thePixelFormat, theSizeX, theSizeY, theSizeRowBytes))
158 memset (myData.ChangeData(), (int )theValue, SizeBytes());
162 // =======================================================================
163 // function : InitCopy
165 // =======================================================================
166 bool Image_PixMap::InitCopy (const Image_PixMap& theCopy)
168 if (&theCopy == this)
170 // self-copying disallowed
173 if (InitTrash (theCopy.myImgFormat, theCopy.SizeX(), theCopy.SizeY(), theCopy.SizeRowBytes()))
175 memcpy (myData.ChangeData(), theCopy.myData.Data(), theCopy.SizeBytes());
181 // =======================================================================
184 // =======================================================================
185 void Image_PixMap::Clear()
187 Handle(NCollection_BaseAllocator) anEmptyAlloc;
188 myData.Init (anEmptyAlloc, Image_PixMap::SizePixelBytes (myImgFormat),
192 // =======================================================================
193 // function : PixelColor
195 // =======================================================================
196 Quantity_ColorRGBA Image_PixMap::PixelColor (const Standard_Integer theX,
197 const Standard_Integer theY,
198 const Standard_Boolean theToLinearize) const
201 || theX < 0 || (Standard_Size )theX >= SizeX()
202 || theY < 0 || (Standard_Size )theY >= SizeY())
204 return Quantity_ColorRGBA (0.0f, 0.0f, 0.0f, 0.0f); // transparent
209 case Image_Format_GrayF:
211 const Standard_ShortReal& aPixel = Value<Standard_ShortReal> (theY, theX);
212 return Quantity_ColorRGBA (NCollection_Vec4<float> (aPixel, aPixel, aPixel, 1.0f)); // opaque
214 case Image_Format_AlphaF:
216 const Standard_ShortReal& aPixel = Value<Standard_ShortReal> (theY, theX);
217 return Quantity_ColorRGBA (NCollection_Vec4<float> (1.0f, 1.0f, 1.0f, aPixel));
219 case Image_Format_RGF:
221 const Image_ColorRGF& aPixel = Value<Image_ColorRGF> (theY, theX);
222 return Quantity_ColorRGBA (NCollection_Vec4<float> (aPixel.r(), aPixel.g(), 0.0f, 1.0f));
224 case Image_Format_RGBAF:
226 const Image_ColorRGBAF& aPixel = Value<Image_ColorRGBAF> (theY, theX);
227 return Quantity_ColorRGBA (NCollection_Vec4<float> (aPixel.r(), aPixel.g(), aPixel.b(), aPixel.a()));
229 case Image_Format_BGRAF:
231 const Image_ColorBGRAF& aPixel = Value<Image_ColorBGRAF> (theY, theX);
232 return Quantity_ColorRGBA (NCollection_Vec4<float> (aPixel.r(), aPixel.g(), aPixel.b(), aPixel.a()));
234 case Image_Format_RGBF:
236 const Image_ColorRGBF& aPixel = Value<Image_ColorRGBF> (theY, theX);
237 return Quantity_ColorRGBA (NCollection_Vec4<float> (aPixel.r(), aPixel.g(), aPixel.b(), 1.0f)); // opaque
239 case Image_Format_BGRF:
241 const Image_ColorBGRF& aPixel = Value<Image_ColorBGRF> (theY, theX);
242 return Quantity_ColorRGBA (NCollection_Vec4<float> (aPixel.r(), aPixel.g(), aPixel.b(), 1.0f)); // opaque
244 case Image_Format_RGBA:
246 const Image_ColorRGBA& aPixel = Value<Image_ColorRGBA> (theY, theX);
247 return theToLinearize
248 ? Quantity_ColorRGBA (Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.r()) / 255.0f),
249 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.g()) / 255.0f),
250 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.b()) / 255.0f),
251 float(aPixel.a()) / 255.0f)
252 : Quantity_ColorRGBA (float(aPixel.r()) / 255.0f, float(aPixel.g()) / 255.0f, float(aPixel.b()) / 255.0f, float(aPixel.a()) / 255.0f);
254 case Image_Format_BGRA:
256 const Image_ColorBGRA& aPixel = Value<Image_ColorBGRA> (theY, theX);
257 return theToLinearize
258 ? Quantity_ColorRGBA (Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.r()) / 255.0f),
259 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.g()) / 255.0f),
260 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.b()) / 255.0f),
261 float(aPixel.a()) / 255.0f)
262 : Quantity_ColorRGBA (float(aPixel.r()) / 255.0f, float(aPixel.g()) / 255.0f, float(aPixel.b()) / 255.0f, float(aPixel.a()) / 255.0f);
264 case Image_Format_RGB32:
266 const Image_ColorRGB32& aPixel = Value<Image_ColorRGB32> (theY, theX);
267 return theToLinearize
268 ? Quantity_ColorRGBA (Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.r()) / 255.0f),
269 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.g()) / 255.0f),
270 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.b()) / 255.0f), 1.0f)
271 : Quantity_ColorRGBA (float(aPixel.r()) / 255.0f, float(aPixel.g()) / 255.0f, float(aPixel.b()) / 255.0f, 1.0f);
273 case Image_Format_BGR32:
275 const Image_ColorBGR32& aPixel = Value<Image_ColorBGR32> (theY, theX);
276 return theToLinearize
277 ? Quantity_ColorRGBA (Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.r()) / 255.0f),
278 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.g()) / 255.0f),
279 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.b()) / 255.0f), 1.0f)
280 : Quantity_ColorRGBA (float(aPixel.r()) / 255.0f, float(aPixel.g()) / 255.0f, float(aPixel.b()) / 255.0f, 1.0f);
282 case Image_Format_RGB:
284 const Image_ColorRGB& aPixel = Value<Image_ColorRGB> (theY, theX);
285 return theToLinearize
286 ? Quantity_ColorRGBA (Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.r()) / 255.0f),
287 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.g()) / 255.0f),
288 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.b()) / 255.0f), 1.0f)
289 : Quantity_ColorRGBA (float(aPixel.r()) / 255.0f, float(aPixel.g()) / 255.0f, float(aPixel.b()) / 255.0f, 1.0f);
291 case Image_Format_BGR:
293 const Image_ColorBGR& aPixel = Value<Image_ColorBGR> (theY, theX);
294 return theToLinearize
295 ? Quantity_ColorRGBA (Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.r()) / 255.0f),
296 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.g()) / 255.0f),
297 Quantity_Color::Convert_sRGB_To_LinearRGB (float(aPixel.b()) / 255.0f), 1.0f)
298 : Quantity_ColorRGBA (float(aPixel.r()) / 255.0f, float(aPixel.g()) / 255.0f, float(aPixel.b()) / 255.0f, 1.0f);
300 case Image_Format_Gray:
302 const Standard_Byte& aPixel = Value<Standard_Byte> (theY, theX);
303 return Quantity_ColorRGBA (float(aPixel) / 255.0f, float(aPixel) / 255.0f, float(aPixel) / 255.0f, 1.0f); // opaque
305 case Image_Format_Alpha:
307 const Standard_Byte& aPixel = Value<Standard_Byte> (theY, theX);
308 return Quantity_ColorRGBA (1.0f, 1.0f, 1.0f, float(aPixel) / 255.0f);
310 case Image_Format_UNKNOWN:
316 // unsupported image type
317 return Quantity_ColorRGBA (0.0f, 0.0f, 0.0f, 0.0f); // transparent
320 // =======================================================================
321 // function : SetPixelColor
323 // =======================================================================
324 void Image_PixMap::SetPixelColor (const Standard_Integer theX,
325 const Standard_Integer theY,
326 const Quantity_ColorRGBA& theColor,
327 const Standard_Boolean theToDeLinearize)
330 || theX < 0 || Standard_Size(theX) >= SizeX()
331 || theY < 0 || Standard_Size(theY) >= SizeY())
336 const NCollection_Vec4<float>& aColor = theColor;
339 case Image_Format_GrayF:
341 ChangeValue<Standard_ShortReal> (theY, theX) = aColor.r();
344 case Image_Format_AlphaF:
346 ChangeValue<Standard_ShortReal> (theY, theX) = aColor.a();
349 case Image_Format_RGF:
351 Image_ColorRGF& aPixel = ChangeValue<Image_ColorRGF> (theY, theX);
352 aPixel.r() = aColor.r();
353 aPixel.g() = aColor.g();
356 case Image_Format_RGBAF:
358 Image_ColorRGBAF& aPixel = ChangeValue<Image_ColorRGBAF> (theY, theX);
359 aPixel.r() = aColor.r();
360 aPixel.g() = aColor.g();
361 aPixel.b() = aColor.b();
362 aPixel.a() = aColor.a();
365 case Image_Format_BGRAF:
367 Image_ColorBGRAF& aPixel = ChangeValue<Image_ColorBGRAF> (theY, theX);
368 aPixel.r() = aColor.r();
369 aPixel.g() = aColor.g();
370 aPixel.b() = aColor.b();
371 aPixel.a() = aColor.a();
374 case Image_Format_RGBF:
376 Image_ColorRGBF& aPixel = ChangeValue<Image_ColorRGBF> (theY, theX);
377 aPixel.r() = aColor.r();
378 aPixel.g() = aColor.g();
379 aPixel.b() = aColor.b();
382 case Image_Format_BGRF:
384 Image_ColorBGRF& aPixel = ChangeValue<Image_ColorBGRF> (theY, theX);
385 aPixel.r() = aColor.r();
386 aPixel.g() = aColor.g();
387 aPixel.b() = aColor.b();
390 case Image_Format_RGBA:
392 Image_ColorRGBA& aPixel = ChangeValue<Image_ColorRGBA> (theY, theX);
393 if (theToDeLinearize)
395 aPixel.r() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.r()) * 255.0f);
396 aPixel.g() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.g()) * 255.0f);
397 aPixel.b() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.b()) * 255.0f);
401 aPixel.r() = Standard_Byte(aColor.r() * 255.0f);
402 aPixel.g() = Standard_Byte(aColor.g() * 255.0f);
403 aPixel.b() = Standard_Byte(aColor.b() * 255.0f);
405 aPixel.a() = Standard_Byte(aColor.a() * 255.0f);
408 case Image_Format_BGRA:
410 Image_ColorBGRA& aPixel = ChangeValue<Image_ColorBGRA> (theY, theX);
411 if (theToDeLinearize)
413 aPixel.r() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.r()) * 255.0f);
414 aPixel.g() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.g()) * 255.0f);
415 aPixel.b() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.b()) * 255.0f);
419 aPixel.r() = Standard_Byte(aColor.r() * 255.0f);
420 aPixel.g() = Standard_Byte(aColor.g() * 255.0f);
421 aPixel.b() = Standard_Byte(aColor.b() * 255.0f);
423 aPixel.a() = Standard_Byte(aColor.a() * 255.0f);
426 case Image_Format_RGB32:
428 Image_ColorRGB32& aPixel = ChangeValue<Image_ColorRGB32> (theY, theX);
429 if (theToDeLinearize)
431 aPixel.r() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.r()) * 255.0f);
432 aPixel.g() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.g()) * 255.0f);
433 aPixel.b() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.b()) * 255.0f);
437 aPixel.r() = Standard_Byte(aColor.r() * 255.0f);
438 aPixel.g() = Standard_Byte(aColor.g() * 255.0f);
439 aPixel.b() = Standard_Byte(aColor.b() * 255.0f);
444 case Image_Format_BGR32:
446 Image_ColorBGR32& aPixel = ChangeValue<Image_ColorBGR32> (theY, theX);
447 if (theToDeLinearize)
449 aPixel.r() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.r()) * 255.0f);
450 aPixel.g() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.g()) * 255.0f);
451 aPixel.b() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.b()) * 255.0f);
455 aPixel.r() = Standard_Byte(aColor.r() * 255.0f);
456 aPixel.g() = Standard_Byte(aColor.g() * 255.0f);
457 aPixel.b() = Standard_Byte(aColor.b() * 255.0f);
462 case Image_Format_RGB:
464 Image_ColorRGB& aPixel = ChangeValue<Image_ColorRGB> (theY, theX);
465 if (theToDeLinearize)
467 aPixel.r() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.r()) * 255.0f);
468 aPixel.g() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.g()) * 255.0f);
469 aPixel.b() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.b()) * 255.0f);
473 aPixel.r() = Standard_Byte(aColor.r() * 255.0f);
474 aPixel.g() = Standard_Byte(aColor.g() * 255.0f);
475 aPixel.b() = Standard_Byte(aColor.b() * 255.0f);
479 case Image_Format_BGR:
481 Image_ColorBGR& aPixel = ChangeValue<Image_ColorBGR> (theY, theX);
482 if (theToDeLinearize)
484 aPixel.r() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.r()) * 255.0f);
485 aPixel.g() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.g()) * 255.0f);
486 aPixel.b() = Standard_Byte(Quantity_Color::Convert_LinearRGB_To_sRGB (aColor.b()) * 255.0f);
490 aPixel.r() = Standard_Byte(aColor.r() * 255.0f);
491 aPixel.g() = Standard_Byte(aColor.g() * 255.0f);
492 aPixel.b() = Standard_Byte(aColor.b() * 255.0f);
496 case Image_Format_Gray:
498 ChangeValue<Standard_Byte> (theY, theX) = Standard_Byte(aColor.r() * 255.0f);
501 case Image_Format_Alpha:
503 ChangeValue<Standard_Byte> (theY, theX) = Standard_Byte(aColor.a() * 255.0f);
506 case Image_Format_UNKNOWN:
513 // =======================================================================
514 // function : SwapRgbaBgra
516 // =======================================================================
517 bool Image_PixMap::SwapRgbaBgra (Image_PixMap& theImage)
519 switch (theImage.Format())
521 case Image_Format_BGR32:
522 case Image_Format_RGB32:
523 case Image_Format_BGRA:
524 case Image_Format_RGBA:
526 const bool toResetAlpha = theImage.Format() == Image_Format_BGR32
527 || theImage.Format() == Image_Format_RGB32;
528 for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
530 for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
532 Image_ColorRGBA& aPixel = theImage.ChangeValue<Image_ColorRGBA> (aRow, aCol);
533 Image_ColorBGRA aPixelCopy = theImage.Value <Image_ColorBGRA> (aRow, aCol);
534 aPixel.r() = aPixelCopy.r();
535 aPixel.g() = aPixelCopy.g();
536 aPixel.b() = aPixelCopy.b();
545 case Image_Format_BGR:
546 case Image_Format_RGB:
548 for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
550 for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
552 Image_ColorRGB& aPixel = theImage.ChangeValue<Image_ColorRGB> (aRow, aCol);
553 Image_ColorBGR aPixelCopy = theImage.Value <Image_ColorBGR> (aRow, aCol);
554 aPixel.r() = aPixelCopy.r();
555 aPixel.g() = aPixelCopy.g();
556 aPixel.b() = aPixelCopy.b();
561 case Image_Format_BGRF:
562 case Image_Format_RGBF:
563 case Image_Format_BGRAF:
564 case Image_Format_RGBAF:
566 for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
568 for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
570 Image_ColorRGBF& aPixel = theImage.ChangeValue<Image_ColorRGBF> (aRow, aCol);
571 Image_ColorBGRF aPixelCopy = theImage.Value <Image_ColorBGRF> (aRow, aCol);
572 aPixel.r() = aPixelCopy.r();
573 aPixel.g() = aPixelCopy.g();
574 aPixel.b() = aPixelCopy.b();
579 default: return false;
583 // =======================================================================
584 // function : ToBlackWhite
586 // =======================================================================
587 void Image_PixMap::ToBlackWhite (Image_PixMap& theImage)
589 switch (theImage.Format())
591 case Image_Format_Gray:
592 case Image_Format_Alpha:
594 for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
596 for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
598 unsigned char& aPixel = theImage.ChangeValue<unsigned char> (aRow, aCol);
607 case Image_Format_RGB:
608 case Image_Format_BGR:
609 case Image_Format_RGB32:
610 case Image_Format_BGR32:
611 case Image_Format_RGBA:
612 case Image_Format_BGRA:
614 const NCollection_Vec3<unsigned char> aWhite24 (255, 255, 255);
615 for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
617 for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
619 NCollection_Vec3<unsigned char>& aPixel = theImage.ChangeValue< NCollection_Vec3<unsigned char> > (aRow, aCol);
632 const Quantity_ColorRGBA aWhiteRgba (1.0f, 1.0f, 1.0f, 1.0f);
633 for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
635 for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
637 const Quantity_ColorRGBA aPixelRgba = theImage.PixelColor (Standard_Integer(aCol), Standard_Integer(aRow));
638 const NCollection_Vec4<float>& aPixel = aPixelRgba;
639 if (aPixel[0] != 0.0f
641 || aPixel[2] != 0.0f)
643 theImage.SetPixelColor (int(aCol), int(aRow), aWhiteRgba);