Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c923a9de
Kaydet (Commit)
c923a9de
authored
Ock 15, 2014
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bin unused code
Change-Id: Ie10881ab3f6e252c87fc3fedcf6a2b7fa0af2c56
üst
65be2247
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
236 deletions
+0
-236
Library_vcl.mk
vcl/Library_vcl.mk
+0
-1
salmathutils.hxx
vcl/inc/quartz/salmathutils.hxx
+0
-81
salmathutils.cxx
vcl/quartz/salmathutils.cxx
+0
-154
No files found.
vcl/Library_vcl.mk
Dosyayı görüntüle @
c923a9de
...
...
@@ -423,7 +423,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/osx/service_entry \
$(vcl_quartz_code) \
vcl/quartz/salgdiutils \
vcl/quartz/salmathutils \
vcl/osx/salnativewidgets \
vcl/osx/salprn \
vcl/osx/salframe \
...
...
vcl/inc/quartz/salmathutils.hxx
deleted
100644 → 0
Dosyayı görüntüle @
65be2247
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_VCL_INC_QUARTZ_SALMATHUTILS_HXX
#define INCLUDED_VCL_INC_QUARTZ_SALMATHUTILS_HXX
#ifdef __cplusplus
extern
"C"
{
#endif
// ------------------------------------------------------------------
//
// Structures
//
// ------------------------------------------------------------------
// LRectCoor is an abreviation for rectangular coordinates
// represented as long integers
struct
LRectCoor
{
long
x
;
long
y
;
long
z
;
};
// ------------------------------------------------------------------
//
// Type Definitions
//
// ------------------------------------------------------------------
// LRectCoorVec is an abreviation for vectors in rectangular
// coordinates represented as long integers
typedef
struct
LRectCoor
LRectCoor
;
typedef
LRectCoor
*
LRectCoorVector
;
typedef
LRectCoorVector
*
LRectCoorTensor
;
// ------------------------------------------------------------------
//
// Function Headers
//
// ------------------------------------------------------------------
void
CSwap
(
char
&
rX
,
char
&
rY
);
void
UCSwap
(
unsigned
char
&
rX
,
unsigned
char
&
rY
);
void
SSwap
(
short
&
rX
,
short
&
rY
);
void
USSwap
(
unsigned
short
&
rX
,
unsigned
short
&
rY
);
void
LSwap
(
long
&
rX
,
long
&
rY
);
void
ULSwap
(
unsigned
long
&
rX
,
unsigned
long
&
rY
);
// ------------------------------------------------------------------
unsigned
long
Euclidian2Norm
(
const
LRectCoorVector
pVec
);
// ------------------------------------------------------------------
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_VCL_INC_QUARTZ_SALMATHUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/quartz/salmathutils.cxx
deleted
100644 → 0
Dosyayı görüntüle @
65be2247
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "quartz/salmathutils.hxx"
#include <stdlib.h>
// =======================================================================
// =======================================================================
#define Swap( x, y ) { x ^= y; y ^= x; x ^= y; }
// =======================================================================
// =======================================================================
// Storage free swapping using XOR
void
CSwap
(
char
&
rX
,
char
&
rY
)
{
Swap
(
rX
,
rY
);
}
// CSwap
// -----------------------------------------------------------------------
// Storage free swapping using XOR
void
UCSwap
(
unsigned
char
&
rX
,
unsigned
char
&
rY
)
{
Swap
(
rX
,
rY
);
}
// UCSwap
// -----------------------------------------------------------------------
// Storage free swapping using XOR
void
SSwap
(
short
&
rX
,
short
&
rY
)
{
Swap
(
rX
,
rY
);
}
// SSwap
// -----------------------------------------------------------------------
// Storage free swapping using XOR
void
USSwap
(
unsigned
short
&
rX
,
unsigned
short
&
rY
)
{
Swap
(
rX
,
rY
);
}
// USSwap
// -----------------------------------------------------------------------
// Storage free swapping using XOR
void
LSwap
(
long
&
rX
,
long
&
rY
)
{
Swap
(
rX
,
rY
);
}
// LSwap
// -----------------------------------------------------------------------
// Storage free swapping using XOR
void
ULSwap
(
unsigned
long
&
rX
,
unsigned
long
&
rY
)
{
Swap
(
rX
,
rY
);
}
// ULSwap
// =======================================================================
// =======================================================================
// -----------------------------------------------------------------------
//
// This way of measuring distance is also called the "Manhattan distance."
// Manhattan distance takes advantage of the fact that the sum of the
// lengths of the three components of a 3D vector is a rough approxima-
// tion of the vector's length.
//
// -----------------------------------------------------------------------
unsigned
long
Euclidian2Norm
(
const
LRectCoorVector
pVec
)
{
unsigned
long
ndist
=
0
;
if
(
pVec
)
{
long
nDX
=
0
;
long
nDY
=
0
;
long
nDZ
=
0
;
unsigned
long
nMax
=
0
;
unsigned
long
nMed
=
0
;
unsigned
long
nMin
=
0
;
// Find |x'-x|, |y'-y|, and |z'-z| from (x,y,z) and (x',y',z')
nDX
=
pVec
[
1
].
x
-
pVec
[
0
].
x
;
nDY
=
pVec
[
1
].
y
-
pVec
[
0
].
y
;
nDZ
=
pVec
[
1
].
z
-
pVec
[
0
].
z
;
nMax
=
(
unsigned
long
)
abs
(
nDX
);
nMed
=
(
unsigned
long
)
abs
(
nDY
);
nMin
=
(
unsigned
long
)
abs
(
nDZ
);
// Sort them (3 compares, 0-3 swaps)
if
(
nMax
<
nMed
)
{
Swap
(
nMax
,
nMed
);
}
// if
if
(
nMax
<
nMin
)
{
Swap
(
nMax
,
nMin
);
}
// if
// Approximate Euclidian distance:
//
// d = max + (11/32)*med + (1/4)*min
//
// with +/- 8% error, where the exact formulae for d is
//
// || (x',y',z') - (x,y,z) || = { |x'-x|^2 + |y'-y|^2 + |z'-z|^2 }^(1/2)
ndist
=
nMax
+
(
nMin
>>
2UL
)
+
(
(
(
nMed
<<
3UL
)
+
(
nMed
<<
1UL
)
+
nMed
)
>>
5UL
);
}
// if
return
ndist
;
}
// RGBDistance
// =======================================================================
// =======================================================================
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment