示例#1
0
        /// <summary>
        /// Sets the resolution of the image.
        /// <remarks>
        /// This method sets both the bitmap data and EXIF resolution if available.
        /// </remarks>
        /// </summary>
        /// <param name="horizontal">The horizontal resolution.</param>
        /// <param name="vertical">The vertical resolution.</param>
        /// <param name="unit">
        /// The unit of measure for the horizontal resolution and the vertical resolution.
        /// Defaults to inches
        /// </param>
        /// <returns>
        /// The <see cref="ImageFactory"/>.
        /// </returns>
        public ImageFactory Resolution(int horizontal, int vertical, PropertyTagResolutionUnit unit = PropertyTagResolutionUnit.Inch)
        {
            if (this.ShouldProcess)
            {
                // Sanitize the input.
                horizontal = ImageMaths.Clamp(horizontal, 0, int.MaxValue);
                vertical   = ImageMaths.Clamp(vertical, 0, int.MaxValue);

                Tuple <int, int, PropertyTagResolutionUnit> resolution =
                    new Tuple <int, int, PropertyTagResolutionUnit>(horizontal, vertical, unit);

                Resolution dpi = new Resolution {
                    DynamicParameter = resolution
                };
                this.CurrentImageFormat.ApplyProcessor(dpi.ProcessImage, this);
            }

            return(this);
        }
示例#2
0
        /// <summary>
        /// Sets the resolution of the image.
        /// <remarks>
        /// This method sets both the bitmap data and EXIF resolution if available.
        /// </remarks>
        /// </summary>
        /// <param name="horizontal">The horizontal resolution.</param>
        /// <param name="vertical">The vertical resolution.</param>
        /// <param name="unit">
        /// The unit of measure for the horizontal resolution and the vertical resolution. 
        /// Defaults to inches
        /// </param>
        /// <returns>
        /// The <see cref="ImageFactory"/>.
        /// </returns>
        public ImageFactory Resolution(int horizontal, int vertical, PropertyTagResolutionUnit unit = PropertyTagResolutionUnit.Inch)
        {
            if (this.ShouldProcess)
            {
                // Sanitize the input.
                horizontal = ImageMaths.Clamp(horizontal, 0, int.MaxValue);
                vertical = ImageMaths.Clamp(vertical, 0, int.MaxValue);

                Tuple<int, int, PropertyTagResolutionUnit> resolution =
                    new Tuple<int, int, PropertyTagResolutionUnit>(horizontal, vertical, unit);

                Resolution dpi = new Resolution { DynamicParameter = resolution };
                this.CurrentImageFormat.ApplyProcessor(dpi.ProcessImage, this);
            }

            return this;
        }
        /// <summary>
        /// Sets the resolution of the image.
        /// <remarks>
        /// This method sets both the bitmap data and EXIF resolution if available.
        /// </remarks>
        /// </summary>
        /// <param name="horizontal">The horizontal resolution.</param>
        /// <param name="vertical">The vertical resolution.</param>
        /// <param name="unit">
        /// The unit of measure for the horizontal resolution and the vertical resolution. 
        /// Defaults to inches
        /// </param>
        /// <returns>
        /// The <see cref="ImageFactory"/>.
        /// </returns>
        public ImageFactory Resolution(int horizontal, int vertical, PropertyTagResolutionUnit unit = PropertyTagResolutionUnit.Inch)
        {
            if (this.ShouldProcess)
            {
                // Sanitize the input.
                if (horizontal < 0 || vertical < 0)
                {
                    return this;
                }

                Tuple<int, int, PropertyTagResolutionUnit> resolution =
                    new Tuple<int, int, PropertyTagResolutionUnit>(horizontal, vertical, unit);

                Resolution dpi = new Resolution { DynamicParameter = resolution };
                this.backupFormat.ApplyProcessor(dpi.ProcessImage, this);
            }

            return this;
        }
示例#4
0
 public ResolutionLayer(int horizontal,
                        int vertical,
                        PropertyTagResolutionUnit unit)
 {
 }
示例#5
0
文件: Exif.cs 项目: Spesiel/Library
        public override int GetHashCode()
        {
            int ans = HasBeenSet.GetHashCode();

            ans ^= PropertyTagGpsVer.GetHashCode();
            ans ^= PropertyTagGpsLatitudeRef.GetHashCode();
            ans ^= PropertyTagGpsLatitude.GetHashCode();
            ans ^= PropertyTagGpsLongitudeRef.GetHashCode();
            ans ^= PropertyTagGpsLongitude.GetHashCode();
            ans ^= PropertyTagGpsAltitudeRef.GetHashCode();
            ans ^= PropertyTagGpsAltitude.GetHashCode();
            ans ^= PropertyTagGpsGpsTime.GetHashCode();
            ans ^= PropertyTagGpsGpsSatellites.GetHashCode();
            ans ^= PropertyTagGpsGpsStatus.GetHashCode();
            ans ^= PropertyTagGpsGpsMeasureMode.GetHashCode();
            ans ^= PropertyTagGpsGpsDop.GetHashCode();
            ans ^= PropertyTagGpsSpeedRef.GetHashCode();
            ans ^= PropertyTagGpsSpeed.GetHashCode();
            ans ^= PropertyTagGpsTrackRef.GetHashCode();
            ans ^= PropertyTagGpsTrack.GetHashCode();
            ans ^= PropertyTagGpsImgDirRef.GetHashCode();
            ans ^= PropertyTagGpsImgDir.GetHashCode();
            ans ^= PropertyTagGpsMapDatum.GetHashCode();
            ans ^= PropertyTagGpsDestLatRef.GetHashCode();
            ans ^= PropertyTagGpsDestLat.GetHashCode();
            ans ^= PropertyTagGpsDestLongRef.GetHashCode();
            ans ^= PropertyTagGpsDestLong.GetHashCode();
            ans ^= PropertyTagGpsDestBearRef.GetHashCode();
            ans ^= PropertyTagGpsDestBear.GetHashCode();
            ans ^= PropertyTagGpsDestDistRef.GetHashCode();
            ans ^= PropertyTagGpsDestDist.GetHashCode();
            ans ^= PropertyTagNewSubfileType.GetHashCode();
            ans ^= PropertyTagSubfileType.GetHashCode();
            ans ^= PropertyTagImageWidth.GetHashCode();
            ans ^= PropertyTagImageHeight.GetHashCode();
            ans ^= PropertyTagBitsPerSample.GetHashCode();
            ans ^= PropertyTagCompression.GetHashCode();
            ans ^= PropertyTagPhotometricInterp.GetHashCode();
            ans ^= PropertyTagThreshHolding.GetHashCode();
            ans ^= PropertyTagCellWidth.GetHashCode();
            ans ^= PropertyTagCellHeight.GetHashCode();
            ans ^= PropertyTagFillOrder.GetHashCode();
            ans ^= PropertyTagDocumentName.GetHashCode();
            ans ^= PropertyTagImageDescription.GetHashCode();
            ans ^= PropertyTagEquipMake.GetHashCode();
            ans ^= PropertyTagEquipModel.GetHashCode();
            ans ^= PropertyTagStripOffsets.GetHashCode();
            ans ^= PropertyTagOrientation.GetHashCode();
            ans ^= PropertyTagSamplesPerPixel.GetHashCode();
            ans ^= PropertyTagRowsPerStrip.GetHashCode();
            ans ^= PropertyTagStripBytesCount.GetHashCode();
            ans ^= PropertyTagMinSampleValue.GetHashCode();
            ans ^= PropertyTagMaxSampleValue.GetHashCode();
            ans ^= PropertyTagXResolution.GetHashCode();
            ans ^= PropertyTagYResolution.GetHashCode();
            ans ^= PropertyTagPlanarConfig.GetHashCode();
            ans ^= PropertyTagPageName.GetHashCode();
            ans ^= PropertyTagXPosition.GetHashCode();
            ans ^= PropertyTagYPosition.GetHashCode();
            ans ^= PropertyTagFreeOffset.GetHashCode();
            ans ^= PropertyTagFreeByteCounts.GetHashCode();
            ans ^= PropertyTagGrayResponseUnit.GetHashCode();
            ans ^= PropertyTagGrayResponseCurve.GetHashCode();
            ans ^= PropertyTagT4Option.GetHashCode();
            ans ^= PropertyTagT6Option.GetHashCode();
            ans ^= PropertyTagResolutionUnit.GetHashCode();
            ans ^= PropertyTagPageNumber.GetHashCode();
            ans ^= PropertyTagTransferFunction.GetHashCode();
            ans ^= PropertyTagSoftwareUsed.GetHashCode();
            ans ^= PropertyTagDateTime.GetHashCode();
            ans ^= PropertyTagArtist.GetHashCode();
            ans ^= PropertyTagHostComputer.GetHashCode();
            ans ^= PropertyTagPredictor.GetHashCode();
            ans ^= PropertyTagWhitePoint.GetHashCode();
            ans ^= PropertyTagPrimaryChromaticities.GetHashCode();
            ans ^= PropertyTagColorMap.GetHashCode();
            ans ^= PropertyTagHalftoneHints.GetHashCode();
            ans ^= PropertyTagTileWidth.GetHashCode();
            ans ^= PropertyTagTileLength.GetHashCode();
            ans ^= PropertyTagTileOffset.GetHashCode();
            ans ^= PropertyTagTileByteCounts.GetHashCode();
            ans ^= PropertyTagInkSet.GetHashCode();
            ans ^= PropertyTagInkNames.GetHashCode();
            ans ^= PropertyTagNumberOfInks.GetHashCode();
            ans ^= PropertyTagDotRange.GetHashCode();
            ans ^= PropertyTagTargetPrinter.GetHashCode();
            ans ^= PropertyTagExtraSamples.GetHashCode();
            ans ^= PropertyTagSampleFormat.GetHashCode();
            ans ^= PropertyTagSMinSampleValue.GetHashCode();
            ans ^= PropertyTagSMaxSampleValue.GetHashCode();
            ans ^= PropertyTagTransferRange.GetHashCode();
            ans ^= PropertyTagJPEGProc.GetHashCode();
            ans ^= PropertyTagJPEGInterFormat.GetHashCode();
            ans ^= PropertyTagJPEGInterLength.GetHashCode();
            ans ^= PropertyTagJPEGRestartInterval.GetHashCode();
            ans ^= PropertyTagJPEGLosslessPredictors.GetHashCode();
            ans ^= PropertyTagJPEGPointTransforms.GetHashCode();
            ans ^= PropertyTagJPEGQTables.GetHashCode();
            ans ^= PropertyTagJPEGDCTables.GetHashCode();
            ans ^= PropertyTagJPEGACTables.GetHashCode();
            ans ^= PropertyTagYCbCrCoefficients.GetHashCode();
            ans ^= PropertyTagYCbCrSubsampling.GetHashCode();
            ans ^= PropertyTagYCbCrPositioning.GetHashCode();
            ans ^= PropertyTagREFBlackWhite.GetHashCode();
            ans ^= PropertyTagGamma.GetHashCode();
            ans ^= PropertyTagICCProfileDescriptor.GetHashCode();
            ans ^= PropertyTagSRGBRenderingIntent.GetHashCode();
            ans ^= PropertyTagImageTitle.GetHashCode();
            ans ^= PropertyTagResolutionXUnit.GetHashCode();
            ans ^= PropertyTagResolutionYUnit.GetHashCode();
            ans ^= PropertyTagResolutionXLengthUnit.GetHashCode();
            ans ^= PropertyTagResolutionYLengthUnit.GetHashCode();
            ans ^= PropertyTagPrintFlags.GetHashCode();
            ans ^= PropertyTagPrintFlagsVersion.GetHashCode();
            ans ^= PropertyTagPrintFlagsCrop.GetHashCode();
            ans ^= PropertyTagPrintFlagsBleedWidth.GetHashCode();
            ans ^= PropertyTagPrintFlagsBleedWidthScale.GetHashCode();
            ans ^= PropertyTagHalftoneLPI.GetHashCode();
            ans ^= PropertyTagHalftoneLPIUnit.GetHashCode();
            ans ^= PropertyTagHalftoneDegree.GetHashCode();
            ans ^= PropertyTagHalftoneShape.GetHashCode();
            ans ^= PropertyTagHalftoneMisc.GetHashCode();
            ans ^= PropertyTagHalftoneScreen.GetHashCode();
            ans ^= PropertyTagJPEGQuality.GetHashCode();
            ans ^= PropertyTagGridSize.GetHashCode();
            ans ^= PropertyTagThumbnailFormat.GetHashCode();
            ans ^= PropertyTagThumbnailWidth.GetHashCode();
            ans ^= PropertyTagThumbnailHeight.GetHashCode();
            ans ^= PropertyTagThumbnailColorDepth.GetHashCode();
            ans ^= PropertyTagThumbnailPlanes.GetHashCode();
            ans ^= PropertyTagThumbnailRawBytes.GetHashCode();
            ans ^= PropertyTagThumbnailSize.GetHashCode();
            ans ^= PropertyTagThumbnailCompressedSize.GetHashCode();
            ans ^= PropertyTagColorTransferFunction.GetHashCode();
            ans ^= PropertyTagThumbnailData.GetHashCode();
            ans ^= PropertyTagThumbnailImageWidth.GetHashCode();
            ans ^= PropertyTagThumbnailImageHeight.GetHashCode();
            ans ^= PropertyTagThumbnailBitsPerSample.GetHashCode();
            ans ^= PropertyTagThumbnailCompression.GetHashCode();
            ans ^= PropertyTagThumbnailPhotometricInterp.GetHashCode();
            ans ^= PropertyTagThumbnailImageDescription.GetHashCode();
            ans ^= PropertyTagThumbnailEquipMake.GetHashCode();
            ans ^= PropertyTagThumbnailEquipModel.GetHashCode();
            ans ^= PropertyTagThumbnailStripOffsets.GetHashCode();
            ans ^= PropertyTagThumbnailOrientation.GetHashCode();
            ans ^= PropertyTagThumbnailSamplesPerPixel.GetHashCode();
            ans ^= PropertyTagThumbnailRowsPerStrip.GetHashCode();
            ans ^= PropertyTagThumbnailStripBytesCount.GetHashCode();
            ans ^= PropertyTagThumbnailResolutionX.GetHashCode();
            ans ^= PropertyTagThumbnailResolutionY.GetHashCode();
            ans ^= PropertyTagThumbnailPlanarConfig.GetHashCode();
            ans ^= PropertyTagThumbnailResolutionUnit.GetHashCode();
            ans ^= PropertyTagThumbnailTransferFunction.GetHashCode();
            ans ^= PropertyTagThumbnailSoftwareUsed.GetHashCode();
            ans ^= PropertyTagThumbnailDateTime.GetHashCode();
            ans ^= PropertyTagThumbnailArtist.GetHashCode();
            ans ^= PropertyTagThumbnailWhitePoint.GetHashCode();
            ans ^= PropertyTagThumbnailPrimaryChromaticities.GetHashCode();
            ans ^= PropertyTagThumbnailYCbCrCoefficients.GetHashCode();
            ans ^= PropertyTagThumbnailYCbCrSubsampling.GetHashCode();
            ans ^= PropertyTagThumbnailYCbCrPositioning.GetHashCode();
            ans ^= PropertyTagThumbnailRefBlackWhite.GetHashCode();
            ans ^= PropertyTagThumbnailCopyRight.GetHashCode();
            ans ^= PropertyTagLuminanceTable.GetHashCode();
            ans ^= PropertyTagChrominanceTable.GetHashCode();
            ans ^= PropertyTagFrameDelay.GetHashCode();
            ans ^= PropertyTagLoopCount.GetHashCode();
            ans ^= PropertyTagGlobalPalette.GetHashCode();
            ans ^= PropertyTagIndexBackground.GetHashCode();
            ans ^= PropertyTagIndexTransparent.GetHashCode();
            ans ^= PropertyTagPixelUnit.GetHashCode();
            ans ^= PropertyTagPixelPerUnitX.GetHashCode();
            ans ^= PropertyTagPixelPerUnitY.GetHashCode();
            ans ^= PropertyTagPaletteHistogram.GetHashCode();
            ans ^= PropertyTagCopyright.GetHashCode();
            ans ^= PropertyTagExifExposureTime.GetHashCode();
            ans ^= PropertyTagExifFNumber.GetHashCode();
            ans ^= PropertyTagExifIFD.GetHashCode();
            ans ^= PropertyTagICCProfile.GetHashCode();
            ans ^= PropertyTagExifExposureProg.GetHashCode();
            ans ^= PropertyTagExifSpectralSense.GetHashCode();
            ans ^= PropertyTagGpsIFD.GetHashCode();
            ans ^= PropertyTagExifISOSpeed.GetHashCode();
            ans ^= PropertyTagExifOECF.GetHashCode();
            ans ^= PropertyTagExifVer.GetHashCode();
            ans ^= PropertyTagExifDTOrig.GetHashCode();
            ans ^= PropertyTagExifDTDigitized.GetHashCode();
            ans ^= PropertyTagExifCompConfig.GetHashCode();
            ans ^= PropertyTagExifCompBPP.GetHashCode();
            ans ^= PropertyTagExifShutterSpeed.GetHashCode();
            ans ^= PropertyTagExifAperture.GetHashCode();
            ans ^= PropertyTagExifBrightness.GetHashCode();
            ans ^= PropertyTagExifExposureBias.GetHashCode();
            ans ^= PropertyTagExifMaxAperture.GetHashCode();
            ans ^= PropertyTagExifSubjectDist.GetHashCode();
            ans ^= PropertyTagExifMeteringMode.GetHashCode();
            ans ^= PropertyTagExifLightSource.GetHashCode();
            ans ^= PropertyTagExifFlash.GetHashCode();
            ans ^= PropertyTagExifFocalLength.GetHashCode();
            ans ^= PropertyTagExifMakerNote.GetHashCode();
            ans ^= PropertyTagExifUserComment.GetHashCode();
            ans ^= PropertyTagExifDTSubsec.GetHashCode();
            ans ^= PropertyTagExifDTOrigSS.GetHashCode();
            ans ^= PropertyTagExifDTDigSS.GetHashCode();
            ans ^= PropertyTagExifFPXVer.GetHashCode();
            ans ^= PropertyTagExifColorSpace.GetHashCode();
            ans ^= PropertyTagExifPixXDim.GetHashCode();
            ans ^= PropertyTagExifPixYDim.GetHashCode();
            ans ^= PropertyTagExifRelatedWav.GetHashCode();
            ans ^= PropertyTagExifInterop.GetHashCode();
            ans ^= PropertyTagExifFlashEnergy.GetHashCode();
            ans ^= PropertyTagExifSpatialFR.GetHashCode();
            ans ^= PropertyTagExifFocalXRes.GetHashCode();
            ans ^= PropertyTagExifFocalYRes.GetHashCode();
            ans ^= PropertyTagExifFocalResUnit.GetHashCode();
            ans ^= PropertyTagExifSubjectLoc.GetHashCode();
            ans ^= PropertyTagExifExposureIndex.GetHashCode();
            ans ^= PropertyTagExifSensingMethod.GetHashCode();
            ans ^= PropertyTagExifFileSource.GetHashCode();
            ans ^= PropertyTagExifSceneType.GetHashCode();
            ans ^= PropertyTagExifCfaPattern.GetHashCode();
            return(ans);
        }