Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccIO.cpp
Go to the documentation of this file.
1/** @file
2 File: IccIO.cpp
3
4 Contains: Implementation of the CIccIO class.
5
6 Version: V1
7
8 Copyright: (c) see ICC Software License
9*/
10
11/*
12 * The ICC Software License, Version 0.2
13 *
14 *
15 * Copyright (c) 2003-2012 The International Color Consortium. All rights
16 * reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 *
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 *
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in
27 * the documentation and/or other materials provided with the
28 * distribution.
29 *
30 * 3. In the absence of prior written permission, the names "ICC" and "The
31 * International Color Consortium" must not be used to imply that the
32 * ICC organization endorses or promotes products derived from this
33 * software.
34 *
35 *
36 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39 * DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COLOR CONSORTIUM OR
40 * ITS CONTRIBUTING MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * SUCH DAMAGE.
48 * ====================================================================
49 *
50 * This software consists of voluntary contributions made by many
51 * individuals on behalf of the The International Color Consortium.
52 *
53 *
54 * Membership in the ICC is encouraged when this software is used for
55 * commercial purposes.
56 *
57 *
58 * For more information on The International Color Consortium, please
59 * see <http://www.color.org/>.
60 *
61 *
62 */
63
64//////////////////////////////////////////////////////////////////////
65// HISTORY:
66//
67// -Initial implementation by Max Derhak 5-15-2003
68//
69//////////////////////////////////////////////////////////////////////
70
71#include "IccIO.h"
72#include "IccUtil.h"
73#include <stdlib.h>
74#include <memory.h>
75#include <string.h>
76
77#ifndef __max
78#define __max(a,b) (((a) > (b)) ? (a) : (b))
79#endif
80#ifndef __min
81#define __min(a,b) (((a) < (b)) ? (a) : (b))
82#endif
83
84#ifdef USEREFICCMAXNAMESPACE
85namespace refIccMAX {
86#endif
87
88//////////////////////////////////////////////////////////////////////
89// Class CIccIO
90//////////////////////////////////////////////////////////////////////
91
92
94{
95 icInt32Number n=0;
96 icInt8Number c, *ptr=(icInt8Number*)pBuf8;
97
98 while(n<nNum) {
99 if (!Read8(&c)) {
100 break;
101 }
102 if (c=='\n') {
103 break;
104 }
105 else if (c!='\r') {
106 *ptr++ = c;
107 n++;
108 }
109 }
110 *ptr = '\0';
111 return n;
112}
113
115{
116 nNum = Read8(pBuf16, nNum<<1)>>1;
117 icSwab16Array(pBuf16, nNum);
118
119 return nNum;
120}
121
123{
124#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
125 return Write8(pBuf16, nNum<<1)>>1;
126#else
127 icUInt16Number *ptr = (icUInt16Number*)pBuf16;
128 icUInt16Number tmp;
130
131 for (i=0; i<nNum; i++) {
132 tmp = *ptr;
133 icSwab16(tmp);
134 if (Write8(&tmp, 2)!=2)
135 break;
136 ptr++;
137 }
138
139 return i;
140#endif
141}
142
144{
145 nNum = Read8(pBuf32, nNum<<2)>>2;
146 icSwab32Array(pBuf32, nNum);
147
148 return nNum;
149}
150
151
153{
154#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
155 return Write8(pBuf32, nNum<<2)>>2;
156#else
157 icUInt32Number *ptr = (icUInt32Number*)pBuf32;
158 icUInt32Number tmp;
160
161 for (i=0; i<nNum; i++) {
162 tmp = *ptr;
163 icSwab32(tmp);
164 if (Write8(&tmp, 4)!=4)
165 break;
166 ptr++;
167 }
168
169 return i;
170#endif
171}
172
174{
175 nNum = Read8(pBuf64, nNum<<3)>>3;
176 icSwab64Array(pBuf64, nNum);
177
178 return nNum;
179}
180
181
183{
184#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
185 return Write8(pBuf64, nNum<<3)>>3;
186#else
187 icUInt64Number *ptr = (icUInt64Number*)pBuf64;
188 icUInt64Number tmp;
190
191 for (i=0; i<nNum; i++) {
192 tmp = *ptr;
193 icSwab64(tmp);
194 if (Write8(&tmp, 8)!=8)
195 break;
196 ptr++;
197 }
198
199 return i;
200#endif
201}
202
204{
205 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
206 icUInt8Number tmp;
208
209 for (i=0; i<nNum; i++) {
210 if (Read8(&tmp, 1)!=1)
211 break;
212 *ptr = (icFloatNumber)((icFloatNumber)tmp / 255.0);
213 ptr++;
214 }
215
216 return i;
217}
218
220{
221 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
222 icUInt8Number tmp;
224
225 for (i=0; i<nNum; i++) {
226 tmp = (icUInt8Number)(__max(0.0, __min(1.0, *ptr)) * 255.0 + 0.5);
227
228 if (Write8(&tmp, 1)!=1)
229 break;
230 ptr++;
231 }
232
233 return i;
234}
235
237{
238 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
239 icUInt16Number tmp;
241
242 for (i=0; i<nNum; i++) {
243 if (Read16(&tmp, 1)!=1)
244 break;
245 *ptr = (icFloatNumber)((icFloatNumber)tmp / 65535.0);
246 ptr++;
247 }
248
249 return i;
250}
251
253{
254 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
255 icUInt16Number tmp;
257
258 for (i=0; i<nNum; i++) {
259 tmp = (icUInt16Number)(__max(0.0, __min(1.0, *ptr)) * 65535.0 + 0.5);
260
261 if (Write16(&tmp, 1)!=1)
262 break;
263 ptr++;
264 }
265
266 return i;
267}
268
270{
271 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
272 icFloat16Number tmp;
274
275 for (i=0; i<nNum; i++) {
276 if (Read16(&tmp, 1)!=1)
277 break;
278 *ptr = icF16toF(tmp);
279 ptr++;
280 }
281
282 return i;
283}
284
286{
287 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
288 icUInt16Number tmp;
290
291 for (i=0; i<nNum; i++) {
292 tmp = icFtoF16(*ptr);
293
294 if (Write16(&tmp, 1)!=1)
295 break;
296 ptr++;
297 }
298
299 return i;
300}
301
303{
304 if (sizeof(icFloat32Number)==sizeof(icFloatNumber))
305 return Read32(pBufFloat, nNum);
306
307 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
308 icFloat32Number tmp;
310
311 for (i=0; i<nNum; i++) {
312 if (Read32(&tmp, 1)!=1)
313 break;
314 *ptr = (icFloatNumber)tmp;
315 ptr++;
316 }
317
318 return i;
319}
320
322{
323 if (sizeof(icFloat32Number)==sizeof(icFloatNumber))
324 return Write32(pBufFloat, nNum);
325
326 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
327 icFloat32Number tmp;
329
330 for (i=0; i<nNum; i++) {
331 tmp = (icFloat32Number)*ptr;
332
333 if (Write32(&tmp, 1)!=1)
334 break;
335 ptr++;
336 }
337
338 return i;
339}
340
342{
343 int mod = GetLength() % 4;
344 if (mod != 0) {
345 icUInt8Number buf[4]={0,0,0,0};
346 if (Seek(0, icSeekEnd)<0)
347 return false;
348
349 if (Write8(buf, 4-mod) != 4-mod)
350 return false;
351 }
352
353 return true;
354
355}
356
358{
359 nOffset &= 0x3;
360
361 icUInt32Number nPos = ((Tell() - nOffset + 3)>>2)<<2;
362 if (Seek(nPos + nOffset, icSeekSet)<0)
363 return false;
364 return true;
365}
366
367
368//////////////////////////////////////////////////////////////////////
369// Class CIccFileIO
370//////////////////////////////////////////////////////////////////////
371
373{
374 m_fFile = NULL;
375}
376
381
382bool CIccFileIO::Open(const icChar *szFilename, const icChar *szAttr)
383{
384#ifdef WIN32
385 char myAttr[20];
386
387 if (!strchr(szAttr, 'b')) {
388 myAttr[0] = szAttr[0];
389 myAttr[1] = 'b';
390 strcpy(myAttr+2, szAttr+1);
391 szAttr = myAttr;
392 }
393#endif
394
395 if (m_fFile)
396 fclose(m_fFile);
397
398 m_fFile = fopen(szFilename, szAttr);
399
400 return m_fFile != NULL;
401}
402
403
404#ifdef WIN32
405bool CIccFileIO::Open(const icWChar *szFilename, const icWChar *szAttr)
406{
407 icWChar myAttr[20];
408
409 if (!wcschr(szAttr, 'b')) {
410 myAttr[0] = szAttr[0];
411 myAttr[1] = 'b';
412 wcscpy(myAttr+2, szAttr+1);
413 szAttr = myAttr;
414 }
415
416 if (m_fFile)
417 fclose(m_fFile);
418
419 m_fFile = _wfopen(szFilename, szAttr);
420
421 return m_fFile != NULL;
422}
423#endif
424
425
427{
428 if (m_fFile)
429 fclose(m_fFile);
430
431 m_fFile = f;
432
433 return m_fFile != NULL;
434}
435
436
438{
439 m_fFile = NULL;
440}
441
442
444{
445 if (m_fFile) {
446 fclose(m_fFile);
447 m_fFile = NULL;
448 }
449}
450
451
453{
454 if (!m_fFile)
455 return 0;
456
457 return (icInt32Number)fread(pBuf, 1, nNum, m_fFile);
458}
459
460
462{
463 if (!m_fFile)
464 return 0;
465
466 return (icInt32Number)fwrite(pBuf, 1, nNum, m_fFile);
467}
468
469
471{
472 if (!m_fFile)
473 return 0;
474
475 fflush(m_fFile);
476 icInt32Number current = (icInt32Number)ftell(m_fFile), end;
477 fseek (m_fFile, 0, SEEK_END);
478 end = (icInt32Number)ftell(m_fFile);
479 fseek (m_fFile, current, SEEK_SET);
480 return end;
481}
482
483
485{
486 if (!m_fFile)
487 return -1;
488
489 return !fseek(m_fFile, nOffset, pos) ? (icInt32Number)ftell(m_fFile) : -1;
490}
491
492
494{
495 if (!m_fFile)
496 return -1;
497
498 return (icInt32Number)ftell(m_fFile);
499}
500
501
502//////////////////////////////////////////////////////////////////////
503// Class CIccEmbedIO
504//////////////////////////////////////////////////////////////////////
505
507{
508 m_pIO = NULL;
509 m_nStartPos = 0;
510 m_nSize = -1;
511 m_bOwnIO = false;
512}
513
518
519bool CIccEmbedIO::Attach(CIccIO *pIO, icInt32Number nSize/* =0 */, bool bOwnIO/* =false */)
520{
521 if (!pIO)
522 return false;
523
524 m_nStartPos = pIO->Tell();
525 m_nSize = nSize;
526 m_bOwnIO = bOwnIO;
527 m_pIO = pIO;
528
529 if (m_nStartPos < 0)
530 return false;
531
532 return true;
533}
534
535
537{
538 if (m_pIO && m_bOwnIO) {
539 m_pIO->Close();
540
541 delete m_pIO;
542 m_pIO = NULL;
543 }
544}
545
546
548{
549 if (!m_pIO)
550 return 0;
551
552 if (m_nSize > 0) {
553 icUInt32Number nPos = m_pIO->Tell();
554 icUInt32Number nOffset = nPos - m_nStartPos;
555
556 if (nOffset + nNum > (icUInt64Number)m_nSize)
557 nNum = m_nSize - nOffset;
558 }
559
560 return m_pIO->Read8(pBuf, nNum);
561}
562
563
565{
566 if (!m_pIO)
567 return 0;
568
569 return m_pIO->Write8(pBuf, nNum);
570}
571
572
574{
575 if (!m_pIO)
576 return 0;
577
578 if (m_nSize)
579 return m_nSize;
580
581 return m_pIO->GetLength() - m_nStartPos;
582}
583
584
586{
587 icInt32Number nPos;
588 if (!m_pIO)
589 return -1;
590
591 if (pos == icSeekSet) {
592 if (m_nSize > 0 && nOffset > m_nSize)
593 nOffset = m_nSize;
594 else if (nOffset < 0)
595 nOffset = m_nStartPos;
596
597 nPos = m_pIO->Seek(nOffset + m_nStartPos, icSeekSet);
598
599 }
600 else if (pos == icSeekEnd) {
601 if (m_nSize > 0) {
602 nOffset = m_nSize + nOffset;
603 }
604 else {
605 nOffset = nOffset + m_pIO->GetLength() - m_nStartPos;
606 }
607 if (nOffset < 0)
608 nOffset = 0;
609 nOffset += m_nStartPos;
610
611 nPos = m_pIO->Seek(nOffset, icSeekSet);
612 }
613 else {//pos == icSeekCur
614 nOffset = m_pIO->Tell() + nOffset;
615
616 if (m_nSize && nOffset - m_nStartPos > m_nSize)
617 nOffset = m_nStartPos + m_nSize;
618 else if (nOffset < m_nStartPos)
619 nOffset = m_nStartPos;
620
621 nPos = m_pIO->Seek(nOffset, icSeekSet);
622 }
623
624 if (nPos >= m_nStartPos)
625 return nPos - m_nStartPos;
626
627 return nPos;
628}
629
630
632{
633 if (!m_pIO)
634 return -1;
635
636 icUInt32Number nPos = m_pIO->Tell();
637
638 if ((icInt32Number)nPos >= m_nStartPos)
639 return nPos - m_nStartPos;
640
641 return nPos;
642}
643
644
645//////////////////////////////////////////////////////////////////////
646// Class CIccMemIO
647//////////////////////////////////////////////////////////////////////
648
650{
651 m_pData = NULL;
652 m_nSize = 0;
653 m_nAvail = 0;
654 m_nPos = 0;
655
656 m_bFreeData = false;
657}
658
660{
661 Close();
662}
663
664
665bool CIccMemIO::Alloc(icUInt32Number nSize, bool bWrite)
666{
667 if (m_pData)
668 Close();
669
670 icUInt8Number *pData = (icUInt8Number*)malloc(nSize);
671
672 if (!pData)
673 return false;
674
675 if (!Attach(pData, nSize, bWrite)) {
676 free(pData);
677 return false;
678 }
679
680 m_bFreeData = true;
681
682 return true;
683}
684
685
686bool CIccMemIO::Attach(icUInt8Number *pData, icUInt32Number nSize, bool bWrite)
687{
688 if (!pData)
689 return false;
690
691 if (m_pData)
692 Close();
693
694 m_pData = pData;
695 m_nPos = 0;
696
697 if (bWrite) {
698 m_nAvail = nSize;
699 m_nSize = 0;
700 }
701 else {
702 m_nAvail = m_nSize = nSize;
703 }
704
705 return true;
706}
707
708
710{
711 if (m_pData) {
712 if (m_bFreeData) {
713 free(m_pData);
714
715 m_bFreeData = false;
716 }
717 m_pData = NULL;
718 }
719}
720
721
723{
724 if (!m_pData)
725 return 0;
726 if (nNum > 0) {
727 nNum = __min((icInt32Number) (m_nSize - m_nPos), nNum);
728 memcpy(pBuf, m_pData + m_nPos, nNum);
729 m_nPos += nNum;
730 }
731 return nNum;
732}
733
734
736{
737 if (!m_pData)
738 return 0;
739
740 nNum = __min((icInt32Number)(m_nAvail-m_nPos), nNum);
741
742 memcpy(m_pData + m_nPos, pBuf, nNum);
743
744 m_nPos += nNum;
745 if (m_nPos > m_nSize)
746 m_nSize = m_nPos;
747
748 return nNum;
749}
750
751
753{
754 if (!m_pData)
755 return 0;
756
757 return m_nSize;
758}
759
760
762{
763 if (!m_pData)
764 return -1;
765
766 icInt32Number nPos;
767 switch(pos) {
768 case icSeekSet:
769 nPos = nOffset;
770 break;
771 case icSeekCur:
772 nPos = (icInt32Number)m_nPos + nOffset;
773 break;
774 case icSeekEnd:
775 nPos = (icInt32Number)m_nSize + nOffset;
776 break;
777 default:
778 nPos = 0;
779 break;
780 }
781
782 if (nPos < 0)
783 return -1;
784
785 icUInt32Number uPos = (icUInt32Number)nPos;
786
787 if (uPos > m_nSize && m_nSize != m_nAvail && uPos <=m_nAvail) {
788 memset(m_pData+m_nSize, 0, (icInt32Number)(uPos - m_nSize));
789 m_nSize = uPos;
790 }
791 if (uPos > m_nSize)
792 return -1;
793
794 m_nPos = uPos;
795
796 return nPos;
797}
798
799
801{
802 if (!m_pData)
803 return -1;
804
805 return (icInt32Number)m_nPos;
806}
807
808///////////////////////////////
809
810//////////////////////////////////////////////////////////////////////
811// Class CIccNullIO
812//////////////////////////////////////////////////////////////////////
813
815{
816 m_nSize = 0;
817 m_nPos = 0;
818}
819
824
825
827{
828 m_nPos = 0;
829 m_nSize = 0;
830}
831
832
834{
835}
836
837
839{
840 icInt32Number nLeft = m_nSize - m_nPos;
841 icInt32Number nRead = (nNum <= (icInt32Number)nLeft) ? nNum : nLeft;
842
843 memset(pBuf, 0, nRead);
844 m_nPos += nRead;
845
846 return nRead;
847}
848
849
851{
852 m_nPos += nNum;
853 if (m_nPos > m_nSize)
854 m_nSize = m_nPos;
855
856 return nNum;
857}
858
859
864
865
867{
868 icInt32Number nPos;
869 switch(pos) {
870 case icSeekSet:
871 nPos = nOffset;
872 break;
873 case icSeekCur:
874 nPos = (icInt32Number)m_nPos + nOffset;
875 break;
876 case icSeekEnd:
877 nPos = (icInt32Number)m_nSize + nOffset;
878 break;
879 default:
880 nPos = 0;
881 break;
882 }
883
884 if (nPos < 0)
885 return -1;
886
887 m_nPos = (icUInt32Number)nPos;
888
889 if (m_nPos>m_nSize)
890 m_nSize = m_nPos;
891
892 return nPos;
893}
894
895
900
901
902#ifdef USEREFICCMAXNAMESPACE
903} //namespace refIccMAX
904#endif
#define __min
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
char icChar
Definition IccDefs.h:109
#define __max(a, b)
Definition IccIO.cpp:78
File: IccIO.h.
icSeekVal
Seek types.
Definition IccIO.h:82
@ icSeekEnd
Definition IccIO.h:85
@ icSeekSet
Definition IccIO.h:83
@ icSeekCur
Definition IccIO.h:84
icFloat16Number icFtoF16(icFloat32Number num)
Definition IccUtil.cpp:673
icFloatNumber icF16toF(icFloat16Number num)
Definition IccUtil.cpp:629
File: IccUtil.h.
#define icSwab32(flt)
Definition IccUtil.h:289
void icSwab16Array(void *pVoid, int num)
Definition IccUtil.h:218
#define icSwab16(flt)
Definition IccUtil.h:288
#define icSwab64(flt)
Definition IccUtil.h:290
void icSwab64Array(void *pVoid, int num)
Definition IccUtil.h:264
void icSwab32Array(void *pVoid, int num)
Definition IccUtil.h:239
unsigned int icUInt32Number
bool Attach(CIccIO *pIO, icInt32Number nSize=0, bool bOwnIO=false)
Definition IccIO.cpp:519
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.cpp:585
bool m_bOwnIO
Definition IccIO.h:205
virtual ~CIccEmbedIO()
Definition IccIO.cpp:514
icInt32Number m_nSize
Definition IccIO.h:204
virtual void Close()
Definition IccIO.cpp:536
icInt32Number m_nStartPos
Definition IccIO.h:203
virtual icInt32Number Tell()
Definition IccIO.cpp:631
CIccIO * m_pIO
Definition IccIO.h:202
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:547
virtual icInt32Number GetLength()
Definition IccIO.cpp:573
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:564
virtual icInt32Number Tell()
Definition IccIO.cpp:493
virtual void Close()
Definition IccIO.cpp:443
virtual ~CIccFileIO()
Definition IccIO.cpp:377
void Detach()
Definition IccIO.cpp:437
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:452
virtual icInt32Number GetLength()
Definition IccIO.cpp:470
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:461
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.cpp:484
bool Open(const icChar *szFilename, const icChar *szAttr)
Definition IccIO.cpp:382
FILE * m_fFile
Definition IccIO.h:174
bool Attach(FILE *f)
Definition IccIO.cpp:426
Type: Class.
Definition IccIO.h:97
icInt32Number ReadFloat16Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:269
icInt32Number ReadFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:302
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
virtual icInt32Number GetLength()
Definition IccIO.h:130
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
icInt32Number WriteFloat16Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:285
virtual icInt32Number Tell()
Definition IccIO.h:133
bool Align32()
Write operation to make sure that filelength is evenly divisible by 4.
Definition IccIO.cpp:341
icInt32Number ReadUInt8Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:203
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icInt32Number ReadLine(void *pBuf8, icInt32Number nNum=256)
Definition IccIO.cpp:93
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.h:132
icInt32Number Write64(void *pBuf64, icInt32Number nNum=1)
Definition IccIO.cpp:182
icInt32Number WriteFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:321
icInt32Number WriteUInt8Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:219
icInt32Number ReadUInt16Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:236
icInt32Number Read64(void *pBuf64, icInt32Number nNum=1)
Definition IccIO.cpp:173
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
bool Sync32(icUInt32Number nOffset=0)
Operation to make sure read position is evenly divisible by 4.
Definition IccIO.cpp:357
virtual void Close()
Definition IccIO.h:102
icInt32Number WriteUInt16Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:252
virtual icInt32Number Tell()
Definition IccIO.cpp:800
bool Alloc(icUInt32Number nSize, bool bWrite=false)
Definition IccIO.cpp:665
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.cpp:761
icUInt32Number m_nPos
Definition IccIO.h:241
virtual void Close()
Definition IccIO.cpp:709
icUInt32Number m_nSize
Definition IccIO.h:239
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:722
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:735
virtual icInt32Number GetLength()
Definition IccIO.cpp:752
icUInt32Number m_nAvail
Definition IccIO.h:240
CIccMemIO()
Definition IccIO.cpp:649
bool Attach(icUInt8Number *pData, icUInt32Number nSize, bool bWrite=false)
Definition IccIO.cpp:686
virtual ~CIccMemIO()
Definition IccIO.cpp:659
bool m_bFreeData
Definition IccIO.h:243
icUInt8Number * m_pData
Definition IccIO.h:238
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:838
virtual icInt32Number GetLength()
Definition IccIO.cpp:860
icUInt32Number m_nPos
Definition IccIO.h:274
virtual void Close()
Definition IccIO.cpp:833
icUInt32Number m_nSize
Definition IccIO.h:273
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:850
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.cpp:866
virtual icInt32Number Tell()
Definition IccIO.cpp:896
void Open()
Definition IccIO.cpp:826
virtual ~CIccNullIO()
Definition IccIO.cpp:820
unsigned char icUInt8Number
Number definitions.
float icFloat32Number
unsigned short icUInt16Number
long icInt32Number
char icInt8Number
Signed numbers.
icUInt16Number icFloat16Number
IEEE float storage numbers.
icUInt32Number icUInt64Number[2]