code
stringlengths
10
1.34M
language
stringclasses
1 value
// 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. // Netlink sockets and messages package syscall import ( "unsafe" ) // Round the length of a netlink message up to align it properly. func nlmAlignOf(msgle...
Go
// Copyright 2009 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 syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
Go
// Copyright 2009 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. /* Input to cgo -godefs. See also mkerrors.sh and mkall.sh */ // +build ignore // +godefs map struct_in_addr [4]byte /* in_addr */ // +godefs map struct_in6_...
Go
// Copyright 2009 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 syscall //sys Chown(path string, uid int, gid int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (er...
Go
// Copyright 2010 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 syscall const ARCH = "amd64"
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd package syscall import ( "sync" "unsafe" ) var ( Stdin = 0 Stdout = 1 Stderr = 2 ) const darwinAMD64 = OS == "d...
Go
// Copyright 2009 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. // +build darwin freebsd openbsd // BSD system call wrappers shared by *BSD based systems // including OS X (Darwin) and FreeBSD. Like the other // syscall_*....
Go
// Copyright 2009 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 syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
Go
// Copyright 2009 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 syscall contains an interface to the low-level operating system // primitives. The details vary depending on the underlying system. // Its primary u...
Go
// 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. // Routing sockets and messages for OpenBSD package syscall import ( "unsafe" ) func (any *anyMessage) toRoutingMessage(buf []byte) RoutingMessage { switc...
Go
// nothing to see here package syscall
Go
// 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. // Routing sockets and messages for FreeBSD package syscall import ( "unsafe" ) func (any *anyMessage) toRoutingMessage(buf []byte) RoutingMessage { switc...
Go
// 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. // Socket control messages package syscall import ( "unsafe" ) // UnixCredentials encodes credentials into a socket control message // for sending to anoth...
Go
// 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. // Plan 9 environment variables. package syscall import "errors" func Getenv(key string) (value string, found bool) { if len(key) == 0 { return "", false...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd // Fork, exec, wait, etc. package syscall import ( "sync" "unsafe" ) // Lock synchronizing creation of new file des...
Go
// hand generated package syscall const ( SYS_SYSCALL_BASE = 0 SYS_RESTART_SYSCALL = (SYS_SYSCALL_BASE + 0) SYS_EXIT = (SYS_SYSCALL_BASE + 1) SYS_FORK = (SYS_SYSCALL_BASE + 2) SYS_READ = (SYS_SYSCALL_BASE + 3) SYS_WRITE = (SYS_SYSCAL...
Go
// 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. // Plan 9 system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system...
Go
// Copyright 2009,2010 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. // FreeBSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates ...
Go
// Copyright 2009 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. // Fork, exec, wait, etc. package syscall import ( "sync" "unicode/utf16" "unsafe" ) var ForkLock sync.RWMutex // EscapeArg rewrites command line argumen...
Go
// Copyright 2009 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. /* Input to cgo -godefs. See also mkerrors.sh and mkall.sh */ // +build ignore // +godefs map struct_in_addr [4]byte /* in_addr */ // +godefs map struct_in6_...
Go
// 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. // Linux socket filter package syscall import ( "unsafe" ) func LsfStmt(code, k int) *SockFilter { return &SockFilter{Code: uint16(code), K: uint32(k)} } ...
Go
// Copyright 2009 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 syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
Go
// Copyright 2010 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. // Windows environment variables. package syscall import ( "unicode/utf16" "unsafe" ) func Getenv(key string) (value string, found bool) { b := make([]ui...
Go
// 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 syscall type WSAData struct { Version uint16 HighVersion uint16 Description [WSADESCRIPTION_LEN + 1]byte SystemStatus [WSASYS_STATUS_LEN + ...
Go
// Copyright 2009 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 syscall func itoa(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + itoa(-val) } var buf [32]byte...
Go
// 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 syscall // Constants const ( // Invented values to support what package os expects. O_CREAT = 0x02000 O_APPEND = 0x00400 O_NOCTTY = 0x00000...
Go
// Copyright 2009 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 syscall import "unsafe" func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ...
Go
// Copyright 2009 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 syscall
Go
// Copyright 2009 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 syscall
Go
// Copyright 2009 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 syscall
Go
// Copyright 2009,2010 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. // OpenBSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates ...
Go
// 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. // Routing sockets and messages for Darwin package syscall import ( "unsafe" ) func (any *anyMessage) toRoutingMessage(buf []byte) RoutingMessage { switch...
Go
// 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 syscall import ( "sync" ) // DLLError describes reasons for DLL load failures. type DLLError struct { Err error ObjName string Msg string...
Go
// Copyright 2009 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 syscall import "unsafe" func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ...
Go
// Copyright 2009 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. /* Input to cgo -godefs. See also mkerrors.sh and mkall.sh */ // +build ignore // +godefs map struct_in_addr [4]byte /* in_addr */ // +godefs map struct_in6_...
Go
// 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 syscall type WSAData struct { Version uint16 HighVersion uint16 MaxSockets uint16 MaxUdpDg uint16 VendorInfo *byte Description [W...
Go
// nothing to see here package syscall
Go
// Copyright 2009 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 syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
Go
// 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. // +build darwin freebsd openbsd // Routing sockets and messages package syscall import ( "unsafe" ) // Round the length of a raw sockaddr up to align it ...
Go
// Copyright 2010 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. // +build darwin freebsd linux openbsd // Unix environment variables. package syscall import "sync" var env map[string]string var envOnce sync.Once var env...
Go
// Copyright 2010 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 syscall const ARCH = "386"
Go
// 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 syscall
Go
// Copyright 2009 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. // Windows system calls. package syscall import ( "unicode/utf16" "unsafe" ) const OS = "windows" type Handle uintptr const InvalidHandle = ^Handle(0) ...
Go
// Copyright 2009 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 os import ( "syscall" "time" ) func sameFile(fs1, fs2 *FileStat) bool { sys1 := fs1.Sys.(*syscall.Stat_t) sys2 := fs2.Sys.(*syscall.Stat_t) retur...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd windows package os import ( "syscall" "time" ) func sigpipe() // implemented in package runtime func epipecheck(fil...
Go
// Copyright 2009 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 os import ( "runtime" "syscall" ) // Process stores the information about a process created by StartProcess. type Process struct { Pid int hand...
Go
// Copyright 2009 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 os import ( "errors" "runtime" "syscall" ) // StartProcess starts a new process with the program, arguments and attributes // specified by name, ar...
Go
// Copyright 2009 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 os import "syscall" // Time returns the current time, in whole seconds and // fractional nanoseconds, plus an error if any. The current // time is thu...
Go
// Copyright 2009 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 os import "io" // MkdirAll creates a directory named path, // along with any necessary parents, and returns nil, // or else returns an error. // The p...
Go
// Copyright 2009 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. // Process etc. package os import "syscall" // Args hold the command-line arguments, starting with the program name. var Args []string // Getuid returns the...
Go
// 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 os import "syscall" func fileInfoFromStat(fi *FileInfo, d *Dir) *FileInfo { fi.Dev = uint64(d.Qid.Vers) | uint64(d.Qid.Type<<32) fi.Ino = d.Qid.Path...
Go
// Copyright 2009 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 os import ( "syscall" "time" ) func sameFile(fs1, fs2 *FileStat) bool { sys1 := fs1.Sys.(*syscall.Stat_t) sys2 := fs2.Sys.(*syscall.Stat_t) retur...
Go
// 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 os import ( "runtime" "syscall" ) // File represents an open file descriptor. type File struct { *file } // file is the real representation of *Fi...
Go
// Copyright 2009 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. // Linux-specific package os // Hostname returns the host name reported by the kernel. func Hostname() (name string, err error) { f, err := Open("/proc/sys/k...
Go
// 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. // +build darwin freebsd linux package user import ( "fmt" "runtime" "strings" "syscall" "unsafe" ) /* #include <unistd.h> #include <sys/types.h> #inclu...
Go
// 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. // +build openbsd plan9 windows package user import ( "fmt" "runtime" ) func Lookup(username string) (*User, error) { return nil, fmt.Errorf("user: Lookup...
Go
// 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 user allows user account lookups by name or id. package user import ( "strconv" ) var implemented = false // set to true by lookup_unix.go's init ...
Go
// Copyright 2009 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 os func (file *File) Readdirnames(n int) (names []string, err error) { fis, err := file.Readdir(n) names = make([]string, len(fis)) for i, fi := ran...
Go
// Copyright 2009 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 os import ( "syscall" "time" ) // Getpagesize returns the underlying system's memory page size. func Getpagesize() int { return syscall.Getpagesize(...
Go
// Copyright 2009 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 os import ( "syscall" "time" "unsafe" ) // Stat returns the FileInfo structure describing file. // It returns the FileInfo and an error, if any. fu...
Go
// Copyright 2009 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 os import ( "syscall" "time" ) func sameFile(fs1, fs2 *FileStat) bool { sys1 := fs1.Sys.(*syscall.Stat_t) sys2 := fs2.Sys.(*syscall.Stat_t) retur...
Go
// 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. // Plan 9-specific package os func Hostname() (name string, err error) { f, err := Open("#c/sysname") if err != nil { return "", err } defer f.Close() ...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd package os import ( "runtime" "syscall" ) // File represents an open file descriptor. type File struct { *file } /...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd package os import ( "errors" "runtime" "syscall" ) // Options for Wait. const ( WNOHANG = syscall.WNOHANG // D...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd windows package os import ( "runtime" "syscall" ) type UnixSignal int32 func (sig UnixSignal) String() string { s ...
Go
// Copyright 2010 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. // General environment variables. package os import ( "errors" "syscall" ) // Expand replaces ${var} or $var in the string based on the mapping function. ...
Go
// Copyright 2009 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 os // PathError records an error and the operation and file path that caused it. type PathError struct { Op string Path string Err error } func ...
Go
// Copyright 2009 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 signal implements operating system-independent signal handling. package signal import ( "os" "runtime" ) // Incoming is the global signal channel...
Go
// Copyright 2009 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 os import ( "errors" "runtime" "syscall" "unsafe" ) func (p *Process) Wait(options int) (w *Waitmsg, err error) { s, e := syscall.WaitForSingleOb...
Go
// Copyright 2009 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 os import ( "errors" "io" "syscall" ) // Readdir reads the contents of the directory associated with file and // returns an array of up to n FileIn...
Go
// Copyright 2009 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 os provides a platform-independent interface to operating system // functionality. The design is Unix-like. // The os interface is intended to be un...
Go
// Copyright 2009 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. // +build plan9 package os func itoa(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + itoa(-val) } var ...
Go
// 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. // +build darwin freebsd linux openbsd package os const ( PathSeparator = '/' // OS-specific path separator PathListSeparator = ':' // OS-specific path ...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd windows package os import syscall "syscall" // Commonly known Unix errors. var ( EPERM error = syscall.EPERM ...
Go
// 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 os import ( "errors" "syscall" ) // SyscallError records an error from a specific system call. type SyscallError struct { Syscall string Err s...
Go
// Copyright 2009 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. // +build darwin freebsd linux openbsd package os import ( "io" "syscall" ) const ( blockSize = 4096 ) // Readdirnames reads and returns a slice of names...
Go
// Copyright 2009 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. // +build darwin freebsd openbsd // os code shared between *BSD systems including OS X (Darwin) // and FreeBSD. package os import "syscall" func Hostname() ...
Go
// Copyright 2009 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 os import ( "syscall" "time" ) func sameFile(fs1, fs2 *FileStat) bool { sys1 := fs1.Sys.(*syscall.Stat_t) sys2 := fs2.Sys.(*syscall.Stat_t) retur...
Go
// Copyright 2009 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 os import ( "syscall" ) // Getwd returns a rooted path name corresponding to the // current directory. If the current directory can be // reached vi...
Go
// Copyright 2009 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 exec runs external commands. It wraps os.StartProcess to make it // easier to remap stdin and stdout, connect I/O with pipes, and do other // adjustm...
Go
// Copyright 2010 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 exec import ( "errors" "os" "strings" ) // ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound ...
Go
// 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 exec import ( "errors" "os" "strings" ) // ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound ...
Go
// Copyright 2010 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. // +build darwin freebsd linux openbsd package exec import ( "errors" "os" "strings" ) // ErrNotFound is the error resulting if a path search failed to f...
Go
// 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 os const ( PathSeparator = '/' // OS-specific path separator PathListSeparator = 0 // OS-specific path list separator ) // IsPathSeparator ret...
Go
// Copyright 2009 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 os import "syscall" func Hostname() (name string, err error) { s, e := syscall.ComputerName() if e != nil { return "", NewSyscallError("ComputerN...
Go
// 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 os const ( PathSeparator = '\\' // OS-specific path separator PathListSeparator = ';' // OS-specific path list separator ) // IsPathSeparator r...
Go
// Copyright 2009 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 os import ( "io" "runtime" "sync" "syscall" "unicode/utf16" ) // File represents an open file descriptor. type File struct { *file } // file is...
Go
// 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 ycbcr provides images from the Y'CbCr color model. // // JPEG, VP8, the MPEG family and other codecs use this color model. Such // codecs often use t...
Go
// Copyright 2009 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 png import ( "bufio" "compress/zlib" "hash/crc32" "image" "image/color" "io" "strconv" ) type encoder struct { w io.Writer m image....
Go
// Copyright 2009 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 png implements a PNG image decoder and encoder. // // The PNG specification is at http://www.w3.org/TR/PNG/. package png import ( "compress/zlib" ...
Go
// 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 color implements a basic color library. package color // Color can convert itself to alpha-premultiplied 16-bits per channel RGBA. // The conversion...
Go
// Copyright 2009 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 draw provides image composition functions. // // See "The Go image/draw package" for an introduction to this package: // http://blog.golang.org/2011...
Go
// Copyright 2010 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 image import ( "bufio" "errors" "io" ) // An UnknownFormatErr indicates that decoding encountered an unknown format. var UnknownFormatErr = errors....
Go
// Copyright 2010 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 image import ( "strconv" ) // A Point is an X, Y coordinate pair. The axes increase right and down. type Point struct { X, Y int } // String return...
Go
// Copyright 2010 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 image import ( "image/color" ) var ( // Black is an opaque black uniform image. Black = NewUniform(color.Black) // White is an opaque white unifor...
Go
// 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 gif implements a GIF image decoder. // // The GIF specification is at http://www.w3.org/Graphics/GIF/spec-gif89a.txt. package gif import ( "bufio" ...
Go
// Copyright 2009 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 image implements a basic 2-D image library. // // See "The Go image package" for an introduction to this package: // http://blog.golang.org/2011/09/g...
Go
// 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 bmp implements a BMP image decoder. // // The BMP specification is at http://www.digicamsoft.com/bmp/bmp.html. package bmp import ( "errors" "imag...
Go
// Copyright 2009 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 jpeg import "io" // Each code is at most 16 bits long. const maxCodeLength = 16 // Each decoded value is a uint8, so there are at most 256 such value...
Go
// 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 jpeg import ( "bufio" "errors" "image" "image/ycbcr" "io" ) // min returns the minimum of two integers. func min(x, y int) int { if x < y { re...
Go