Source File
consts.go
Belonging Package
golang.org/x/image/tiff
// Copyright 2011 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package tiff// A tiff image file contains one or more images. The metadata// of each image is contained in an Image File Directory (IFD),// which contains entries of 12 bytes each and is described// on page 14-16 of the specification. An IFD entry consists of//// - a tag, which describes the signification of the entry,// - the data type and length of the entry,// - the data itself or a pointer to it if it is more than 4 bytes.//// The presence of a length means that each IFD is effectively an array.const (leHeader = "II\x2A\x00" // Header for little-endian files.beHeader = "MM\x00\x2A" // Header for big-endian files.ifdLen = 12 // Length of an IFD entry in bytes.)// Data types (p. 14-16 of the spec).const (dtByte = 1dtASCII = 2dtShort = 3dtLong = 4dtRational = 5)// The length of one instance of each data type in bytes.var lengths = [...]uint32{0, 1, 1, 2, 4, 8}// Tags (see p. 28-41 of the spec).const (tImageWidth = 256tImageLength = 257tBitsPerSample = 258tCompression = 259tPhotometricInterpretation = 262tFillOrder = 266tStripOffsets = 273tSamplesPerPixel = 277tRowsPerStrip = 278tStripByteCounts = 279tT4Options = 292 // CCITT Group 3 options, a set of 32 flag bits.tT6Options = 293 // CCITT Group 4 options, a set of 32 flag bits.tTileWidth = 322tTileLength = 323tTileOffsets = 324tTileByteCounts = 325tXResolution = 282tYResolution = 283tResolutionUnit = 296tPredictor = 317tColorMap = 320tExtraSamples = 338tSampleFormat = 339)// Compression types (defined in various places in the spec and supplements).const (cNone = 1cCCITT = 2cG3 = 3 // Group 3 Fax.cG4 = 4 // Group 4 Fax.cLZW = 5cJPEGOld = 6 // Superseded by cJPEG.cJPEG = 7cDeflate = 8 // zlib compression.cPackBits = 32773cDeflateOld = 32946 // Superseded by cDeflate.)// Photometric interpretation values (see p. 37 of the spec).const (pWhiteIsZero = 0pBlackIsZero = 1pRGB = 2pPaletted = 3pTransMask = 4 // transparency maskpCMYK = 5pYCbCr = 6pCIELab = 8)// Values for the tPredictor tag (page 64-65 of the spec).const (prNone = 1prHorizontal = 2)// Values for the tResolutionUnit tag (page 18).const (resNone = 1resPerInch = 2 // Dots per inch.resPerCM = 3 // Dots per centimeter.)// imageMode represents the mode of the image.type imageMode intconst (mBilevel imageMode = iotamPalettedmGraymGrayInvertmRGBmRGBAmNRGBAmCMYK)// CompressionType describes the type of compression used in Options.type CompressionType int// Constants for supported compression types.const (Uncompressed CompressionType = iotaDeflateLZWCCITTGroup3CCITTGroup4)// specValue returns the compression type constant from the TIFF spec that// is equivalent to c.func ( CompressionType) () uint32 {switch {case LZW:return cLZWcase Deflate:return cDeflatecase CCITTGroup3:return cG3case CCITTGroup4:return cG4}return cNone}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |