GetPredictorValue() public method

public GetPredictorValue ( ) : Predictor
return Predictor
Exemplo n.º 1
0
        public override void PrintDir(Tiff tif, Stream fd, TiffPrintFlags flags)
        {
            CodecWithPredictor sp = tif.m_currentCodec as CodecWithPredictor;

            Debug.Assert(sp != null);

            if (tif.fieldSet(CodecWithPredictor.FIELD_PREDICTOR))
            {
                Tiff.fprintf(fd, "  Predictor: ");
                Predictor predictor = sp.GetPredictorValue();
                switch (predictor)
                {
                case Predictor.NONE:
                    Tiff.fprintf(fd, "none ");
                    break;

                case Predictor.HORIZONTAL:
                    Tiff.fprintf(fd, "horizontal differencing ");
                    break;

                case Predictor.FLOATINGPOINT:
                    Tiff.fprintf(fd, "floating point predictor ");
                    break;
                }

                Tiff.fprintf(fd, "{0} (0x{1:x})\r\n", predictor, predictor);
            }

            TiffTagMethods childMethods = sp.GetChildTagMethods();

            if (childMethods != null)
            {
                childMethods.PrintDir(tif, fd, flags);
            }
            else
            {
                base.PrintDir(tif, fd, flags);
            }
        }
Exemplo n.º 2
0
        public override FieldValue[] GetField(Tiff tif, TiffTag tag)
        {
            CodecWithPredictor sp = tif.m_currentCodec as CodecWithPredictor;

            Debug.Assert(sp != null);

            switch (tag)
            {
            case TiffTag.PREDICTOR:
                FieldValue[] result = new FieldValue[1];
                result[0].Set(sp.GetPredictorValue());
                return(result);
            }

            TiffTagMethods childMethods = sp.GetChildTagMethods();

            if (childMethods != null)
            {
                return(childMethods.GetField(tif, tag));
            }

            return(base.GetField(tif, tag));
        }