Lines Matching refs:dest
2701 unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source) { in lodepng_color_mode_copy() argument
2702 lodepng_color_mode_cleanup(dest); in lodepng_color_mode_copy()
2703 lodepng_memcpy(dest, source, sizeof(LodePNGColorMode)); in lodepng_color_mode_copy()
2705 dest->palette = (unsigned char*)lodepng_malloc(1024); in lodepng_color_mode_copy()
2706 if(!dest->palette && source->palettesize) return 83; /*alloc fail*/ in lodepng_color_mode_copy()
2707 lodepng_memcpy(dest->palette, source->palette, source->palettesize * 4); in lodepng_color_mode_copy()
2861 static unsigned LodePNGUnknownChunks_copy(LodePNGInfo* dest, const LodePNGInfo* src) { in LodePNGUnknownChunks_copy() argument
2864 LodePNGUnknownChunks_cleanup(dest); in LodePNGUnknownChunks_copy()
2868 dest->unknown_chunks_size[i] = src->unknown_chunks_size[i]; in LodePNGUnknownChunks_copy()
2869 dest->unknown_chunks_data[i] = (unsigned char*)lodepng_malloc(src->unknown_chunks_size[i]); in LodePNGUnknownChunks_copy()
2870 if(!dest->unknown_chunks_data[i] && dest->unknown_chunks_size[i]) return 83; /*alloc fail*/ in LodePNGUnknownChunks_copy()
2872 dest->unknown_chunks_data[i][j] = src->unknown_chunks_data[i][j]; in LodePNGUnknownChunks_copy()
2897 static unsigned LodePNGText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { in LodePNGText_copy() argument
2899 dest->text_keys = NULL; in LodePNGText_copy()
2900 dest->text_strings = NULL; in LodePNGText_copy()
2901 dest->text_num = 0; in LodePNGText_copy()
2903 CERROR_TRY_RETURN(lodepng_add_text(dest, source->text_keys[i], source->text_strings[i])); in LodePNGText_copy()
2957 static unsigned LodePNGIText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { in LodePNGIText_copy() argument
2959 dest->itext_keys = NULL; in LodePNGIText_copy()
2960 dest->itext_langtags = NULL; in LodePNGIText_copy()
2961 dest->itext_transkeys = NULL; in LodePNGIText_copy()
2962 dest->itext_strings = NULL; in LodePNGIText_copy()
2963 dest->itext_num = 0; in LodePNGIText_copy()
2965 CERROR_TRY_RETURN(lodepng_add_itext(dest, source->itext_keys[i], source->itext_langtags[i], in LodePNGIText_copy()
3073 unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) { in lodepng_info_copy() argument
3074 lodepng_info_cleanup(dest); in lodepng_info_copy()
3075 lodepng_memcpy(dest, source, sizeof(LodePNGInfo)); in lodepng_info_copy()
3076 lodepng_color_mode_init(&dest->color); in lodepng_info_copy()
3077 CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color)); in lodepng_info_copy()
3080 CERROR_TRY_RETURN(LodePNGText_copy(dest, source)); in lodepng_info_copy()
3081 CERROR_TRY_RETURN(LodePNGIText_copy(dest, source)); in lodepng_info_copy()
3083 …CERROR_TRY_RETURN(lodepng_assign_icc(dest, source->iccp_name, source->iccp_profile, source->iccp_p… in lodepng_info_copy()
3086 LodePNGUnknownChunks_init(dest); in lodepng_info_copy()
3087 CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source)); in lodepng_info_copy()
5075 void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source) { in lodepng_state_copy() argument
5076 lodepng_state_cleanup(dest); in lodepng_state_copy()
5077 *dest = *source; in lodepng_state_copy()
5078 lodepng_color_mode_init(&dest->info_raw); in lodepng_state_copy()
5079 lodepng_info_init(&dest->info_png); in lodepng_state_copy()
5080 dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); if(dest->error) return; in lodepng_state_copy()
5081 dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); if(dest->error) return; in lodepng_state_copy()