Lines Matching refs:info_ptr

24 write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr,
27 if (info_ptr->unknown_chunks_num != 0)
33 for (up = info_ptr->unknown_chunks;
34 up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
78 * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing
84 png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr)
88 if (png_ptr == NULL || info_ptr == NULL)
107 png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
108 info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
109 info_ptr->filter_type,
111 info_ptr->interlace_type
133 if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
134 (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_gAMA) != 0 &&
135 (info_ptr->valid & PNG_INFO_gAMA) != 0)
136 png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma);
145 if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
146 (info_ptr->valid & PNG_INFO_iCCP) != 0)
149 if ((info_ptr->valid & PNG_INFO_sRGB) != 0)
154 png_write_iCCP(png_ptr, info_ptr->iccp_name,
155 info_ptr->iccp_profile);
163 if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
164 (info_ptr->valid & PNG_INFO_sRGB) != 0)
165 png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent);
170 if ((info_ptr->valid & PNG_INFO_sBIT) != 0)
171 png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
176 if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
177 (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0 &&
178 (info_ptr->valid & PNG_INFO_cHRM) != 0)
179 png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy);
184 write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR);
192 png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
200 if (png_ptr == NULL || info_ptr == NULL)
203 png_write_info_before_PLTE(png_ptr, info_ptr);
205 if ((info_ptr->valid & PNG_INFO_PLTE) != 0)
206 png_write_PLTE(png_ptr, info_ptr->palette,
207 (png_uint_32)info_ptr->num_palette);
209 else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
213 if ((info_ptr->valid & PNG_INFO_tRNS) !=0)
218 info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
222 jend = info_ptr->num_trans;
227 info_ptr->trans_alpha[j] =
228 (png_byte)(255 - info_ptr->trans_alpha[j]);
231 png_write_tRNS(png_ptr, info_ptr->trans_alpha, &(info_ptr->trans_color),
232 info_ptr->num_trans, info_ptr->color_type);
236 if ((info_ptr->valid & PNG_INFO_bKGD) != 0)
237 png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
241 if ((info_ptr->valid & PNG_INFO_hIST) != 0)
242 png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette);
246 if ((info_ptr->valid & PNG_INFO_oFFs) != 0)
247 png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset,
248 info_ptr->offset_unit_type);
252 if ((info_ptr->valid & PNG_INFO_pCAL) != 0)
253 png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0,
254 info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams,
255 info_ptr->pcal_units, info_ptr->pcal_params);
259 if ((info_ptr->valid & PNG_INFO_sCAL) != 0)
260 png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit,
261 info_ptr->scal_s_width, info_ptr->scal_s_height);
265 if ((info_ptr->valid & PNG_INFO_pHYs) != 0)
266 png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit,
267 info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type);
271 if ((info_ptr->valid & PNG_INFO_tIME) != 0)
273 png_write_tIME(png_ptr, &(info_ptr->mod_time));
279 if ((info_ptr->valid & PNG_INFO_sPLT) != 0)
280 for (i = 0; i < (int)info_ptr->splt_palettes_num; i++)
281 png_write_sPLT(png_ptr, info_ptr->splt_palettes + i);
286 for (i = 0; i < info_ptr->num_text; i++)
289 info_ptr->text[i].compression);
291 if (info_ptr->text[i].compression > 0)
296 info_ptr->text[i].compression,
297 info_ptr->text[i].key,
298 info_ptr->text[i].lang,
299 info_ptr->text[i].lang_key,
300 info_ptr->text[i].text);
302 if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
303 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
305 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
312 else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_zTXt)
316 png_write_zTXt(png_ptr, info_ptr->text[i].key,
317 info_ptr->text[i].text, info_ptr->text[i].compression);
319 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
325 else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
329 png_write_tEXt(png_ptr, info_ptr->text[i].key,
330 info_ptr->text[i].text,
333 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
343 write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_PLTE);
353 png_write_end(png_structrp png_ptr, png_inforp info_ptr)
369 if (info_ptr != NULL)
376 if ((info_ptr->valid & PNG_INFO_tIME) != 0 &&
378 png_write_tIME(png_ptr, &(info_ptr->mod_time));
383 for (i = 0; i < info_ptr->num_text; i++)
386 info_ptr->text[i].compression);
388 if (info_ptr->text[i].compression > 0)
393 info_ptr->text[i].compression,
394 info_ptr->text[i].key,
395 info_ptr->text[i].lang,
396 info_ptr->text[i].lang_key,
397 info_ptr->text[i].text);
399 if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
400 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
402 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
408 else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt)
412 png_write_zTXt(png_ptr, info_ptr->text[i].key,
413 info_ptr->text[i].text, info_ptr->text[i].compression);
415 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
421 else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
425 png_write_tEXt(png_ptr, info_ptr->text[i].key,
426 info_ptr->text[i].text, 0);
428 info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
436 write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT);
1332 png_write_png(png_structrp png_ptr, png_inforp info_ptr,
1335 if (png_ptr == NULL || info_ptr == NULL)
1338 if ((info_ptr->valid & PNG_INFO_IDAT) == 0)
1345 png_write_info(png_ptr, info_ptr);
1362 if ((info_ptr->valid & PNG_INFO_sBIT) != 0)
1363 png_set_shift(png_ptr, &info_ptr->sig_bit);
1444 png_write_image(png_ptr, info_ptr->row_pointers);
1447 png_write_end(png_ptr, info_ptr);
1464 png_infop info_ptr = png_create_info_struct(png_ptr);
1466 if (info_ptr != NULL)
1476 control->info_ptr = info_ptr;
1484 png_destroy_info_struct(png_ptr, &info_ptr);
1906 png_set_PLTE(image->opaque->png_ptr, image->opaque->info_ptr, palette,
1910 png_set_tRNS(image->opaque->png_ptr, image->opaque->info_ptr, tRNS,
1923 png_inforp info_ptr = image->opaque->info_ptr;
1982 png_set_IHDR(png_ptr, info_ptr, image->width, image->height,
1996 png_set_IHDR(png_ptr, info_ptr, image->width, image->height,
2011 png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_LINEAR);
2014 png_set_cHRM_fixed(png_ptr, info_ptr,
2024 png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL);
2030 png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
2033 png_write_info(png_ptr, info_ptr);
2113 png_get_rowbytes(png_ptr, info_ptr)));
2146 png_write_end(png_ptr, info_ptr);