Lines Matching refs:bitdepth
3103 static unsigned lodepng_get_bpp_lct(LodePNGColorType colortype, unsigned bitdepth) in lodepng_get_bpp_lct() argument
3106 return getNumColorChannels(colortype) * bitdepth; in lodepng_get_bpp_lct()
3116 info->bitdepth = 8; in lodepng_color_mode_init()
3157 LodePNGColorMode lodepng_color_mode_make(LodePNGColorType colortype, unsigned bitdepth) in lodepng_color_mode_make() argument
3162 result.bitdepth = bitdepth; in lodepng_color_mode_make()
3170 if(a->bitdepth != b->bitdepth) return 0; in lodepng_color_mode_equal()
3212 return lodepng_get_bpp_lct(info->colortype, info->bitdepth); in lodepng_get_bpp()
3251 …e_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) in lodepng_get_raw_size_lct() argument
3253 size_t bpp = lodepng_get_bpp_lct(colortype, bitdepth); in lodepng_get_raw_size_lct()
3260 return lodepng_get_raw_size_lct(w, h, color->colortype, color->bitdepth); in lodepng_get_raw_size()
3667 if(mode->bitdepth == 8) out[i] = gray; in rgba8ToPixel()
3668 else if(mode->bitdepth == 16) out[i * 2 + 0] = out[i * 2 + 1] = gray; in rgba8ToPixel()
3671 gray = ((unsigned)gray >> (8u - mode->bitdepth)) & ((1u << mode->bitdepth) - 1u); in rgba8ToPixel()
3672 addColorBits(out, i, mode->bitdepth, gray); in rgba8ToPixel()
3676 if(mode->bitdepth == 8) { in rgba8ToPixel()
3690 if(mode->bitdepth == 8) out[i] = index; in rgba8ToPixel()
3691 else addColorBits(out, i, mode->bitdepth, (unsigned)index); in rgba8ToPixel()
3695 if(mode->bitdepth == 8) { in rgba8ToPixel()
3699 else if(mode->bitdepth == 16) { in rgba8ToPixel()
3705 if(mode->bitdepth == 8) { in rgba8ToPixel()
3766 if(mode->bitdepth == 8) { in getPixelColorRGBA8()
3771 else if(mode->bitdepth == 16) { in getPixelColorRGBA8()
3777 … unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ in getPixelColorRGBA8()
3778 size_t j = i * mode->bitdepth; in getPixelColorRGBA8()
3779 unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); in getPixelColorRGBA8()
3786 if(mode->bitdepth == 8) { in getPixelColorRGBA8()
3805 if(mode->bitdepth == 8) index = in[i]; in getPixelColorRGBA8()
3807 size_t j = i * mode->bitdepth; in getPixelColorRGBA8()
3808 index = readBitsFromReversedStream(&j, in, mode->bitdepth); in getPixelColorRGBA8()
3817 if(mode->bitdepth == 8) { in getPixelColorRGBA8()
3827 if(mode->bitdepth == 8) { in getPixelColorRGBA8()
3853 if(mode->bitdepth == 8) { in getPixelColorsRGBA8()
3865 else if(mode->bitdepth == 16) { in getPixelColorsRGBA8()
3872 … unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ in getPixelColorsRGBA8()
3875 unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); in getPixelColorsRGBA8()
3882 if(mode->bitdepth == 8) { in getPixelColorsRGBA8()
3907 if(mode->bitdepth == 8) { in getPixelColorsRGBA8()
3917 unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); in getPixelColorsRGBA8()
3924 if(mode->bitdepth == 8) { in getPixelColorsRGBA8()
3938 if(mode->bitdepth == 8) { in getPixelColorsRGBA8()
3960 if(mode->bitdepth == 8) { in getPixelColorsRGB8()
3965 else if(mode->bitdepth == 16) { in getPixelColorsRGB8()
3971 … unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ in getPixelColorsRGB8()
3974 unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); in getPixelColorsRGB8()
3980 if(mode->bitdepth == 8) { in getPixelColorsRGB8()
3992 if(mode->bitdepth == 8) { in getPixelColorsRGB8()
4002 unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); in getPixelColorsRGB8()
4009 if(mode->bitdepth == 8) { in getPixelColorsRGB8()
4021 if(mode->bitdepth == 8) { in getPixelColorsRGB8()
4090 size_t palsize = (size_t)1u << mode_out->bitdepth; in lodepng_convert()
4100 if(mode_in->colortype == LCT_PALETTE && mode_in->bitdepth == mode_out->bitdepth) { in lodepng_convert()
4116 if(mode_in->bitdepth == 16 && mode_out->bitdepth == 16) { in lodepng_convert()
4123 else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGBA) { in lodepng_convert()
4126 else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGB) { in lodepng_convert()
4159 unsigned mul = 65535 / ((1u << mode_in->bitdepth) - 1u); /*65535, 21845, 4369, 257, 1*/ in lodepng_convert_rgb()
4160 unsigned shift = 16 - mode_out->bitdepth; in lodepng_convert_rgb()
4292 if(mode_in->bitdepth == 16 && !sixteen) { in lodepng_compute_color_stats()
4457 mode.bitdepth = 16; in lodepng_color_stats_add()
4514 mode_out->bitdepth = palettebits; in auto_choose_color()
4517 && mode_in->bitdepth == mode_out->bitdepth) { in auto_choose_color()
4524 mode_out->bitdepth = bits; in auto_choose_color()
4528 … unsigned mask = (1u << mode_out->bitdepth) - 1u; /*stats always uses 16-bit, mask converts it*/ in auto_choose_color()
4647 info->color.bitdepth = in[24]; in lodepng_inspect()
4658 state->error = checkColorValidity(info->color.colortype, info->color.bitdepth); in lodepng_inspect()
5476 unsigned bitdepth = (info->color.colortype == LCT_PALETTE) ? 8 : info->color.bitdepth; in readChunk_sBIT() local
5480 if(data[0] == 0 || data[0] > bitdepth) return 115; in readChunk_sBIT()
5488 if(data[0] > bitdepth || data[1] > bitdepth || data[2] > bitdepth) return 115; in readChunk_sBIT()
5498 if(data[0] > bitdepth || data[1] > bitdepth) return 115; in readChunk_sBIT()
5507 …if(data[0] > bitdepth || data[1] > bitdepth || data[2] > bitdepth || data[3] > bitdepth) return 11… in readChunk_sBIT()
5830 && !(state->info_raw.bitdepth == 8)) { in lodepng_decode()
5855 size_t insize, LodePNGColorType colortype, unsigned bitdepth) in lodepng_decode_memory() argument
5861 state.info_raw.bitdepth = bitdepth; in lodepng_decode_memory()
5884 LodePNGColorType colortype, unsigned bitdepth) in lodepng_decode_file() argument
5893 if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth); in lodepng_decode_file()
5979 … LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) in addChunk_IHDR() argument
5987 data[8] = (unsigned char)bitdepth; /*bit depth*/ in addChunk_IHDR()
6282 unsigned bitdepth = (info->color.colortype == LCT_PALETTE) ? 8 : info->color.bitdepth; in addChunk_sBIT() local
6285 if(info->sbit_r == 0 || info->sbit_r > bitdepth) return 115; in addChunk_sBIT()
6291 … if(info->sbit_r > bitdepth || info->sbit_g > bitdepth || info->sbit_b > bitdepth) return 115; in addChunk_sBIT()
6299 if(info->sbit_r > bitdepth || info->sbit_a > bitdepth) return 115; in addChunk_sBIT()
6306 info->sbit_r > bitdepth || info->sbit_g > bitdepth || in addChunk_sBIT()
6307 info->sbit_b > bitdepth || info->sbit_a > bitdepth) { in addChunk_sBIT()
6442 (color->colortype == LCT_PALETTE || color->bitdepth < 8)) strategy = LFS_ZERO; in filter()
6831 state->error = checkColorValidity(info_png->color.colortype, info_png->color.bitdepth); in lodepng_encode()
6833 state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); in lodepng_encode()
6901 …nfo.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA) && info.color.bitdepth == 16 && in lodepng_encode()
6902 auto_color.colortype == info.color.colortype && auto_color.bitdepth == 8 && in lodepng_encode()
6915 equal && info_png->sbit_r == auto_color.bitdepth) { in lodepng_encode()
6987 …state->error = addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlac… in lodepng_encode()
7133 … unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) in lodepng_encode_memory() argument
7139 state.info_raw.bitdepth = bitdepth; in lodepng_encode_memory()
7141 state.info_png.color.bitdepth = bitdepth; in lodepng_encode_memory()
7160 LodePNGColorType colortype, unsigned bitdepth) in lodepng_encode_file() argument
7164 unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); in lodepng_encode_file()
7533 size_t insize, LodePNGColorType colortype, unsigned bitdepth) in decode() argument
7536 unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); in decode()
7540 state.info_raw.bitdepth = bitdepth; in decode()
7549 … const std::vector<unsigned char> & in, LodePNGColorType colortype, unsigned bitdepth) in decode() argument
7551 return decode(out, w, h, in.empty() ? 0 : &in[0], (unsigned)in.size(), colortype, bitdepth); in decode()
7577 LodePNGColorType colortype, unsigned bitdepth) in decode() argument
7584 return decode(out, w, h, buffer, colortype, bitdepth); in decode()
7591 LodePNGColorType colortype, unsigned bitdepth) in encode() argument
7595 unsigned error = lodepng_encode_memory(&buffer, &buffersize, in, w, h, colortype, bitdepth); in encode()
7605 LodePNGColorType colortype, unsigned bitdepth) in encode() argument
7607 if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; in encode()
7608 return encode(out, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); in encode()
7636 LodePNGColorType colortype, unsigned bitdepth) in encode() argument
7639 unsigned error = encode(buffer, in, w, h, colortype, bitdepth); in encode()
7646 LodePNGColorType colortype, unsigned bitdepth) in encode() argument
7648 if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; in encode()
7649 return encode(filename, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); in encode()