Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(298)

Delta Between Two Patch Sets: tiff/consts.go

Issue 6866051: code review 6866051: tiff: support for writing compressed images. (Closed)
Left Patch Set: diff -r a0de9da0017e https://code.google.com/p/go.image Created 11 years, 3 months ago
Right Patch Set: diff -r a0de9da0017e https://code.google.com/p/go.image Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | tiff/writer.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package tiff 5 package tiff
6 6
7 // A tiff image file contains one or more images. The metadata 7 // A tiff image file contains one or more images. The metadata
8 // of each image is contained in an Image File Directory (IFD), 8 // of each image is contained in an Image File Directory (IFD),
9 // which contains entries of 12 bytes each and is described 9 // which contains entries of 12 bytes each and is described
10 // on page 14-16 of the specification. An IFD entry consists of 10 // on page 14-16 of the specification. An IFD entry consists of
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 mRGB 107 mRGB
108 mRGBA 108 mRGBA
109 mNRGBA 109 mNRGBA
110 ) 110 )
111 111
112 // CompressionType describes the type of compression used in Options. 112 // CompressionType describes the type of compression used in Options.
113 type CompressionType int 113 type CompressionType int
114 114
115 const ( 115 const (
116 Uncompressed CompressionType = iota 116 Uncompressed CompressionType = iota
117 PackBits
118 Deflate 117 Deflate
119 ) 118 )
120
121 // compressionEq holds the equivalence table between CompressionType and
122 // the values of the TIFF spec.
123 var compressionEq = []struct {
124 a CompressionType
125 b uint32
126 }{
127 {Uncompressed, cNone},
128 {PackBits, cPackBits},
129 {Deflate, cDeflate},
130 }
131 119
132 // specValue returns the compression type constant from the TIFF spec that 120 // specValue returns the compression type constant from the TIFF spec that
133 // is equivalent to c. 121 // is equivalent to c.
134 func (c CompressionType) specValue() uint32 { 122 func (c CompressionType) specValue() uint32 {
135 » for _, v := range compressionEq { 123 » switch c {
136 » » if v.a == c { 124 » case Deflate:
137 » » » return v.b 125 » » return cDeflate
138 » » }
139 } 126 }
140 return cNone 127 return cNone
141 } 128 }
LEFTRIGHT
« no previous file | tiff/writer.go » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b