MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / load_image

Function load_image

encoder/basisu_enc.cpp:553–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551 }
552
553 bool load_image(const char* pFilename, image& img)
554 {
555 std::string ext(string_get_extension(std::string(pFilename)));
556
557 if (ext.length() == 0)
558 return false;
559
560 const char *pExt = ext.c_str();
561
562 if (strcasecmp(pExt, "png") == 0)
563 return load_png(pFilename, img);
564 if (strcasecmp(pExt, "tga") == 0)
565 return load_tga(pFilename, img);
566 if (strcasecmp(pExt, "qoi") == 0)
567 return load_qoi(pFilename, img);
568 if ( (strcasecmp(pExt, "jpg") == 0) || (strcasecmp(pExt, "jfif") == 0) || (strcasecmp(pExt, "jpeg") == 0) )
569 return load_jpg(pFilename, img);
570
571 return false;
572 }
573
574 void convert_ldr_to_hdr_image(imagef &img, const image &ldr_img, bool ldr_srgb_to_linear, float linear_nit_multiplier, float ldr_black_bias)
575 {

Callers 1

load_image_hdrFunction · 0.70

Calls 6

string_get_extensionFunction · 0.85
load_qoiFunction · 0.85
load_pngFunction · 0.70
load_tgaFunction · 0.70
load_jpgFunction · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected