Bobby Bodenheimer CS 258 Introduction to Graphics Fall 2003 The Tiff Image Specification.

Slides:



Advertisements
Similar presentations
Cache Memory Exercises. Questions I Given: –memory is little-endian and byte addressable; memory size; –number of cache blocks, size of cache block –An.
Advertisements

Structure of a C program
Image File Format Only focused in TIFF-Tag Image File Format Grayscale 8 bit Purpose-interchange of digital image data Goals: Extensibility-capable to.
#include DatatypeDescription int8_t uint8_t int16_t uint16_t int32_t uint32_t Signed 8-bit integer Unsigned 8-bit integer Signed 16-bit integer Unsigned.
Representing Information as Bit Patterns Lecture 4 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
Physical, Logical, Conceptual DSA Lecture
Physical, Logical, Conceptual DSA Lecture
What is an instruction set?
CDA 3103 Computer Organization Review Instructor: Hao Zheng Dept. Comp. Sci & Eng. USF.
Java Bits CS Data versus Information Bits are just bits (no inherent meaning) -conventions define relationship between bits and numbers -given a.
Week 10 Project 3: An Introduction to File Systems
1 Real-World File Structures by Tom Davis Asst. Professor, Computer Science St. Edward's University 3001 South Congress Avenue Austin, Texas 78704
CMPT 454, Simon Fraser University, Fall 2009, Martin Ester 75 Database Systems II Record Organization.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
1 Project 3: An Introduction to File Systems CS3430 Operating Systems University of Northern Iowa.
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
C programming or Fun with pointers Tutorial #2 CPSC 261.
Working With Main Memory. Why Main Memory Register space limited Used for communication.
Lecture 8. MIPS Instructions #2 – Memory Access (Load/Store) Instructions Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer.
Bitwise Operators Fall 2008 Dr. David A. Gaitros
Byte Order Mohammad Kamal. Byte order Problem with byte order Numbers vs Data Practical example for reading data Exchanging Data between different systems.
Computer Architecture and Organization
Computer Architecture EKT 422
CS115 FALL Senem KUMOVA-METİN1 The Fundamental Data Types CHAPTER 3.
CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 Some Basics.
Big Endian vs. Little Endian Storage of Numeric Data Noah Mendelsohn Tufts University Web:
Ch Chapter 4 Basic Data Types and Variables 4.1 Basic Data Types In C TABLE 4.1 Introduction to Basic Data Types in C Type SizeDescription char 1.
Info stored in computer (memory) Numbers All in binaray – can be converted to octal, hex Characters ASCII – 1-byte/char Unicode – 2-byte/char Unicode-table.com/en.
Rolando V. RaqueñoSunday, December 20, Mystery Images.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
AES Encryption FIPS 197, November 26, Bit Block Encryption Key Lengths 128, 192, 256 Number of Rounds Key Length Rounds Block.
火雨辰 homeWork1.
IETF 55th Meeting, Atlanta, GA 1IFax WG, 20 Nov 2002 TIFF-FX Interop Testing Robert Buckley Co-author, TIFF-FX.
What is a program? A sequence of steps
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
MIPS Instruction Set Architecture Prof. Sirer CS 316 Cornell University.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – ARM Addressing Endianness, Loading, and Storing Data – Data Layout Struct Packing.
Address alignment When a word (4-bytes) is loaded or stored the memory address must be a multiple of four. This is called an alignment restriction. Addresses.
13/15/2016CS150 Introduction to Computer Science 1 Summary  Assignment due on Wednesday, October 29,  Tutor will be in the lab on Tuesday evening,
Byte Addressability Bytes are always 8 bits Word length typically ranges from 16 to 64 bits. Memory location assignments refer to successive byte locations.
Variables Bryce Boe 2012/09/05 CS32, Summer 2012 B.
Yingfang Zhang Department of Computer Science UCCS
Big-Endians Little-Endians and Bi-Endians
Data representation How do we represent data in a digital system?
Data in Memory variables have multiple attributes symbolic name
Memory, Data, & Addressing II CSE 351 Autumn 2017
Review Questions If the word size of a machine is 64-bits, which of the following is usually true? (pick all that apply) 64 bits is the size of a pointer.
Getting Image Data Image Data Files 11/15/2018
Digital Image Processing using MATLAB
Review Questions If the word size of a machine is 64-bits, which of the following is usually true? (pick all that apply) 64 bits is the size of a pointer.
Bits and Bytes Topics Representing information as bits
Bits and Bytes Topics Representing information as bits
Little Endian vs. Big Endian (Intel vs. Motorola)
Bits and Bytes Topics Representing information as bits
Memory, Data, & Addressing II CSE 351 Summer 2018
Project 3: An Introduction to File Systems
Pointers Lecture 2 Tue, Jan 24, 2006.
Memory, Data, & Addressing II CSE 351 Autumn 2018
GRAPHICAL DATA EXCHANGE FORMATS .jpg .gif .tif.
Data representation How do we represent data in a digital system?
CS150 Introduction to Computer Science 1
Memory, Data, & Addressing II CSE 351 Winter 2019
Homework Finishing Chapter 2 of K&R. We will go through Chapter 3 very quickly. Not a lot is new. Questions?
Real-World File Structures
Data representation How do we represent data in a digital system?
Presentation transcript:

