Ejemplo n.º 1
0
        private static Colorspace GetColorSpace(PhotometricInterpretation photometricInterpretation)
        {
            if (photometricInterpretation == PhotometricInterpretation.Rgb)
            {
                return Colorspace.RGB;
            }
            else if (photometricInterpretation == PhotometricInterpretation.Monochrome1
                     || photometricInterpretation == PhotometricInterpretation.Monochrome2)
            {
                return Colorspace.Grayscale;
            }
            else if (photometricInterpretation == PhotometricInterpretation.PaletteColor)
            {
                return Colorspace.Grayscale;
            }
            else if (photometricInterpretation == PhotometricInterpretation.YbrFull
                     || photometricInterpretation == PhotometricInterpretation.YbrFull422
                     || photometricInterpretation == PhotometricInterpretation.YbrPartial422)
            {
                return Colorspace.YCbCr;
            }

            return Colorspace.Unknown;
        }
Ejemplo n.º 2
0
 private static JpegColorSpace GetJpegColorSpace(PhotometricInterpretation photometricInterpretation)
 {
     if (photometricInterpretation == PhotometricInterpretation.Rgb) return JpegColorSpace.sRGB;
     else if (photometricInterpretation == PhotometricInterpretation.Monochrome1
              || photometricInterpretation == PhotometricInterpretation.Monochrome2) return JpegColorSpace.GreyScale;
     else if (photometricInterpretation == PhotometricInterpretation.PaletteColor) return JpegColorSpace.GreyScale;
     else if (photometricInterpretation == PhotometricInterpretation.YbrFull
              || photometricInterpretation == PhotometricInterpretation.YbrFull422
              || photometricInterpretation == PhotometricInterpretation.YbrPartial422) return JpegColorSpace.sYCC;
     else return JpegColorSpace.Unknown;
 }