Release Notes
Announcements
CIResponsiveTransformation * sTransform = [[CIResponsiveTransformation alloc]initWithView:imageView scaleType:ScaleTypeAUTOFit]
let sTransform = CIResponsiveTransformation(view: nil, scale: ScaleType.autoFit)
CITransformation * transform = [CITransformation new];
let transform = CITransformation();
// Scale to 50%[transform setZoomWithPercent:50 scaleType:ScalePercentTypeALL];// `scaleType` can be specified as the following types:// Scale the width without changing the heightScalePercentTypeOnlyWidth = 1,// Scale the height without changing the widthScalePercentTypeOnlyHeight,// Scale both the width and heightScalePercentTypeALL,
transform.setZoomWithPercent(50, scale: ScalePercentType.ALL)
// Specify both the width and height as 100 and the scaling type as `ScaleTypeAUTOFit` for proportional scaling[transform setZoomWithWidth:100 height:100 scaleType:ScaleTypeAUTOFit];// `scaleType` can be specified as the following types in case of scaling by fixed height and width:// Specify both the height and width. The output image may be distorted.ScaleTypeAUTOFill = 1,// Specify the maximum width and height of a thumbnail as `Width` and `Height` respectively for proportional scaling.ScaleTypeAUTOFit,// Specify the minimum width and height of a thumbnail as `Width` and `Height` respectively for proportional scaling.ScaleTypeAUTOFITWithMin,// Specify the target image width as `Width` and pass in `0` for the height to proportionally scale down the heightScaleTypeOnlyWidth,// Specify the target image height as `Height` and pass in `0` for the width to proportionally scale down the widthScaleTypeOnlyHeight
transform.setZoomWithWidth(10, height: 100, scaleType: ScaleType.autoFit)
// Scale an image so that the total number of its pixels does not exceed 1,000[transform setZoomWithArea:1000];
transform.setZoomWithArea(1000)
// Perform cropping based on the specified target width, height, and horizontal offset and vertical offset relative to the upper-left vertex of the output image[transform setCutWithWidth:100 height:100 dx:30 dy:30];
transform.setCutWithWidth(100, height: 100, dx: 30, dy: 30)
radius specifies the radius of the inscribed circle, which should be an integer greater than zero and less than half of the shorter side of the input image. The center of the inscribed circle is the center of the image. This parameter is not supported for GIF images.
Objective-C// Set the radius to 100.[transform setCutWithIRadius:100];
transform.setCutWithIRadius(100)
radius specifies the radius of the rounded corner of the image, which should be an integer greater than zero and less than half of the shorter side of the input image. The two sides of the image are the tangent lines of the rounded corner. This parameter is not supported for GIF images.
Objective-C// Set the corner radius to 100.[transform setCutWithRRadius:100];
transform.setCutWithRRadius(100)
// Specify the width and height for scaling and cropping and change nothing in case of `0`[transform setCutWithCrop:100 height:100];// Specify width, height, and gravity for scaling and cropping[transform setCutWithCrop:100 height:100 gravity:CIGravityCenter];
transform.setCutWithCrop(100, height: 100)transform.setCutWithCrop(100, height: 100, gravity: CloudInfiniteGravity.CIGravityCenter);
Width and Height respectively.// Crop the face from the image and scale both the width and height to 100.[transform setCutWithScrop:100 height:100];
transform.setCutWithScrop(100, height: 100)
// Rotate the image by 45 degrees.[transform setRotateWith:45];
transform.setRotateWith(45)
[transform setRotateAutoOrient];
transform.setRotateAutoOrient()
// Convert an image into JPG.[transform setFormatWith:CIImageTypeJPG];// Specify input parameters:[transform setFormatWith:CIImageTypeTPG options:CILoadTypeUrlFooter];
transform.setFormatWith(CIImageFormat.typeJPG);transform.setFormatWith(CIImageFormat.typeJPG, options: CILoadTypeEnum.urlFooter);
// Loading type option 1: Include the accept header accept:image/ ***CILoadTypeAcceptHeader = 0,// Loading type option 2: Add imageMogr2/format/ *** after the URL// If option 2 is needed, use this value. If this parameter is not specified, option 1 will be used by default.CILoadTypeUrlFooter,
CILoadTypeAcceptHeader and have specified other image processing rules, the header will not take effect. Instead, the SDK will use footer automatically.CloudInfinite/TPG module.CloudInfinite/AVIF module.SDWebImageWebPCoder library.pod 'CloudInfinite/TPG'
pod 'CloudInfinite/AVIF'
FrameNumber=1: Cuts the input GIF to the default number of frames (30). If the original number of frames is greater than 30, the exceeded frames will be cut.FrameNumber=(1,100]: Compresses the image to the specified number of frames (`FrameNumber`).
[transform setCgif:50];
transform.setCgif(50)
Mode can be 0 or 1. 0 (default value): Disables the progressive mode; 1: Enables the progressive mode. This parameter takes effect only when the output image is in JPG format.[transform setInterlace:YES];
transform.setInterlace(true)
// Change the absolute quality of the image to 60// `type` is the change type as detailed below:[transform setQualityWithQuality:60 type:CIQualityChangeAbsolute];
transform.setQualityWithQuality(60, type: CIQualityChangeEnum.absolute)
// The absolute quality of the image. The value can be 0–100. The default value is the original image quality.CIQualityChangeAbsolute = 1,// The absolute quality of the image. The value can be 0–100. The specified quality value is forcibly used, such as `90!`.CIQualityChangeAbsoluteFix,// The image quality relative to that of the input image. The value can be 0−100. For example, if the input image quality is 80 and `rquality` is set to `80`, the quality of the output image will be 64 (80 * 80%).CIQualityChangeRelative,// Set the lowest quality of the output image. Value range: 0−100.// If the input image quality is 85 and `lquality` is set to 80, the quality of the output image is 85.// If the input image quality is 60 and `lquality` is set to 80, the quality of the output image will be improved to 80.CIQualityChangeLowest,
// Set the blur radius to 20 and the standard deviation of the normal distribution to 20.[transform setBlurRadius:20 sigma:20];
transform.setBlurRadius(20, sigma: 20)
// Set the sharpening value to 100.[transform setSharpenWith:100];
transform.setSharpenWith(100)
// imageUrl: Watermark image address.// gravity: Position of the text watermark in the 3x3 grid position diagram. Default value: `SouthEast`.// dx: Horizontal offset in px. Default value: `0`.// dy: Vertical offset in px. Default value: `0`.// blogo: Adaptation mode for an image watermark that is larger than the input image. Valid values:/// `1`: Scales the image watermark to the size of the input image./// `2`: Crops the image watermark to the size of the input image.[tran setWaterMarkWithImageUrl:@"http://tpg-1253653367.cos.ap-guangzhou.myqcloud.com/google.jpg" gravity:0 dx:0 dy:0 blogo:0];
transform.setWaterMarkWithImageUrl("", gravity: CloudInfiniteGravity.CIGravityCenter, dx: 0, dy: 0, blogo: CIWaterImageMarkBlogoEnum.none)
// text: Watermark content// font: Watermark font// color: Font color. Default value: #3D3D3D.// dissolve: Text opacity. Value range: 1−100. Default value: `90`.// gravity: Position of the text watermark. Default value: `SouthEast`.// dx: Horizontal offset in px. Default value: `0`.// dy: Vertical offset in px. Default value: `0`.// batch: Whether to tile the text watermark. If this parameter is set to `1`, the text watermark will be tiled across the input image.// degree: The angle to rotate the text watermark. Value range: 0−360. Default value: `0`[transform setWaterMarkText:@"Tencent Cloud CI" font:nil textColor:nil dissolve:90 gravity:CIGravitySouth dx:100 dy:100 batch:YES degree:45];
transform.setWaterMarkText("Tencent Cloud CI", font: nil, textColor: nil, dissolve: 90, gravity: CloudInfiniteGravity.CIGravityCenter, dx: 100, dy: 100, batch: true, degree: 45)
imageAve API to obtain the average hue of an image. For more information on the API, see Obtaining Image's Average Hue.[transform setViewBackgroudColorWithImageAveColor:YES]
transform.setViewBackgroudColorWithImageAveColor(true)
imageMogr2 API to remove image metadata, including the EXIF data. For the API documentation, see Removing Image Metadata.[transform setImageStrip];
transform.setImageStrip()
CITransformation * tran = [CITransformation new];// ***************Scaling*************// Scale to 50%[transform setZoomWithPercent:50 scaleType:ScalePercentTypeALL];// **Format conversion // Convert to TPG format [tran setFormatWith:CIImageTypeTPG]; // **Cropping // Crop the image. Width and height: 100; top left and left: 30 30 [tran setCutWithWidth:100 height:100 dx:30 dy:30];
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan