• R/O
  • SSH

GM: Commit

Main GraphicsMagick source repository


Commit MetaInfo

Révision7b8dc0fd7b3f2164c14d3aa45e182d46f4652baf (tree)
l'heure2001-01-29 22:25:07
AuteurJohn Cristy <duc.sequere.aut.de.via.decede@gmai...>
CommiterJohn Cristy

Message de Log

*** empty log message ***

Change Summary

Modification

diff -r 7f4eb5a1b58b -r 7b8dc0fd7b3f coders/png.c
--- a/coders/png.c Sun Jan 28 23:37:56 2001 -0600
+++ b/coders/png.c Mon Jan 29 07:25:07 2001 -0600
@@ -698,10 +698,10 @@
698698 %
699699 % o exception: return any errors or warnings in this structure.
700700 %
701-% To do, more or less in chronological order (as of version 5.1.1,
702-% January 25, 2000 -- glennrp -- see also "To do" under WritePNGImage):
701+% To do, more or less in chronological order (as of version 5.2.8,
702+% January 23, 2001 -- glennrp -- see also "To do" under WritePNGImage):
703703 %
704-% Add MAGN chunk support.
704+% Get 16-bit cheap transparency working.
705705 %
706706 % (At this point, PNG decoding is supposed to be in full MNG-LC compliance)
707707 %
@@ -1606,7 +1606,8 @@
16061606 frame_timeout=default_frame_timeout;
16071607 fb=default_fb;
16081608 if (length > 0)
1609- framing_mode=p[0];
1609+ if (p[0])
1610+ framing_mode=p[0];
16101611 if (length > 6)
16111612 {
16121613 /*
@@ -2678,6 +2679,86 @@
26782679 {
26792680 if (!SetImagePixels(image,0,y,image->columns,1))
26802681 break;
2682+#if (QuantumDepth == 8)
2683+ if (image->depth == 16)
2684+ {
2685+ register Quantum
2686+ *p,
2687+ *r;
2688+
2689+ r=scanlines[y];
2690+ p=r;
2691+ for (x=0; x < (int) image->columns; x++)
2692+ {
2693+ if (ping_info->color_type == PNG_COLOR_TYPE_GRAY)
2694+ {
2695+ *r++ = *p++;
2696+ p++;
2697+ if ((ping_info->valid & PNG_INFO_tRNS) &&
2698+ (((*(p-2)<<8)|*(p-1))==transparent_color.opacity))
2699+ {
2700+ /* Cheap transparency */
2701+ *r++ = TransparentOpacity;
2702+ }
2703+ else
2704+ *r++ = OpaqueOpacity;
2705+ }
2706+ if(ping_info->color_type == PNG_COLOR_TYPE_RGB)
2707+ {
2708+ *r++ = *p++;
2709+ p++;
2710+ *r++ = *p++;
2711+ p++;
2712+ *r++ = *p++;
2713+ p++;
2714+ if ((ping_info->valid & PNG_INFO_tRNS) &&
2715+ (((*(p-6)<<8)|*(p-5))==transparent_color.red) &&
2716+ (((*(p-4)<<8)|*(p-3))==transparent_color.green) &&
2717+ (((*(p-2)<<8)|*(p-1))==transparent_color.blue))
2718+ {
2719+ /* Cheap transparency */
2720+ *r++ = TransparentOpacity;
2721+ }
2722+ else
2723+ *r++ = OpaqueOpacity;
2724+ }
2725+ *r++ = *p++;
2726+ p++;
2727+ if (ping_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
2728+ ping_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
2729+ {
2730+ *r++ = *p++;
2731+ p++;
2732+ }
2733+ if (ping_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
2734+ {
2735+ *r++ = *p++;
2736+ p++;
2737+ *r++ = *p++;
2738+ p++;
2739+ }
2740+ }
2741+ }
2742+ if (image->depth == 8 && ping_info->color_type == PNG_COLOR_TYPE_GRAY)
2743+ (void) PushImagePixels(image,GrayQuantum,scanlines[y]);
2744+ if (ping_info->color_type == PNG_COLOR_TYPE_GRAY ||
2745+ ping_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
2746+ {
2747+ image->depth=8;
2748+ (void) PushImagePixels(image,GrayOpacityQuantum,scanlines[y]);
2749+ }
2750+ else if (image->depth == 8 && ping_info->color_type ==
2751+ PNG_COLOR_TYPE_RGB)
2752+ (void) PushImagePixels(image,RGBQuantum,scanlines[y]);
2753+ else if (ping_info->color_type == PNG_COLOR_TYPE_RGB ||
2754+ ping_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
2755+ {
2756+ image->depth=8;
2757+ (void) PushImagePixels(image,RGBAQuantum,scanlines[y]);
2758+ }
2759+ else if (ping_info->color_type == PNG_COLOR_TYPE_PALETTE)
2760+ (void) PushImagePixels(image,IndexQuantum,scanlines[y]);
2761+#else
26812762 if (ping_info->color_type == PNG_COLOR_TYPE_GRAY)
26822763 (void) PushImagePixels(image,GrayQuantum,scanlines[y]);
26832764 else
@@ -2691,6 +2772,7 @@
26912772 (void) PushImagePixels(image,IndexQuantum,scanlines[y]);
26922773 else
26932774 (void) PushImagePixels(image,RGBQuantum,scanlines[y]);
2775+#endif
26942776 if (!SyncImagePixels(image))
26952777 break;
26962778 if (image->previous == (Image *) NULL)
@@ -3603,7 +3685,7 @@
36033685 % o image: A pointer to an Image structure.
36043686 %
36053687 %
3606-% To do (as of version 4.2.9, August 29, 1999 -- glennrp -- see also
3688+% To do (as of version 5.2.8, January 23, 2001 -- glennrp -- see also
36073689 % "To do" under ReadPNGImage):
36083690 %
36093691 % Preserve all unknown and not-yet-handled known chunks found in input
Afficher sur ancien navigateur de dépôt.