apache-comnons系列之commons-imaging1.0 学习笔记

58 篇文章 0 订阅
53 篇文章 1 订阅

apache-comnons系列之commons-imaging1.0 学习笔记

概述

  • Imaging
    • The primary application programming interface (API) to the Imaging library.
  • ImageInfo
    • ImageInfo represents a collection of basic properties of an image, such as width, height, format, bit depth, etc.
  • ImageFormat
    • ImageFormats
    • BMP/GIF…
  • ImageParser
    • Provides the abstract base class for all image reading and writing utilities. ImageParser implementations are expected to extend this
    • class providing logic for identifying and processing data in their own specific format.
  • BmpImageParser

测试

  • org.apache.commons.imaging.ImagingTest
    • guessFormat
      • Attempts to determine the image format of a file based on its “magic numbers,” the first bytes of the data.
      • compareBytePair
      • MAGIC_NUMBERS_GIF = { 0x47, 0x49, };
    • getImageInfo(委托给具体类型图片解析器)
      • imageParser = getImageParser(byteSource);
      • imageInfo = imageParser.getImageInfo(byteSource, params);
    • getBufferedImage
      • Reads the first image from a byte array.
      • imageParser = getImageParser(byteSource);
      • imageParser = getImageParser(byteSource);
    • writeImage
      • Writes the content of a BufferedImage to an OutputStream using the specified image format. Specifications for storing the file (such as data compression,
      • color models, metadata tags, etc.) may be specified using an optional parameters map.
      • imageParser2.canAcceptType(format)
      • imageParser.writeImage(src, os, params);
  • org.apache.commons.imaging.examples.SampleUsage
    • 样例代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值