Lines Matching refs:colour_type

296 standard_name(char *buffer, size_t bufsize, size_t pos, png_byte colour_type,
300 pos = safecat(buffer, bufsize, pos, colour_types[colour_type]);
362 next_format(png_bytep colour_type, png_bytep bit_depth,
367 *colour_type = 0;
376 if (*colour_type == 3)
390 || (*colour_type != 3 && *bit_depth <= 16)
396 switch (*colour_type)
399 *colour_type = 2;
404 *colour_type = 3;
409 *colour_type = 4;
414 *colour_type = 6;
425 sample(png_const_bytep row, png_byte colour_type, png_byte bit_depth,
434 if ((colour_type & 1) == 0) /* !palette */
436 if (colour_type & 2)
439 if (colour_type & 4)
443 if (colour_type & (2+4))
1851 png_byte colour_type; /* From IHDR */
2371 pm->bit_depth = pm->colour_type = 0;
2517 pm->colour_type = pm->buffer[8+8+1];
2754 pm->colour_type = 255;
2911 switch (pm->colour_type)
3185 bit_size(png_const_structp pp, png_byte colour_type, png_byte bit_depth)
3187 switch (colour_type)
3210 transform_rowsize(png_const_structp pp, png_byte colour_type,
3213 return (TRANSFORM_WIDTH * bit_size(pp, colour_type, bit_depth)) / 8;
3216 /* transform_width(pp, colour_type, bit_depth) current returns the same number
3219 #define transform_width(pp, colour_type, bit_depth) TRANSFORM_WIDTH
3222 transform_height(png_const_structp pp, png_byte colour_type, png_byte bit_depth)
3224 switch (bit_size(pp, colour_type, bit_depth))
3291 png_byte colour_type, png_byte bit_depth, png_uint_32 y)
3296 switch (bit_size(pp, colour_type, bit_depth))
3439 make_transform_image(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type,
3460 h = transform_height(pp, colour_type, bit_depth);
3462 png_set_IHDR(pp, pi, transform_width(pp, colour_type, bit_depth), h,
3463 bit_depth, colour_type, interlace_type,
3495 if (colour_type == 3) /* palette */
3501 transform_rowsize(pp, colour_type, bit_depth))
3524 transform_row(pp, buffer, colour_type, bit_depth, y);
3554 store_storefile(ps, FILEID(colour_type, bit_depth, palette_number,
3573 png_byte colour_type = 0;
3583 while (next_format(&colour_type, &bit_depth, &palette_number, 0))
3592 standard_name(name, sizeof name, 0, colour_type, bit_depth,
3594 make_transform_image(ps, colour_type, bit_depth, palette_number,
3671 make_size_image(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type,
3692 PNG_CONST png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/,
3705 png_set_IHDR(pp, pi, w, h, bit_depth, colour_type, interlace_type,
3732 if (colour_type == 3) /* palette */
3741 pixel_size = bit_size(pp, colour_type, bit_depth);
3869 make_size(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type, int bdlo,
3886 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_NONE,
3888 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_NONE,
3891 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7,
3893 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7,
3907 /* Arguments are colour_type, low bit depth, high bit depth
3979 make_error(png_store* volatile psIn, png_byte PNG_CONST colour_type,
3998 png_set_IHDR(pp, pi, transform_width(pp, colour_type, bit_depth),
3999 transform_height(pp, colour_type, bit_depth), bit_depth, colour_type,
4002 if (colour_type == 3) /* palette */
4044 transform_rowsize(pp, colour_type, bit_depth))
4049 png_uint_32 h = transform_height(pp, colour_type, bit_depth);
4064 transform_row(pp, buffer, colour_type, bit_depth, y);
4083 make_errors(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
4096 standard_name(name, sizeof name, 0, colour_type, 1<<bdlo, 0,
4101 make_error(&pm->this, colour_type, DEPTH(bdlo), interlace_type,
4243 png_byte colour_type;
4279 dp->colour_type = COL_FROM_ID(id);
4283 if (dp->colour_type == 3)
4484 if (png_get_color_type(pp, pi) != dp->colour_type)
4519 if (dp->colour_type & PNG_COLOR_MASK_COLOR)
4548 if (dp->colour_type & PNG_COLOR_MASK_ALPHA)
4586 switch (dp->colour_type)
5111 test_standard(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
5121 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5157 test_size(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
5180 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5187 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5195 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5202 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5214 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5222 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5277 png_byte colour_type; /* As in the spec. */
5326 image_pixel_init(image_pixel *this, png_const_bytep row, png_byte colour_type,
5329 PNG_CONST png_byte sample_depth = (png_byte)(colour_type ==
5338 sample(row, colour_type, bit_depth, x, 0);
5344 if (colour_type == 3) /* palette */
5362 if (colour_type & 2)
5364 this->green = sample(row, colour_type, bit_depth, x, 1);
5365 this->blue = sample(row, colour_type, bit_depth, x, 2);
5368 if (colour_type & 4)
5369 this->alpha = sample(row, colour_type, bit_depth, x, ++i);
5381 this->colour_type = colour_type;
5397 if (this->colour_type == PNG_COLOR_TYPE_PALETTE)
5401 this->colour_type = PNG_COLOR_TYPE_RGB_ALPHA;
5405 this->colour_type = PNG_COLOR_TYPE_RGB;
5421 if (this->colour_type == PNG_COLOR_TYPE_PALETTE)
5424 if ((this->colour_type & PNG_COLOR_MASK_ALPHA) == 0)
5426 if (this->colour_type == PNG_COLOR_TYPE_GRAY)
5446 this->colour_type = PNG_COLOR_TYPE_GRAY_ALPHA;
5449 else if (this->colour_type == PNG_COLOR_TYPE_RGB)
5465 this->colour_type = PNG_COLOR_TYPE_RGB_ALPHA;
5531 PNG_CONST struct image_transform **that, png_byte colour_type,
5647 if (that->colour_type & PNG_COLOR_MASK_COLOR)
5661 if ((that->colour_type & PNG_COLOR_MASK_ALPHA) ||
5662 that->colour_type == PNG_COLOR_TYPE_PALETTE)
5777 test_pixel.colour_type = dp->this.colour_type; /* input */
5779 if (test_pixel.colour_type == PNG_COLOR_TYPE_PALETTE)
5792 if (test_pixel.colour_type != dp->output_colour_type)
5799 pos = safecatn(message, sizeof message, pos, test_pixel.colour_type);
5819 if (test_pixel.colour_type == PNG_COLOR_TYPE_PALETTE)
5895 PNG_CONST png_byte in_ct = dp->this.colour_type;
6173 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6175 UNUSED(colour_type)
6200 if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
6208 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6215 return colour_type == PNG_COLOR_TYPE_PALETTE;
6239 if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
6262 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6273 return (colour_type & PNG_COLOR_MASK_ALPHA) == 0;
6301 if ((that->colour_type & PNG_COLOR_MASK_COLOR) == 0 && that->have_tRNS)
6305 if (that->colour_type == PNG_COLOR_TYPE_GRAY)
6314 that->colour_type = PNG_COLOR_TYPE_RGB;
6317 else if (that->colour_type == PNG_COLOR_TYPE_GRAY_ALPHA)
6318 that->colour_type = PNG_COLOR_TYPE_RGB_ALPHA;
6325 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6332 return (colour_type & PNG_COLOR_MASK_COLOR) == 0;
6356 if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
6369 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6379 return (colour_type & PNG_COLOR_MASK_ALPHA) == 0;
6410 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6412 return image_transform_png_set_expand_add(this, that, colour_type,
6439 if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
6453 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6455 UNUSED(colour_type)
6498 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6500 UNUSED(colour_type)
6565 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6567 UNUSED(colour_type)
6595 if (that->colour_type == PNG_COLOR_TYPE_GRAY_ALPHA)
6596 that->colour_type = PNG_COLOR_TYPE_GRAY;
6597 else if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA)
6598 that->colour_type = PNG_COLOR_TYPE_RGB;
6608 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
6615 return (colour_type & PNG_COLOR_MASK_ALPHA) != 0;
6956 if ((that->colour_type & PNG_COLOR_MASK_COLOR) != 0)
6960 if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
7218 if (that->colour_type == PNG_COLOR_TYPE_RGB)
7219 that->colour_type = PNG_COLOR_TYPE_GRAY;
7220 else if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA)
7221 that->colour_type = PNG_COLOR_TYPE_GRAY_ALPHA;
7229 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth)
7236 return (colour_type & PNG_COLOR_MASK_COLOR) != 0;
7263 png_byte colour_type, bit_depth;
7278 colour_type = that->this.colour_type;
7279 if (colour_type == 3)
7281 colour_type = PNG_COLOR_TYPE_RGB;
7292 image_pixel_init(&data, random_bytes, colour_type,
7300 if (colour_type & PNG_COLOR_MASK_COLOR)
7325 if (that->have_tRNS && that->colour_type != PNG_COLOR_TYPE_PALETTE)
7366 if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA)
7367 that->colour_type = PNG_COLOR_TYPE_RGB;
7368 else if (that->colour_type == PNG_COLOR_TYPE_GRAY_ALPHA)
7369 that->colour_type = PNG_COLOR_TYPE_GRAY;
7486 png_byte colour_type, png_byte bit_depth)
7527 if (list->add(list, this, colour_type, bit_depth) || max == 0)
7581 size_t *pos, png_byte colour_type, png_byte bit_depth)
7641 png_byte colour_type = 0;
7645 while (next_format(&colour_type, &bit_depth, &palette_number, 0))
7662 name, sizeof name, &pos, colour_type, bit_depth);
7671 transform_test(pm, FILEID(colour_type, bit_depth, palette_number,
7947 if ((dp->this.colour_type & PNG_COLOR_MASK_ALPHA) != 0 ||
7948 (dp->this.colour_type == 3 && dp->this.is_transparent))
8642 PNG_CONST png_byte in_ct = dp->this.colour_type;
8926 d.this.bit_depth, colour_types[d.this.colour_type], name,
8930 if (d.this.colour_type == 0 || d.this.colour_type == 4)
8966 else if (d.this.colour_type == 2 || d.this.colour_type == 6)
8989 else if (d.this.colour_type == 3)
9000 static void gamma_threshold_test(png_modifier *pm, png_byte colour_type,
9011 (void)gamma_test(pm, colour_type, bit_depth, 0/*palette*/, interlace_type,
9021 png_byte colour_type = 0;
9029 while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/))
9038 gamma_threshold_test(pm, colour_type, bit_depth, pm->interlace_type,
9044 gamma_threshold_test(pm, colour_type, bit_depth, pm->interlace_type,
9053 PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth,
9079 gamma_test(pm, colour_type, bit_depth, palette_number, interlace_type,
9086 png_byte colour_type = 0;
9090 while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/))
9097 gamma_transform_test(pm, colour_type, bit_depth, palette_number,
9117 png_byte colour_type = 0, bit_depth = 0;
9120 while (next_format(&colour_type, &bit_depth, &npalette, 1/*gamma*/))
9121 if ((colour_type & PNG_COLOR_MASK_ALPHA) == 0 &&
9122 ((colour_type == 3 && sbit < 8) ||
9123 (colour_type != 3 && sbit < bit_depth)))
9133 gamma_transform_test(pm, colour_type, bit_depth, npalette,
9208 PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth,
9311 if (!(colour_type & PNG_COLOR_MASK_COLOR))
9331 if (colour_type & PNG_COLOR_MASK_COLOR)
9345 gamma_test(pm, colour_type, bit_depth, palette_number, interlace_type,
9355 png_byte colour_type = 0;
9362 while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/))
9363 if ((colour_type & PNG_COLOR_MASK_ALPHA) != 0)
9370 gamma_composition_test(pm, colour_type, bit_depth, palette_number,