Bobby Bodenheimer CS 258 Introduction to Graphics Fall 2003 The Tiff Image Specification

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 Big-Endian and Little-Endian Big-Endian: most significant byte to least significant byte both for 16-bit and 32-bit integers. This is the “normal” way we write numbers out. Little-Endian: least significant byte to most significant, again for both 16- and 32-bit integers.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 Some Sample Code void SwapShortBytes(unsigned short int * twobytes) { unsigned char * tmp = (unsigned char *)twobytes; unsigned int i; i = tmp[1]; tmp[1] = tmp[0]; tmp[0] = i; return; }

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 pooh.tif Color Image. 239 x 184 pixels.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [501] seville & od -A x -t x1 pooh.tif | more d 4d 00 2a fe ef b da e e e b a f0 01 1b a f8 01 1c b c ea bb d ea

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [501] seville & od -A x -t x1 pooh.tif | more d 4d 00 2a fe ef b da e e e b a f0 01 1b a f8 01 1c b c ea bb d ea Big-Endian or Little-Endian 4d4d = Big 4949 = Little

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [501] seville & od -A x -t x1 pooh.tif | more d 4d 00 2a fe ef b da e e e b a f0 01 1b a f8 01 1c b c ea bb d ea Magic Number = 42 (0x2a)

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [501] seville & od -A x -t x1 pooh.tif | more d 4d 00 2a fe ef b da e e e b a f0 01 1b a f8 01 1c b c ea bb d ea Address of the Image File Directory (IFD). Must begin on a WORD boundary

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [501] seville & od -A x -t x1 pooh.tif | more d 4d 00 2a fe ef b da e e e b a f0 01 1b a f8 01 1c b c ea bb d ea Address of the Image File Directory (IFD). Must begin on a WORD boundary

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [501] seville & od -A x -t x1 pooh.tif | more d 4d 00 2a fe ef b da e e e b a f0 01 1b a f8 01 1c b c ea bb d ea IFD – all data pertaining to the characteristics of the image.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 First two bytes: the count, that is, the number of entries in the IFD. Entries are sorted by TAG, in ascending numerical order.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 Next, the IFD Entries. Each is 12 Bytes long.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 Next, the IFD Entries. Each is 12 Bytes long. Bytes 0-1: The TAG that Identifies the field.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 Next, the IFD Entries. Each is 12 Bytes long. Bytes 0-1: The TAG that Identifies the field. Bytes 2-3: The Type of the field. Types: 1 = Byte (8 bit) 2 = Ascii (8 bit) 3 = Short (2 byte) 4 = Long (4 byte) 5 = Rational (2 Longs)

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 Next, the IFD Entries. Each is 12 Bytes long. Bytes 0-1: The TAG that Identifies the field. Bytes 2-3: The Type of the field. Bytes 4-7: The Count (no. of values) Types: 1 = Byte (8 bit) 2 = Ascii (8 bit) 3 = Short (2 byte) 4 = Long (4 byte) 5 = Rational (2 Longs)

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 Bytes 8-11: the Value Offset. The offset in bytes of the value for the field. Must begin on a word boundary. Can point anywhere in the file.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 Bytes 8-11: the Value Offset. The offset in bytes of the value for the field. Must begin on a word boundary. Can point anywhere in the file. If the Value fits into 4 bytes (i.e. is 1 byte and has count les than 5, is a short and has count less than 2, or is one long, etc.) THEN the Value will be stored in bytes 8-11, and will be left justified.

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 ImageWidth

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a f0 01 1b f8 01 1c 00000a b ea c bb ea d f 6f e 64 ImageLength

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e [503] seville & od -A x -t x1 -j 0xda pooh.tif | more f 6f e a fc a BitsPerSample

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 Tiff Image Data Organized into strips. Three fields govern this: RowsPerStrip, StripOffsets, and StripBytecounts. Strips per Image =

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 Tiff Image Data Each strip contains a number of rows of image data. Putting them all together gives you the image data for the image. RowPerStrip = How many rows for each strip StripOffsets = The location of each of the strips StripByteCounts = The number of bytes in each strip

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [502] seville & od -A x -t x1 -j 0x8 pooh.tif | more fe ef b da e e e b a [504] seville & od -A x -t x1 -j 0x32e pooh.tif | more bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb aa ee bb

CS 258 Introduction to Graphics Bobby Bodenheimer Fall 2003 [507] seville & od -A x -t x1 play2.tif | more a f a8 a3 8a 10 4b 0c a a 08 0a f 9f 9f 9f 9f f e 9e 9e 99 9f 9f 9f 86 9f 9f 9f 9f 9f [509] seville & od -A x -t x1 -j 0x40008 play2.tif b c Little Endian