Prusa MINI Firmware overview
|
◆ png_do_pack()
32 switch ((
int)bit_depth)
46 for (
i = 0;
i < row_width;
i++)
84 for (
i = 0;
i < row_width;
i++)
88 value = (png_byte)(*sp & 0x03);
89 v |= (value << shift);
124 for (
i = 0;
i < row_width;
i++)
128 value = (png_byte)(*sp & 0x0f);
129 v |= (value << shift);
155 row_info->
bit_depth = (png_byte)bit_depth;
◆ png_do_shift()
179 int shift_start[4], shift_dec[4];
180 unsigned int channels = 0;
184 shift_start[channels] = row_info->
bit_depth - bit_depth->red;
185 shift_dec[channels] = bit_depth->red;
188 shift_start[channels] = row_info->
bit_depth - bit_depth->green;
189 shift_dec[channels] = bit_depth->green;
192 shift_start[channels] = row_info->
bit_depth - bit_depth->blue;
193 shift_dec[channels] = bit_depth->blue;
199 shift_start[channels] = row_info->
bit_depth - bit_depth->gray;
200 shift_dec[channels] = bit_depth->gray;
206 shift_start[channels] = row_info->
bit_depth - bit_depth->alpha;
207 shift_dec[channels] = bit_depth->alpha;
217 size_t row_bytes = row_info->
rowbytes;
219 if (bit_depth->gray == 1 && row_info->
bit_depth == 2)
222 else if (row_info->
bit_depth == 4 && bit_depth->gray == 3)
228 for (
i = 0;
i < row_bytes;
i++, bp++)
236 for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0])
242 out |= (v >> (-j)) & mask;
245 *bp = (png_byte)(out & 0xff);
255 for (
i = 0;
i < istop;
i++, bp++)
257 unsigned int c =
i%channels;
264 for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c])
273 *bp = (png_byte)(out & 0xff);
283 for (bp = row,
i = 0;
i < istop;
i++)
285 unsigned int c =
i%channels;
287 unsigned int value, v;
292 for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c])
300 *bp++ = (png_byte)((value >> 8) & 0xff);
301 *bp++ = (png_byte)(value & 0xff);
◆ png_do_write_swap_alpha()
312 png_debug(1,
"in png_do_write_swap_alpha");
324 for (
i = 0, sp = dp = row;
i < row_width;
i++)
326 png_byte save = *(sp++);
334 #ifdef PNG_WRITE_16BIT_SUPPORTED
342 for (
i = 0, sp = dp = row;
i < row_width;
i++)
369 for (
i = 0, sp = dp = row;
i < row_width;
i++)
371 png_byte save = *(sp++);
377 #ifdef PNG_WRITE_16BIT_SUPPORTED
385 for (
i = 0, sp = dp = row;
i < row_width;
i++)
◆ png_do_write_invert_alpha()
406 png_debug(1,
"in png_do_write_invert_alpha");
418 for (
i = 0, sp = dp = row;
i < row_width;
i++)
426 *dp = (png_byte)(255 - *(sp++));
430 #ifdef PNG_WRITE_16BIT_SUPPORTED
438 for (
i = 0, sp = dp = row;
i < row_width;
i++)
449 *(dp++) = (png_byte)(255 - *(sp++));
450 *dp = (png_byte)(255 - *(sp++));
465 for (
i = 0, sp = dp = row;
i < row_width;
i++)
468 *(dp++) = (png_byte)(255 - *(sp++));
472 #ifdef PNG_WRITE_16BIT_SUPPORTED
480 for (
i = 0, sp = dp = row;
i < row_width;
i++)
487 *(dp++) = (png_byte)(255 - *(sp++));
488 *dp = (png_byte)(255 - *(sp++));
◆ png_do_write_transformations()
503 png_debug(1,
"in png_do_write_transformations");
508 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
511 (*(
png_ptr->write_user_transform_fn))
524 #ifdef PNG_WRITE_FILLER_SUPPORTED
530 #ifdef PNG_WRITE_PACKSWAP_SUPPORTED
535 #ifdef PNG_WRITE_PACK_SUPPORTED
541 #ifdef PNG_WRITE_SWAP_SUPPORTED
542 # ifdef PNG_16BIT_SUPPORTED
548 #ifdef PNG_WRITE_SHIFT_SUPPORTED
554 #ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
559 #ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
564 #ifdef PNG_WRITE_BGR_SUPPORTED
569 #ifdef PNG_WRITE_INVERT_SUPPORTED
#define PNG_BGR
Definition: pngpriv.h:642
#define PNG_INVERT_ALPHA
Definition: pngpriv.h:661
static void png_do_shift(png_row_infop row_info, png_bytep row, png_const_color_8p bit_depth)
Definition: pngwtran.c:172
static void png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
Definition: pngwtran.c:404
png_byte * png_bytep
Definition: pngconf.h:579
uint8_t i
Definition: screen_test_graph.c:72
#define PNG_INVERT_MONO
Definition: pngpriv.h:647
#define PNG_COLOR_TYPE_RGB_ALPHA
Definition: png.h:671
#define NULL
Definition: usbd_def.h:53
png_uint_32 width
Definition: png.h:756
png_structrp png_ptr
Definition: png.h:1083
void png_do_invert(png_row_infop row_info, png_bytep row)
Definition: pngtrans.c:262
#define PNG_SWAP_BYTES
Definition: pngpriv.h:646
void png_do_bgr(png_row_infop row_info, png_bytep row)
Definition: pngtrans.c:619
unsigned int png_uint_32
Definition: pngconf.h:511
#define PNG_PACKSWAP
Definition: pngpriv.h:658
png_byte channels
Definition: png.h:760
png_byte color_type
Definition: png.h:758
#define png_debug(l, m)
Definition: pngdebug.h:145
#define PNG_FILLER
Definition: pngpriv.h:657
#define png_get_uint_16(buf)
Definition: png.h:2599
static void png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
Definition: pngwtran.c:310
png_byte pixel_depth
Definition: png.h:761
void png_do_swap(png_row_infop row_info, png_bytep row)
Definition: pngtrans.c:319
static void png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
Definition: pngwtran.c:25
void png_do_packswap(png_row_infop row_info, png_bytep row)
Definition: pngtrans.c:455
#define PNG_SHIFT
Definition: pngpriv.h:645
#define PNG_ROWBYTES(pixel_bits, width)
Definition: pngpriv.h:738
#define PNG_FLAG_FILLER_AFTER
Definition: pngpriv.h:686
#define PNG_COLOR_MASK_COLOR
Definition: png.h:664
#define PNG_PACK
Definition: pngpriv.h:644
size_t rowbytes
Definition: png.h:757
png_byte bit_depth
Definition: png.h:759
#define PNG_COLOR_TYPE_GRAY_ALPHA
Definition: png.h:672
#define PNG_COLOR_MASK_ALPHA
Definition: png.h:665
#define PNG_COLOR_TYPE_PALETTE
Definition: png.h:669
#define PNG_SWAP_ALPHA
Definition: pngpriv.h:659
#define PNG_USER_TRANSFORM
Definition: pngpriv.h:662
void png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
Definition: pngtrans.c:495