MCPcopy Create free account
hub / github.com/davisking/dlib / assign_image

Function assign_image

dlib/python/numpy_image.h:248–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246
247 template <typename pixel_type>
248 void assign_image (
249 numpy_image<pixel_type>& dest,
250 const py::array& src
251 )
252 {
253 if (is_image<pixel_type>(src)) dest = src;
254 else if (is_image<uint8_t>(src)) assign_image(dest, numpy_image<uint8_t>(src));
255 else if (is_image<uint16_t>(src)) assign_image(dest, numpy_image<uint16_t>(src));
256 else if (is_image<uint32_t>(src)) assign_image(dest, numpy_image<uint32_t>(src));
257 else if (is_image<uint64_t>(src)) assign_image(dest, numpy_image<uint64_t>(src));
258 else if (is_image<int8_t>(src)) assign_image(dest, numpy_image<int8_t>(src));
259 else if (is_image<int16_t>(src)) assign_image(dest, numpy_image<int16_t>(src));
260 else if (is_image<int32_t>(src)) assign_image(dest, numpy_image<int32_t>(src));
261 else if (is_image<int64_t>(src)) assign_image(dest, numpy_image<int64_t>(src));
262 else if (is_image<float>(src)) assign_image(dest, numpy_image<float>(src));
263 else if (is_image<double>(src)) assign_image(dest, numpy_image<double>(src));
264 else if (is_image<rgb_pixel>(src)) assign_image(dest, numpy_image<rgb_pixel>(src));
265 else if (is_image<rgb_alpha_pixel>(src)) assign_image(dest, numpy_image<rgb_alpha_pixel>(src));
266 else DLIB_CASSERT(false, "Unsupported pixel type used in assign_image().");
267 }
268
269// ----------------------------------------------------------------------------------------
270// ----------------------------------------------------------------------------------------

Callers 15

py_tile_imagesFunction · 0.50
detectMethod · 0.50
detect_multMethod · 0.50
py_randomly_color_imageFunction · 0.50
py_jetFunction · 0.50
convert_imageFunction · 0.50
as_grayscaleFunction · 0.50
run_test1Function · 0.50

Calls

no outgoing calls

Tested by 11

run_test1Function · 0.40
run_test2Function · 0.40
image_testFunction · 0.40
test_dng_float_intFunction · 0.40
test_letterbox_imageFunction · 0.40
test_webpFunction · 0.40
perform_testMethod · 0.40
test_pyramid_down_rgb2Function · 0.40