• Home
  • Raw
  • Download

Lines Matching +full:test +full:. +full:rgb

2 // Copyright 2023 The ANGLE Project Authors. All rights reserved.
4 // found in the LICENSE file.
6 // LoadToNative_unittest.cpp: Unit tests for pixel loading functions.
8 #include <gmock/gmock.h>
10 #include "common/debug.h"
11 #include "common/mathutil.h"
12 #include "image_util/loadimage.h"
30 ASSERT(rgbInput.size() == inputDepthPitch * depth + inputByteOffset); in initializeRGBInput()
64 ASSERT(rgbInput.size() == inputDepthPitch * depth + inputByteOffset); in verifyRGBToRGBAResults()
65 ASSERT(rgbaOutput.size() == outputDepthPitch * depth + outputByteOffset); in verifyRGBToRGBAResults()
120 // Prepare the RGB input and RGBA output for copy. The offset values are used to add unused in TestLoadUbyteRGBToRGBA()
121 // bytes to the beginning of the input and output data, in order to test address alignments. in TestLoadUbyteRGBToRGBA()
128 // Call loading function. in TestLoadUbyteRGBToRGBA()
130 context, width, height, depth, rgbInput.data() + inputByteOffset, inputRowPitch, in TestLoadUbyteRGBToRGBA()
131 inputDepthPitch, rgbaOutput.data() + outputByteOffset, outputRowPitch, outputDepthPitch); in TestLoadUbyteRGBToRGBA()
133 // Compare the input and output data. in TestLoadUbyteRGBToRGBA()
162 // Prepare the RGB input and RGBA output for copy. The offset values are used to add unused in TestLoadSbyteRGBToRGBA()
163 // bytes to the beginning of the input and output data, in order to test address alignments. in TestLoadSbyteRGBToRGBA()
170 // Call loading function. in TestLoadSbyteRGBToRGBA()
173 reinterpret_cast<uint8_t *>(rgbInput.data() + inputByteOffset), inputRowPitch, in TestLoadSbyteRGBToRGBA()
174 inputDepthPitch, reinterpret_cast<uint8_t *>(rgbaOutput.data() + outputByteOffset), in TestLoadSbyteRGBToRGBA()
177 // Compare the input and output data. in TestLoadSbyteRGBToRGBA()
194 TestLoadUbyteRGBToRGBA<0xFF>(context, strCaseUFF.c_str(), width, height, depth, inputByteOffset, in TestLoadByteRGBToRGBAForAllCases()
197 TestLoadUbyteRGBToRGBA<0x01>(context, strCaseU01.c_str(), width, height, depth, inputByteOffset, in TestLoadByteRGBToRGBAForAllCases()
200 TestLoadSbyteRGBToRGBA<0x7F>(context, strCaseS7F.c_str(), width, height, depth, inputByteOffset, in TestLoadByteRGBToRGBAForAllCases()
203 TestLoadSbyteRGBToRGBA<0x01>(context, strCaseS01.c_str(), width, height, depth, inputByteOffset, in TestLoadByteRGBToRGBAForAllCases()
207 // Tests the ubyte (0xFF) RGB to RGBA loading function for one RGB pixel.
208 TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataOnePixelWithFourthCompOfFF) in TEST() function
222 // Tests the ubyte (0x01) RGB to RGBA loading function for one RGB pixel.
223 TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataOnePixelWithFourthCompOf01) in TEST() function
237 // Tests the sbyte (0x7F) RGB to RGBA loading function for one RGB pixel.
238 TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataOnePixelWithFourthCompOf7F) in TEST() function
253 // Tests the sbyte (0x01) RGB to RGBA loading function for one RGB pixel.
254 TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataOnePixelWithFourthCompOf01) in TEST() function
269 // Tests the ubyte (0xFF) RGB to RGBA loading function for 4 RGB pixels, which should be read
270 // together.
271 TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataFourPixelsWithFourthCompOfFF) in TEST() function
284 LoadToNative3To4<uint8_t, kFourthValue>(context, 4, 1, 1, rgbInput.data(), 3, 3, in TEST()
285 rgbaOutput.data(), 4, 4); in TEST()
297 // Tests the ubyte (0x01) RGB to RGBA loading function for 4 RGB pixels, which should be read
298 // together.
299 TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataFourPixelsWithFourthCompOf01) in TEST() function
312 LoadToNative3To4<uint8_t, kFourthValue>(context, 4, 1, 1, rgbInput.data(), 3, 3, in TEST()
313 rgbaOutput.data(), 4, 4); in TEST()
325 // Tests the sbyte (0x7F) RGB to RGBA loading function for 4 RGB pixels, which should be read
326 // together.
327 TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataFourPixelsWithFourthCompOf7F) in TEST() function
341 reinterpret_cast<uint8_t *>(rgbInput.data()), 3, 3, in TEST()
342 reinterpret_cast<uint8_t *>(rgbaOutput.data()), 4, 4); in TEST()
354 // Tests the sbyte (0x01) RGB to RGBA loading function for 4 RGB pixels, which should be read
355 // together.
356 TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataFourPixelsWithFourthCompOf01) in TEST() function
370 reinterpret_cast<uint8_t *>(rgbInput.data()), 3, 3, in TEST()
371 reinterpret_cast<uint8_t *>(rgbaOutput.data()), 4, 4); in TEST()
383 // Tests the byte RGB to RGBA loading function when the width is 4-byte aligned. This loading
384 // function can copy 4 bytes at a time in a row.
385 TEST(LoadToNative3To4, LoadByteRGBToRGBADataAlignedWidth) in TEST() function
396 // Tests the byte RGB to RGBA loading function when the width is not 4-byte aligned, which will
397 // cause the loading function to copy some bytes in the beginning and end of some rows individually.
398 TEST(LoadToNative3To4, LoadByteRGBToRGBADataUnalignedWidth) in TEST() function
409 // Tests the byte RGB to RGBA loading function when there is depth.
410 TEST(LoadToNative3To4, LoadByteRGBToRGBADataWithDepth) in TEST() function
420 // Tests the byte RGB to RGBA loading function when the width is less than 4 bytes. Therefore the
421 // loading function will copy data one byte at a time.
422 TEST(LoadToNative3To4, LoadByteRGBToRGBADataWidthLessThanUint32) in TEST() function
432 // Tests the byte RGB to RGBA loading function when when the width is 4-byte-aligned and the input
433 // address has an offset.
434 TEST(LoadToNative3To4, LoadByteRGBToRGBAWithAlignedWidthAndInputAddressOffset) in TEST() function
444 // Tests the byte RGB to RGBA loading function when when the width is not 4-byte-aligned and the
445 // input address has an offset.
446 TEST(LoadToNative3To4, LoadByteRGBToRGBAWithUnalignedWidthAndInputAddressOffset) in TEST() function
456 // Tests the byte RGB to RGBA loading function when the width is 4-byte-aligned and the output
457 // address has an offset.
458 TEST(LoadToNative3To4, LoadByteRGBToRGBAWithAlignedWidthAndOutputAddressOffset) in TEST() function
468 // Tests the byte RGB to RGBA loading function when the width is not 4-byte-aligned and the output
469 // address has an offset.
470 TEST(LoadToNative3To4, LoadByteRGBToRGBAWithUnalignedWidthAndOutputAddressOffset) in TEST() function
480 // Tests the byte RGB to RGBA loading function when the width is 4-byte-aligned and the input row
481 // alignment is 4.
482 TEST(LoadToNative3To4, LoadByteRGBToRGBAWithAlignedWidthAndAlignment4) in TEST() function
492 // Tests the byte RGB to RGBA loading function when the width is not 4-byte-aligned and the input
493 // row alignment is 4.
494 TEST(LoadToNative3To4, LoadByteRGBToRGBAWithUnalignedWidthAndAlignment4) in TEST() function