Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RenderTarget" /> class.
        /// </summary>
        /// <param name="buffers">The render target buffers.</param>
        /// <param name="colorSpace">The render target color space.</param>
        /// <param name="sampling">The render target buffer sampling options.</param>
        public RenderTarget(TargetBuffers buffers = TargetBuffers.Color0, ColorSpace colorSpace = ColorSpace.Linear, Sampling sampling = Sampling.None)
        {
            if (buffers == TargetBuffers.None)
            {
                throw new ArgumentException("Render target must have at least one buffer.", nameof(buffers));
            }

            if ((buffers & TargetBuffers.Color0) == TargetBuffers.Color0)
            {
                this.Color0 = new Texture2D(null, colorSpace, sampling);
            }

            if ((buffers & TargetBuffers.Color1) == TargetBuffers.Color1)
            {
                this.Color1 = new Texture2D(null, colorSpace, sampling);
            }

            if ((buffers & TargetBuffers.Color2) == TargetBuffers.Color2)
            {
                this.Color2 = new Texture2D(null, colorSpace, sampling);
            }

            if ((buffers & TargetBuffers.Color3) == TargetBuffers.Color3)
            {
                this.Color3 = new Texture2D(null, colorSpace, sampling);
            }

            if ((buffers & TargetBuffers.DepthStencil) == TargetBuffers.DepthStencil)
            {
                this.DepthStencil = new Texture2D(null, ColorSpace.sRGB, sampling & ~Sampling.Mipmap);
            }
        }
Beispiel #2
0
   protected LeveledColor(
 ColorSpace colorSpace,
 PdfDirectObject baseObject
 )
       : base(colorSpace, baseObject)
   {
   }
Beispiel #3
0
		/// <summary>
		/// Converts the colorspace of an image (in-place)
		/// </summary>
		/// <param name="cs">Colorspace to convert into</param>
		/// <returns>Self</returns>
		public Image ChangeColorSpace(ColorSpace cs) {
			// Colorspace is already correct
			if (_cm.colorspace == cs) return this;

			byte[] ycbcr = new byte[3];
			byte[] rgb = new byte[3];

			if (_cm.colorspace == ColorSpace.RGB && cs == ColorSpace.YCbCr) {
				/*
				 *  Y' =       + 0.299    * R'd + 0.587    * G'd + 0.114    * B'd
					Cb = 128   - 0.168736 * R'd - 0.331264 * G'd + 0.5      * B'd
					Cr = 128   + 0.5      * R'd - 0.418688 * G'd - 0.081312 * B'd
				 * 
				 */

				for (int x = 0; x < width; x++)
					for (int y = 0; y < height; y++) {
						YCbCr.fromRGB(ref _raster[0][x, y], ref _raster[1][x, y], ref _raster[2][x, y]);
					}

				_cm.colorspace = ColorSpace.YCbCr;


			} else if (_cm.colorspace == ColorSpace.YCbCr && cs == ColorSpace.RGB) {

				for (int x = 0; x < width; x++)
					for (int y = 0; y < height; y++) {
						// 0 is LUMA
						// 1 is BLUE
						// 2 is RED

						YCbCr.toRGB(ref _raster[0][x, y], ref _raster[1][x, y], ref _raster[2][x, y]);
					}

				_cm.colorspace = ColorSpace.RGB;
			} else if (_cm.colorspace == ColorSpace.Gray && cs == ColorSpace.YCbCr) {
				// To convert to YCbCr, we just add two 128-filled chroma channels

				byte[,] Cb = new byte[width, height];
				byte[,] Cr = new byte[width, height];

				for (int x = 0; x < width; x++)
					for (int y = 0; y < height; y++) {
						Cb[x, y] = 128; Cr[x, y] = 128;
					}

				_raster = new byte[][,] { _raster[0], Cb, Cr };

				_cm.colorspace = ColorSpace.YCbCr;
			} else if (_cm.colorspace == ColorSpace.Gray && cs == ColorSpace.RGB) {
				ChangeColorSpace(ColorSpace.YCbCr);
				ChangeColorSpace(ColorSpace.RGB);
			} else {
				throw new Exception("Colorspace conversion not supported.");
			}

			return this;
		}
Beispiel #4
0
        /// <summary>
        /// Converts the color from a particualr color space to the specified <see cref="ColorSpace"/>.
        /// </summary>
        /// <param name="color">The color.</param>
        /// <param name="sourceColorSpace">The color space of this instance.</param>
        /// <param name="colorSpace">The color space.</param>
        /// <returns>The color converted to the specified color space.</returns>
        public static Color3 ToColorSpace(this Color3 color, ColorSpace sourceColorSpace, ColorSpace colorSpace)
        {
            // Nothing to do?
            if (sourceColorSpace == colorSpace)
            {
                return color;
            }

            return sourceColorSpace == ColorSpace.Gamma ? color.ToLinear() : color.ToSRgb();
        }
        internal static ColorRecord Load(ColorBookReader reader, ColorSpace colorSpace)
        {
            ColorRecord color = new ColorRecord();

            color.Name = StringUtil.ReadValue(reader.ReadString());
            color.Code = Encoding.ASCII.GetString(reader.ReadBytes(6));
            color.Components = BaseColorComponent.LoadComponents(reader, colorSpace);

            return color;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PortableDocumentImage" /> class.
 /// </summary>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="bitsPerComponent">The number of bits per component.</param>
 /// <param name="bits">The bits.</param>
 /// <param name="maskBits">The bits of the mask.</param>
 /// <param name="interpolate">Interpolate if set to <c>true</c>.</param>
 /// <param name="colorSpace">The color space.</param>
 public PortableDocumentImage(int width, int height, int bitsPerComponent, byte[] bits, byte[] maskBits = null, bool interpolate = true, ColorSpace colorSpace = ColorSpace.DeviceRGB)
 {
     this.Width = width;
     this.Height = height;
     this.BitsPerComponent = bitsPerComponent;
     this.ColorSpace = colorSpace;
     this.Bits = bits;
     this.MaskBits = maskBits;
     this.Interpolate = interpolate;
     this.ColorSpace = ColorSpace.DeviceRGB;
 }
 internal static IColorComponents LoadComponents(ColorBookReader reader, ColorSpace colorSpace)
 {
     switch (colorSpace) {
         case ColorSpace.RGB:
             return ComponentRGB.Load(reader);
         case ColorSpace.CMYK:
             return ComponentCMYK.Load(reader);
         case ColorSpace.Lab:
             return ComponentLab.Load(reader);
         default:
             throw new NotSupportedException();
     }
 }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Texture2D" /> class.
        /// </summary>
        /// <param name="path">The source file path.</param>
        /// <param name="colorSpace">The source image color space.</param>
        /// <param name="sampling">The sampling options.</param>
        public Texture2D(string path, ColorSpace colorSpace, Sampling sampling = Sampling.None) : base(GL.TEXTURE_2D, colorSpace, sampling)
        {
            this.Image = new TextureImage(this, GL.TEXTURE_2D);

            if (path != null)
            {
                this.Ready = this.Load(path);
            }
            else
            {
                this.Ready = Task.CompletedTask;
            }
        }
Beispiel #9
0
 public static ColorSpace ToColorSpace(this TextureColorSpace textureColorSpace, ColorSpace colorSpaceReference, TextureHint textureHint)
 {
     var colorSpace = colorSpaceReference;
     if (textureHint == TextureHint.Color)
     {
         if (textureColorSpace == TextureColorSpace.Linear)
         {
             colorSpace = ColorSpace.Linear;
         }
         else if (textureColorSpace == TextureColorSpace.Gamma)
         {
             colorSpace = ColorSpace.Gamma;
         }
     }
     return colorSpace;
 }
Beispiel #10
0
   public TextStyle(
 Font font,
 double fontSize,
 TextRenderModeEnum renderMode,
 Color strokeColor,
 ColorSpace strokeColorSpace,
 Color fillColor,
 ColorSpace fillColorSpace
 )
   {
       this.font = font;
         this.fontSize = fontSize;
         this.renderMode = renderMode;
         this.strokeColor = strokeColor;
         this.strokeColorSpace = strokeColorSpace;
         this.fillColor = fillColor;
         this.fillColorSpace = fillColorSpace;
   }
Beispiel #11
0
        public override RenderFrame GetRenderFrame(RenderContext context)
        {
            // Get the relative frame
            var relativeFrame = context.Tags.Get(RelativeSizeSource == RenderFrameRelativeMode.Current ? RenderFrame.Current : SceneGraphicsLayer.Master);

            // Check if we need to resize it
            if (currentFrame != null && (currentFrame.Descriptor != Descriptor || currentFrame.CheckIfResizeRequired(relativeFrame) || Descriptor.Format == RenderFrameFormat.LDR && colorSpace != context.GraphicsDevice.ColorSpace))
            {
                Dispose();
            }

            // Store the colorSpace
            colorSpace = context.GraphicsDevice.ColorSpace;

            // Allocate the render frame if necessary
            // TODO: Should we use allocated shared textures from RenderContext?
            return currentFrame ?? (currentFrame = RenderFrame.New(context.GraphicsDevice, Descriptor, relativeFrame));
        }
Beispiel #12
0
        public ColorLocation(byte r, byte g, byte b, ColorSpace cs)
        {
            R = r;
            G = g;
            B = b;

            switch (cs) {
                case ColorSpace.RGB:
                    setLocationAsRGB();
                    break;
                case ColorSpace.HSL:
                    setLocationAsHSL();
                    break;
                case ColorSpace.HSV:
                    setLocationAsHSV();
                    break;
            }
        }
Beispiel #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextureCube" /> class.
        /// </summary>
        /// <param name="path">The asset file path.</param>
        /// <param name="colorSpace">The source image color space.</param>
        /// <param name="sampling">The sampling options.</param>
        public TextureCube(string path, ColorSpace colorSpace, Sampling sampling = Sampling.None) : base(GL.TEXTURE_CUBE_MAP, colorSpace, sampling)
        {
            this.PositiveX = new TextureImage(this, GL.TEXTURE_CUBE_MAP_POSITIVE_X);
            this.PositiveY = new TextureImage(this, GL.TEXTURE_CUBE_MAP_POSITIVE_Y);
            this.PositiveZ = new TextureImage(this, GL.TEXTURE_CUBE_MAP_POSITIVE_Z);
            this.NegativeX = new TextureImage(this, GL.TEXTURE_CUBE_MAP_NEGATIVE_X);
            this.NegativeY = new TextureImage(this, GL.TEXTURE_CUBE_MAP_NEGATIVE_Y);
            this.NegativeZ = new TextureImage(this, GL.TEXTURE_CUBE_MAP_NEGATIVE_Z);

            if (path != null)
            {
                this.Ready = this.Load(path);
            }
            else
            {
                this.Ready = Task.CompletedTask;
            }
        }
        /// <summary>
        /// Try to convert from YCbCr to RGB colors
        /// </summary>
        /// <param name="sourceColorspace">The colorspace of the luma and chroma</param>
        /// <param name="luma">The luma plane</param>
        /// <param name="blueDifferential">The blue differential (Cb) plane</param>
        /// <param name="redDifferential">The red differential (Cr) plane</param>
        /// <param name="width">The width of the frame</param>
        /// <param name="height">The height of the frame</param>
        /// <returns>An RGB plane if this function succeeds. None otherwise</returns>
        /// <remarks>
        /// FFMPEG outputs 420mpeg2 (where the chroma samples are aligned horizontally, but 
        /// shifted a half-pixel down).
        /// https://msdn.microsoft.com/en-us/library/windows/desktop/dd206750(v=vs.85).aspx
        /// </remarks>
        public static Maybe<Color[][]> TryConvertFrameToRGB(
            ColorSpace sourceColorspace,
            byte[][] luma,
            byte[][] blueDifferential,
            byte[][] redDifferential,
            int width,
            int height
        )
        {
            var inFrames = new YCrCbFrame
            {
                ColorSpace = sourceColorspace,
                Luma = luma,
                Cb = blueDifferential,
                Cr = redDifferential,
                Width = width,
                Height = height,
            };
            if (Equals(sourceColorspace, ColorSpace.FourFourFour))
            {
                return TryConvertYCbCr444ToRGB(inFrames);
            }

            if (Equals(sourceColorspace, ColorSpace.FourTwoTwo))
            {
                return from horizontalUpconvert in TryConvert422To444(inFrames)
                       select TryConvertYCbCr444ToRGB(horizontalUpconvert);
            }

            if (Equals(sourceColorspace, ColorSpace.FourTwoZeroMpeg2))
            {
                return from verticalUpconvert in TryConvert420To422(inFrames)
                       from horizontalUpconvert in TryConvert422To444(verticalUpconvert)
                       select TryConvertYCbCr444ToRGB(horizontalUpconvert);
            }

            return Maybe<Color[][]>.Nothing;
        }
Beispiel #15
0
 /// <summary>
 /// Converts the color to a floating point representation in the target color space.
 /// </summary>
 /// <param name="color">The color.</param>
 /// <param name="colorSpace">The target color space.</param>
 /// <returns>The floating point representation.</returns>
 public static Vector4 ToVector4(this Color color, ColorSpace colorSpace = ColorSpace.sRGB)
 {
     if (colorSpace == ColorSpace.sRGB)
     {
         return new Vector4
         {
             X = color.R / 255f,
             Y = color.G / 255f,
             Z = color.B / 255f,
             W = color.A / 255f,
         };
     }
     else
     {
         return new Vector4
         {
             X = ToLinear(color.R),
             Y = ToLinear(color.G),
             Z = ToLinear(color.B),
             W = color.A / 255f,
         };
     }
 }
        private static double Convert(double c, ColorSpace sourceSpace, ColorSpace targetSpace)
        {
            // Convert source space --> sRGB --> target space.
            switch (sourceSpace)
            {
                case ColorSpace.SRgb:
                    break;
                case ColorSpace.Linear:
                    c = ColorHelper.ToSRgb(c);
                    break;
            }

            switch (targetSpace)
            {
                case ColorSpace.SRgb:
                    break;
                case ColorSpace.Linear:
                    c = ColorHelper.ToLinear(c);
                    break;
            }

            return c;
        }
 /// <summary>
 /// ��ColorSpace�Ƿ���ɫ������ģʽ��
 /// </summary>
 /// <param name="cs"><seealso cref="ColorSpace"/>������</param>
 /// <returns>����ColorSpace��ɫ������ģʽʱ������true�������Ƿ�ɫ������ģʽ������false��</returns>
 public static bool isColor(ColorSpace cs)
 {
     return (cs < ColorSpace.Vector);
 }
 /// <summary>
 /// ���� <seealso cref="ColorSpace"/> ��������Ϣ��
 /// </summary>
 /// <param name="cs">ɫ�ʿռ� <seealso cref="ColorSpace"/>������</param>
 /// <returns>����������Ϣ��</returns>
 public static ColorSpaceName findName(ColorSpace cs)
 {
     return KeyValuePairs.find(Names, cs);
 }
 /// <summary>
 /// ��ָ���IJ�����ʼ�� ColorSpaceName �����ʵ��������������
 /// </summary>
 /// <param name="colorSpace">ɫ�ʿռ䡣</param>
 /// <param name="name">ɫ�ʿռ�����ơ����硰CIEXYZ����</param>
 /// <param name="nameShort">ɫ�ʿռ�Ķ����ƣ�����ͨ������д�����硰XYZ����</param>
 /// <param name="nameC0">ͨ��0�����ơ�</param>
 /// <param name="nameC1">ͨ��1�����ơ�</param>
 /// <param name="nameC2">ͨ��2�����ơ�</param>
 /// <param name="nameC3">ͨ��3�����ơ�</param>
 public ColorSpaceName(ColorSpace colorSpace, string name, string nameShort, string nameC0, string nameC1, string nameC2, string nameC3)
     : this(colorSpace, name, nameShort, nameC0, nameC1, nameC2, nameC3, string.Empty)
 {
 }
 /// <summary>
 /// ��ָ���IJ�����ʼ�� ColorSpaceName �����ʵ���� 
 /// </summary>
 /// <param name="colorSpace">ɫ�ʿռ䡣</param>
 /// <param name="name">ɫ�ʿռ�����ơ����硰CIEXYZ����</param>
 /// <param name="nameShort">ɫ�ʿռ�Ķ����ƣ�����ͨ������д�����硰XYZ����</param>
 /// <param name="nameC0">ͨ��0�����ơ�</param>
 /// <param name="nameC1">ͨ��1�����ơ�</param>
 /// <param name="nameC2">ͨ��2�����ơ�</param>
 /// <param name="nameC3">ͨ��3�����ơ�</param>
 /// <param name="description">������Ϣ��</param>
 public ColorSpaceName(ColorSpace colorSpace, string name, string nameShort, string nameC0, string nameC1, string nameC2, string nameC3, string description)
 {
     this.colorSpace = colorSpace;
     this.name = name;
     this.nameShort = nameShort;
     this.description = description;
     this.nameChannels = new string[4] { nameC0, nameC1, nameC2, nameC3 };
 }
Beispiel #21
0
 public void SetColorSpace(ColorSpace value)
 {
   #if ANYCPU
   if (NativeLibrary.Is64Bit)
   #endif
   #if WIN64 || ANYCPU
   NativeMethods.X64.QuantizeSettings_SetColorSpace(Instance, (UIntPtr)value);
   #endif
   #if ANYCPU
   else
   #endif
   #if !WIN64 || ANYCPU
   NativeMethods.X86.QuantizeSettings_SetColorSpace(Instance, (UIntPtr)value);
   #endif
 }
        public static Bitmap ToBitmap(PlanarImage source, PixelFormat format, ColorSpace colorspace = ColorSpace.DEFAULT)
        {
            IntPtr context = SwScale.sws_getContext(source.Width, source.Height, m_pixelTypeMapper[source.PixelType],
                                             source.Width, source.Height, m_rgbMapper[format],
                                             SwScale.ConvertionFlags.SWS_BICUBIC, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            int* pCoef = SwScale.sws_getCoefficients(colorspace);
            int* inv_table;
            int* table;
            int srcRange, dstRange, brightness, contrast, saturation;

            int result = SwScale.sws_getColorspaceDetails(context, out inv_table, out srcRange, out table, out dstRange, out brightness, out contrast, out saturation);
            if (result != -1)
            {
                result = SwScale.sws_setColorspaceDetails(context, pCoef, srcRange, pCoef, dstRange, brightness, contrast, saturation);
            }

            Bitmap bmp = new Bitmap(source.Width, source.Height, format);
            BitmapData data = bmp.LockBits(new Rectangle(0, 0, source.Width, source.Height), ImageLockMode.ReadWrite, format);

            unsafe
            {
                pInput[0] = (byte*)data.Scan0.ToPointer();

                result = SwScale.sws_scale(context, source.PixelDataPointer, source.Pitches, 0, source.Height, pInput, new int[] { data.Stride, 0, 0, 0 });
                if (result != source.Height)
                {
                    throw new InvalidOperationException();
                }
            }

            bmp.UnlockBits(data);
            if (bmp.Palette != null && bmp.Palette.Entries != null && bmp.Palette.Entries.Length > 0)
            {
                ColorPalette cp = bmp.Palette;
                for (int i = 0; i < cp.Entries.Length; i++)
                {
                    cp.Entries[i] = Color.FromArgb(i, i, i);
                }
                bmp.Palette = cp;
            }

            SwScale.sws_freeContext(context);
            return bmp;
        }
        public static PlanarImage FromBitmap(Bitmap source, PixelAlignmentType format, ColorSpace colorspace = ColorSpace.DEFAULT)
        {
            IntPtr context = SwScale.sws_getContext(source.Width, source.Height, m_rgbMapper[source.PixelFormat],
                                             source.Width, source.Height, m_pixelTypeMapper[format],
                                             SwScale.ConvertionFlags.SWS_BICUBIC, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            int* pCoef = SwScale.sws_getCoefficients(colorspace);
            int* inv_table;
            int* table;
            int srcRange, dstRange, brightness, contrast, saturation;

            int result = SwScale.sws_getColorspaceDetails(context, out inv_table, out srcRange, out table, out dstRange, out brightness, out contrast, out saturation);
            if (result != -1)
            {
                result = SwScale.sws_setColorspaceDetails(context, pCoef, srcRange, table, dstRange, brightness, contrast, saturation);
            }

            PlanarImage yuv = new PlanarImage(source.Width, source.Height, format);
            BitmapData data = source.LockBits(new Rectangle(0, 0, source.Width, source.Height), ImageLockMode.ReadOnly, source.PixelFormat);

            unsafe
            {
                pInput[0] = (byte*)data.Scan0.ToPointer();
                result = SwScale.sws_scale(context, pInput, new int[] { data.Stride, 0, 0, 0 }, 0, source.Height, yuv.PixelDataPointer, yuv.Pitches);
                if (result != yuv.Height)
                {
                    throw new InvalidOperationException();
                }
            }

            source.UnlockBits(data);
            SwScale.sws_freeContext(context);
            return yuv;
        }
	//Nav mesh settings can't be accessed via script :(

	//Lightmapping is VERY version-specific. You may have to modify the settings that are compared
	public void CaptureSettings() {
#if UNITY_5
#else
		aoAmount = LightmapEditorSettings.aoAmount;
		aoContrast = LightmapEditorSettings.aoContrast;
		bounceBoost = LightmapEditorSettings.bounceBoost;	 
		bounceIntensity = LightmapEditorSettings.bounceIntensity;
		bounces = LightmapEditorSettings.bounces;
		
		quality = LightmapEditorSettings.quality;
		skyLightColor = LightmapEditorSettings.skyLightColor;
		skyLightIntensity = LightmapEditorSettings.skyLightIntensity;

		finalGatherContrastThreshold = LightmapEditorSettings.finalGatherContrastThreshold;
		finalGatherGradientThreshold = LightmapEditorSettings.finalGatherGradientThreshold;
		finalGatherInterpolationPoints = LightmapEditorSettings.finalGatherInterpolationPoints;
		finalGatherRays = LightmapEditorSettings.finalGatherRays;
		lastUsedResolution = LightmapEditorSettings.lastUsedResolution;
		lockAtlas = LightmapEditorSettings.lockAtlas;
#if !(UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5)
		bakedColorSpace = LightmapSettings.bakedColorSpace;
#endif
#endif
		ambientLight = RenderSettings.ambientLight;
#if UNITY_4_3 || UNITY_4_5 || UNITY_5 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3
		flareFadeSpeed = RenderSettings.flareFadeSpeed;
#endif
#if UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5
#else
		lightProbes = LightmapSettings.lightProbes;
		padding = LightmapEditorSettings.padding;
#endif
		flareStrength = RenderSettings.flareStrength;
		fog = RenderSettings.fog;
		fogColor = RenderSettings.fogColor;
		fogDensity = RenderSettings.fogDensity;
		fogEndDistance = RenderSettings.fogEndDistance;
		fogMode = RenderSettings.fogMode;
		fogStartDistance = RenderSettings.fogStartDistance;
		haloStrength = RenderSettings.haloStrength;
		skybox = RenderSettings.skybox;

		lightmaps = LightmapSettings.lightmaps;
		lightmapsMode = LightmapSettings.lightmapsMode;

		aoMaxDistance = LightmapEditorSettings.aoMaxDistance;
		maxAtlasHeight = LightmapEditorSettings.maxAtlasHeight;
		maxAtlasWidth = LightmapEditorSettings.maxAtlasWidth;
		resolution = LightmapEditorSettings.resolution;
		textureCompression = LightmapEditorSettings.textureCompression;
	}
 private static KeyValuePair<ColorSpace, ColorSpaceName> newKVPName(ColorSpace colorSpace, string name, string nameShort, string nameC0, string nameC1, string nameC2, string nameC3, string description)
 {
     return KeyValuePairs.newKVP(colorSpace, new ColorSpaceName(colorSpace, name, nameShort, nameC0, nameC1, nameC2, nameC3, description));
 }
Beispiel #26
0
 public override bool Equals(ColorSpace other)
 {
     var otherColor = other as Cmyk;
     if (otherColor != null)
         return C.Equals(otherColor.C) && M.Equals(otherColor.M) && Y.Equals(otherColor.Y) && K.Equals(otherColor.K);
     return false;
 }
Beispiel #27
0
 public extern void ReadTextureImportInstructions(BuildTarget target, out TextureFormat desiredFormat, out ColorSpace colorSpace, out int compressionQuality);
Beispiel #28
0
 public override bool VirtuallyEquals(ColorSpace other)
 {
     var otherColor = other as Cmyk;
     if (otherColor != null)
     {
         return C.ApproximatelyEquals(otherColor.C) &&
                M.ApproximatelyEquals(otherColor.M) &&
                Y.ApproximatelyEquals(otherColor.Y) &&
                K.ApproximatelyEquals(otherColor.K);
     }
     return false;
 }
Beispiel #29
0
        private bool TIFFjpeg_set_colorspace(ColorSpace colorspace)
        {
            try
            {
                m_compression.jpeg_set_colorspace(colorspace);
            }
            catch (Exception)
            {
                return false;
            }

            return true;
        }
 public static extern unsafe int* sws_getCoefficients(ColorSpace colorspace);